/* body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', 'Roboto', 'Arial', sans-serif;
} */

body {
    display: flex;
    background-color: #5d5370;
    background-image: url('/resouces/loading_page_image_2.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    font-family: 'Segoe UI', 'Roboto', 'Arial', sans-serif;
}

.container {
    max-width: 1200px;
}

.cursor-pointer {
    cursor: pointer;
}

.image-container {
    height: 300px; /* Увеличаваме базовата височина за мобилни устройства */
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin: 0 auto;
    max-width: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 8px;
}

.image-container:hover .overlay {
    opacity: 1;
}

.overlay-text {
    /* Прилагаме стилове, подобни на .btn-primary, за консистентност */
    background-color: rgba(0, 0, 0);
    border: 2px solid rgba(255, 255, 255);
    color: white;
    padding: 10px 16px;
    border-radius: 50px;
    font-weight: 600;
    transform: translateY(10px);
    transition: all 0.3s ease; /* Променяме, за да анимираме и фона/рамката */
}

.image-container:hover .overlay-text {
    transform: translateY(0);
    background: rgba(0, 0, 0, 0.7);
    border-color: white;
}

.card {
    border: none;
    transition: all 0.3s ease;
    border-radius: 12px;
}

.card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.btn {
    border-radius: 50px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    color: white;
}

.btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}

.btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background-color: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.7);
}

/* .btn-success {
    background-color: #198754;
    border-color: #198754;
} */

.btn-info {
    background-color: #0dcaf0;
    border-color: #0dcaf0;
    color: #fff;
}

.btn:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
    opacity: 0.65;
    transform: none;
    box-shadow: none;
}

.status {
    font-weight: 500;
    color: #6c757d;
    margin-top: 10px;
}

.hidden {
    display: none;
}

/* Responsive adjustments */
/* @media (max-width: 768px) {
    .image-container {
        height: 200px;
    }
}

@media (max-width: 576px) {
    .image-container {
        height: 180px;
    }
} */

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* .btn-primary:hover, .btn-success:hover, .btn-info:hover {
    animation: pulse 1.5s infinite;
} */

h1 {
    color: #333;
}

.upload-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    width: 100%; /* Ensure it takes width */
    max-width: 800px; /* Optional: Limit max width */
}

.image-label {
    cursor: pointer;
    display: block;
    width: 100%;
    height: 100%;
}

.image-label img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

/* Стилове за потребителското име */
#currentUser {
    position: fixed; /* Фиксира позицията спрямо видимата част на екрана */
    top: 10px;       /* Отстояние от горния край */
    right: 15px;      /* Отстояние от десния край */
    z-index: 1000;   /* Гарантира, че е над повечето други елементи */
    background-color: transparent; /* Премахваме фона, за да няма "квадрат" */
    padding: 5px 10px; /* Малко вътрешно отстояние */
    border-radius: 5px; /* Заоблени ъгли (по избор) */
    color: white; /* Задаваме бял цвят на текста за контраст */
    font-weight: 600; /* Правим текста малко по-плътен */
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7); /* Добавяме сянка за отлична четимост върху всякакъв фон */
}

.btn-info {
    background: linear-gradient(135deg, #0dcaf0, #0b9fd8);
    color: #fff !important;
}

/* Стилове за статус */
.status {
    margin-top: 10px;
    min-height: 24px;
    font-size: 0.9rem;
    word-wrap: break-word;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 4px;
}

.status.loading {
    color: #6c757d;
    font-style: italic;
    animation: pulse 1.5s infinite;
    background-color: rgba(108, 117, 125, 0.1);
}

.status.success {
    /* Променяме цвета на текста на бял за по-добър контраст на тъмен фон */
    color: #fff;
    /* Задаваме по-плътен, но все пак прозрачен фон */
    background-color: rgba(25, 135, 84, 0.6);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); /* Добавяме сянка за четимост */
}

.status.error {
    color: #fff;
    background-color: rgba(220, 53, 69, 0.6);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Карти и сенки */
.card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #495057;
}

/* Стил за резултатното изображение */
#previewResult {
    object-fit: contain;
    background-color: #f8f9fa;
}

/* Анимации за бутони */
@keyframes buttonPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

.btn:not(:disabled) {
    animation: buttonPulse 2s infinite;
}

/* Стилове за деактивирани бутони */
button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    animation: none;
}

/* Медиа заявки за респонсивност */
@media (min-width: 768px) {
    .image-container {
        max-width: 380px; /* Леко увеличаваме и ширината за таблети */
        height: 380px;  /* Увеличаваме височината за таблети */
    }
}

@media (min-width: 992px) {
    .image-container {
        max-width: 420px; /* Леко увеличаваме и ширината за по-големи екрани */
        height: 450px;  /* Увеличаваме височината за по-големи екрани */
    }
}

@media (max-width: 576px) { 
    .overlay-text {
        font-size: 0.9rem;
        padding: 8px 12px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Допълнителни стилове */
.shadow-sm {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
}

.py-3 {
    transition: all 0.3s ease;
}

.fw-bold {
    letter-spacing: 0.5px;
}

.image-uploader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    /* Премахваме фона, рамката и сянката, за да се слее с основния фон */
    background-color: transparent;
    border: none;
    box-shadow: none;
    padding: 5px; /* Намаляваме вътрешното отстояние, за да е по-компактно */
    text-align: center; /* Center text below image */
}

.image-label span {
    font-size: 0.9em;
}

input[type="file"] {
    display: none; /* Hide the default file input */
}

.button-container {
    display: flex;
    gap: 15px; /* Space between buttons */
    margin-top: 10px;
}

button {
    padding: 10px 20px;
    font-size: 1em;
    color: #fff;
    background-color: #007bff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* button:not(:disabled):hover {
    background-color: #0056b3;
} */


/* Styles for the new Save button */
#saveButton {
   background-color: #17a2b8; /* Example: Info color */
}

#saveButton:not(:disabled):hover {
    background-color: #138496;
}

/* Responsive adjustments */
@media (max-width: 700px) { /* Adjusted breakpoint */
    .upload-container {
        /* Keep as row or change to column depending on preference */
         gap: 20px;
    }
     .image-uploader {
        min-width: 150px; /* Smaller min-width on smaller screens */
    }
    .button-container {
        flex-direction: column; /* Stack buttons vertically */
        align-items: center;
    }
} 

/* Home Page CSS */

.home-button-group {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.home-button {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    width: 130px;
}

.home-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Стил за бутона за връщане */
#back-button {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 40; /* Най-отгоре */
    background-color: rgba(44, 62, 80, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    /* Премахваме text-transform: uppercase; ако идва от .home-button */
    text-transform: none;
    padding: 0; /* Нулираме padding, ако идва от .home-button */
}

#back-button-V2 { /* Стил за бутона назад, ако липсва */
    position: absolute;
    top: 15px;
    left: 15px;
    background: url('path/to/your/back-icon.svg') no-repeat center center; /* Смени с реален път */
    background-size: contain;
    width: 30px;
    height: 30px;
    border: none;
    cursor: pointer;
    z-index: 10;
}

#back-button:hover {
    background-color: #34495e;
    transform: scale(1.1);
}
/* Добавяме икона за връщане (пример с FontAwesome) */
#back-button::before {
    content: "\f060"; /* FontAwesome код за лява стрелка */
    font-family: "Font Awesome 5 Free"; /* Или 6 Free, увери се, че е заредена */
    font-weight: 900;
}

/* Статус МОДАЛ */
.status-modal-overlay {
    display: none; /* Скрито по подразбиране */
    position: fixed; /* Фиксирано спрямо viewport */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Полупрозрачен фон */
    z-index: 1100; /* Над всичко друго (дори над камера модала, ако трябва) */
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px); /* Ефектно замъгляване */
}

.status-modal-content {
    background-color: #fff;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 80%;
    width: 300px; /* Или друга ширина */
    color: #333;
}

.status-modal-text {
    margin-top: 20px;
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.5;
}

#status-modal-icon i {
    color: #0d6efd; /* Основен цвят */
    margin-bottom: 15px;
}

/* Класове за различни състояния */
.status-modal-content.loading #status-modal-icon i {
    color: #0d6efd; /* Синьо за зареждане */
    animation: spin 1.5s linear infinite; /* Анимация за въртене */
}

.status-modal-content.success #status-modal-icon i {
    color: #198754; /* Зелено за успех */
    animation: none;
    content: "\f058"; /* FontAwesome check-circle */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}

.status-modal-content.error #status-modal-icon i {
    color: #dc3545; /* Червено за грешка */
    animation: none;
    content: "\f071"; /* FontAwesome exclamation-triangle */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}

/* Анимация за въртене (ако не ползваш fa-spin) */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* Reward Ad Modal Styles */
.reward-ad-modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1060; /* Above other modals */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    /* overflow: hidden; */ /* <-- ПРЕМАХВАМЕ ТОВА */
    background-color: rgba(0, 0, 0, 0.95); /* Darker background */
    backdrop-filter: blur(5px);
    /*display: flex;  Use flex to center */
    justify-content: center;
    align-items: center;
    padding: 15px; /* Добавяме малко padding около съдържанието */
    box-sizing: border-box; /* Включваме padding-а в размерите */
}

.reward-ad-content {
    background-color: #222; /* Dark theme for content */
    padding: 20px;
    padding-bottom: 30px; /* <-- ДОБАВЯМЕ ПОВЕЧЕ PADDING ОТДОЛУ */
    border-radius: 8px;
    text-align: center;
    max-width: 90%;
    max-height: 95%; /* <-- МОЖЕ ЛЕКО ДА УВЕЛИЧИМ, ЗАЩОТО ИМА СКРОЛ */
    display: flex;
    flex-direction: column;
    color: #eee; /* Light text */
    box-shadow: 0 5px 25px rgba(0,0,0,0.7);
    overflow-y: auto; /* <-- ДОБАВЯМЕ ВЕРТИКАЛЕН СКРОЛ ПРИ НУЖДА */
    overflow-x: hidden; /* Предотвратяваме хоризонтален скрол */
}

.reward-ad-text {
    margin-bottom: 15px;
    font-size: 1.1em;
    flex-shrink: 0; /* Предотвратяваме свиването на текста */
}

.reward-video-container {
    position: relative;
    width: 100%;
    /* max-width: 80vw; */ /* Може да премахнем max-width в vw, тъй като родителят има max-width */
    max-height: 65vh; /* <-- НАМАЛЯВАМЕ ЛЕКО МАКС. ВИСОЧИНА НА ВИДЕОТО */
    background-color: #000; /* Black background for video area */
    margin-bottom: 15px; /* Space before button */
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    overflow: hidden; /* Ensure video stays within bounds */
    flex-shrink: 1; /* Позволяваме на видео контейнера да се свива, ако е нужно */
    min-height: 150px; /* Минимална височина, за да не изчезва напълно */
}

#reward-ad-video {
    display: block;
    max-width: 100%;
    max-height: 100%; /* Fill container */
    border-radius: 4px;
    object-fit: contain; /* Гарантира, че цялото видео се вижда */
}

.reward-ad-spinner {
    position: absolute;
    color: #ccc;
    text-align: center;
}
.reward-ad-spinner i {
    font-size: 3em;
}
.reward-ad-spinner p {
    margin-top: 10px;
    font-size: 1em;
}

#reward-ad-close-button {
    cursor: pointer;
    min-width: 150px; /* Ensure button is reasonably sized */
    margin-top: auto; /* <-- ПРОМЯНА: Избутва бутона надолу, ако има място */
    padding-top: 10px; /* Добавяме малко отстояние отгоре */
    flex-shrink: 0; /* Предотвратяваме свиването на бутона */
}

#reward-ad-close-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Допълнителни медийни заявки за много малки екрани (по избор) */
@media (max-height: 400px) {
    .reward-ad-content {
        padding: 15px;
        padding-bottom: 20px;
    }
    .reward-video-container {
        max-height: 50vh; /* Още по-малко видео на ниски екрани */
        min-height: 100px;
    }
    .reward-ad-text {
        font-size: 1em;
        margin-bottom: 10px;
    }
    #reward-ad-close-button {
        min-width: 120px;
        font-size: 0.9em;
    }
}

#status-modal.visible {
    display: flex;
}

/*
 * Промяна на стила на бутона на AI асистента.
 * Задаваме черен фон на бутона и бяла икона, за да се вписва по-добре в общия дизайн.
 */
#ai-assistant-fab {
    background-color: rgba(0, 0, 0, 0.7); /* Черен фон */
    border: 2px solid rgba(255, 255, 255, 0.7); /* Рамка, подобна на другите бутони */
}
#ai-assistant-fab i.fas.fa-robot {
    color: #fff; /* Бяла икона */
}

#app-container {
    margin-top: 30px;
}
