/* =========================================
   AUTH-MODAL & PROFILE MENU (TAILORED LUXURY)
   ========================================= */

/* --- Иконка за профил --- */
.profile-menu-container { position: relative; margin-left: 35px; }
.profile-btn {
    font-size: 1.5rem; color: var(--color-text);
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid transparent; transition: all 0.3s ease;
    cursor: pointer; text-decoration: none; background: transparent;
}
.profile-btn:hover { color: var(--color-primary); border-color: var(--color-secondary); transform: scale(1.08); }
.profile-btn.logged-in { color: var(--color-primary); background: rgba(0, 139, 139, 0.08); }
.profile-btn.logged-in:hover, .profile-btn.is-active {
    background: var(--color-primary); color: #fff; transform: scale(1.08);
}

/* --- Падащо меню --- */
.profile-dropdown {
    position: absolute; top: 135%; left: 0px; width: 210px;
    background: #fff; border-radius: 12px; box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 1000; border: 1px solid #eee;
}
.profile-dropdown.active { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-header {
    padding: 18px 20px; border-bottom: 1px solid #eee; background: #fdfbf7; border-radius: 12px 12px 0 0;
    font-size: 0.95rem; color: #666; line-height: 1.4;
}
.dropdown-header strong { color: var(--color-primary); font-size: 1.15rem; font-family: var(--font-heading); }
.dropdown-list { list-style: none; padding: 5px 0; margin: 0; }
.dropdown-list li a {
    display: flex; align-items: center; gap: 12px; padding: 12px 20px;
    color: #555; text-decoration: none; font-weight: 600; font-size: 0.95rem; transition: 0.2s; border-radius: 18px; border-left: 2px;
}
.dropdown-list li a i { color: var(--color-secondary); width: 16px; text-align: center; }
.dropdown-list li a:hover { color: var(--color-primary); background: #f0fdfd; padding-left: 25px; border: 2px var(--color-primary)}
.dropdown-list li.logout-li a { color: #e26456; border: 1px dashed #e26456; margin-top: 5px; }
.dropdown-list li.logout-li a:hover { color: #e74c3c; border: 1px dashed #e74c3c; margin-top: 5px; background: #fff3f3;}
.dropdown-list li.logout-li a i { color: #e26456; }

/* --- ОБЩИ МОДАЛИ --- */
/* --- ОБЩИ МОДАЛИ --- */
.auth-modal-overlay, .delete-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(5px);
    z-index: 9999; display: flex; 
    align-items: flex-start; /* ПРОМЯНА: Предотвратява отрязването на върха */
    justify-content: center;
    overflow-y: auto; /* ПРОМЯНА: Активира скролбар, когато формата е дълга */
    opacity: 0; visibility: hidden; transition: all 0.3s ease; 
    padding: 40px 20px; /* ПРОМЯНА: Повече въздух отгоре и отдолу */
}
.auth-modal-overlay.active, .delete-modal-overlay.active { opacity: 1; visibility: visible; }

.auth-modal-box {
    background: #fff; width: 100%; max-width: 400px;
    border-radius: 20px; padding: 45px 40px; position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    transform: translateY(20px); transition: all 0.3s ease;
    margin: auto; /* ДОБАВЕНО: Центрира перфектно при скрол */
}

.delete-modal-box {
    background: #fff; width: 100%; max-width: 420px;
    border-radius: 20px; padding: 40px 30px; text-align: center; position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    transform: translateY(20px) scale(0.95); transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin: auto; /* ДОБАВЕНО */
}

.profile-modal-box { 
    max-width: 850px; 
    padding: 0; 
    overflow: hidden; 
    background: #fff;
    display: flex; 
    margin: auto; /* ДОБАВЕНО */
    border-radius: 20px; /* ДОБАВЕНО: за да е красиво заоблен */
}
.auth-modal-overlay.active .auth-modal-box { transform: translateY(0); }

.close-auth-modal {
    position: absolute; top: 15px; right: 15px; background: rgba(0,0,0,0.05); border: none;
    font-size: 1.1rem; color: #888; cursor: pointer; transition: 0.3s;
    width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; z-index: 10;
}
.close-auth-modal:hover { background: #e74c3c; color: #fff; transform: rotate(90deg) scale(1.05); }

/* --- ТАБОВЕ ЗА ВХОД/РЕГ --- */
.auth-tabs { display: flex; border-bottom: 2px solid #f0f0f0; margin-bottom: 30px; }
.auth-tab {
    flex: 1; background: none; border: none; padding: 10px 0;
    font-family: var(--font-heading); font-size: 1.25rem; color: #bbb;
    cursor: pointer; position: relative; transition: 0.3s;
}
.auth-tab::after {
    content: ''; position: absolute; bottom: -2px; left: 0; width: 100%; height: 3px;
    transform: scaleX(0); transition: 0.3s; border-radius: 3px 3px 0 0;
}
.auth-tab[data-target="loginForm"].active { color: var(--color-secondary); }
.auth-tab[data-target="loginForm"].active::after { background: var(--color-secondary); transform: scaleX(1); }
.auth-tab[data-target="registerForm"].active { color: var(--color-primary); }
.auth-tab[data-target="registerForm"].active::after { background: var(--color-primary); transform: scaleX(1); }

/* =========================================
   ФОРМИ И ПОЛЕТА (РАЗДЕЛЕНИ ПО ЦВЕТОВЕ)
   ========================================= */
.auth-form { display: none; text-align: center; }
.auth-form.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.auth-form p { color: #888; margin-bottom: 25px; font-size: 0.95rem; }

/* ОБЩИ СТИЛОВЕ ЗА ПОЛЕТАТА (Основата) */
.input-group { position: relative; margin-bottom: 15px; }
.input-group .left-icon { position: absolute; top: 50%; left: 15px; transform: translateY(-50%); color: #ccc; font-size: 1rem; transition: 0.3s; }
.input-group .right-icon { 
    position: absolute; top: 50%; right: 15px; transform: translateY(-50%); 
    color: #888; font-size: 1.1rem; cursor: pointer; transition: 0.2s; opacity: 0.6;
}
.input-group .right-icon:hover, .input-group .right-icon.fa-eye-slash { color: var(--color-accent); opacity: 1; }

.input-group input {
    width: 100%; padding: 14px 40px; border: 1.5px solid #eee;
    border-radius: 12px; font-family: var(--font-body); font-size: 0.95rem;
    background: #fdfdfd; box-sizing: border-box; transition: 0.3s; color: #444; outline: none;
}

/* ОБЩИ СТИЛОВЕ ЗА БУТОНИТЕ */
.auth-submit {
    width: 100%; padding: 15px; color: white; border: none; border-radius: 12px; 
    font-size: 1.05rem; font-weight: 700; letter-spacing: 1px; cursor: pointer; transition: 0.3s;
}

/* -----------------------------------------
   1. ВХОД (Лилаво)
   ----------------------------------------- */
#loginForm h3 { font-family: var(--font-heading); font-size: 1.8rem; margin-bottom: 5px; color: var(--color-secondary); }
#loginForm .input-group:focus-within input { border-color: var(--color-secondary); box-shadow: 0 0 0 3px rgba(147, 112, 219, 0.1); color: var(--color-primary); }
#loginForm .input-group:focus-within .left-icon { color: var(--color-primary); }
#loginForm .auth-submit { background: var(--color-secondary); box-shadow: 0 5px 15px rgba(147, 112, 219, 0.2); }
#loginForm .auth-submit:hover { background: #7a52b3; transform: translateY(-2px); }

/* -----------------------------------------
   2. РЕГИСТРАЦИЯ (Тюркоаз)
   ----------------------------------------- */
#registerForm h3 { font-family: var(--font-heading); font-size: 1.8rem; margin-bottom: 5px; color: var(--color-primary); }
#registerForm .input-group:focus-within input { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(0, 139, 139, 0.1); color: var(--color-secondary); }
#registerForm .input-group:focus-within .left-icon { color: var(--color-secondary); }
#registerForm .auth-submit { background: var(--color-primary); box-shadow: 0 5px 15px rgba(0, 139, 139, 0.2); }
#registerForm .auth-submit:hover { background: #007777; transform: translateY(-2px); }

/* -----------------------------------------
   3. ЗАБРАВЕНА ПАРОЛА (Оранжево)
   ----------------------------------------- */
#forgotPassForm h3 { font-family: var(--font-heading); font-size: 1.8rem; margin-bottom: 5px; color: var(--color-accent); }
#forgotPassForm .input-group:focus-within input { border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(210, 105, 30, 0.1); color: var(--color-accent); }
#forgotPassForm .input-group:focus-within .left-icon { color: var(--color-accent); }
#forgotPassForm .auth-submit { background: var(--color-accent); box-shadow: 0 5px 15px rgba(210, 105, 30, 0.2); }
#forgotPassForm .auth-submit:hover { background: #b85c17; transform: translateY(-2px); }

/* -----------------------------------------
   4. НОВА ПАРОЛА ОТ ИМЕЙЛА (Тюркоаз)
   ----------------------------------------- */
#resetPassForm h3 { font-family: var(--font-heading); font-size: 1.8rem; margin-bottom: 5px; color: var(--color-secondary); }
#resetPassForm .input-group:focus-within input { border-color: var(--color-secondary); box-shadow: 0 0 0 3px rgba(147, 112, 219, 0.1); color: var(--color-primary); }
#resetPassForm .input-group:focus-within .left-icon { color: var(--color-primary); }
#resetPassForm .auth-submit { background: var(--color-secondary); box-shadow: 0 5px 15px rgba(147, 112, 219, 0.2); }
#resetPassForm .auth-submit:hover { background: #7a52b3; transform: translateY(-2px); }

/* -----------------------------------------
   5. ПРОФИЛ: ИМЕ (Тюркоаз)
   ----------------------------------------- */
#prof-username h3 { font-family: var(--font-heading); font-size: 2rem; margin-bottom: 8px; color: var(--color-primary); }
#prof-username .input-group:focus-within input { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(0, 139, 139, 0.1); color: var(--color-secondary); }
#prof-username .input-group:focus-within .left-icon { color: var(--color-secondary); }
#prof-username .auth-submit { background: var(--color-primary); box-shadow: 0 5px 15px rgba(0, 139, 139, 0.2); }
#prof-username .auth-submit:hover { background: #007777; transform: translateY(-2px); }

/* -----------------------------------------
   6. ПРОФИЛ: ИМЕЙЛ (Лилаво)
   ----------------------------------------- */
#prof-email h3 { font-family: var(--font-heading); font-size: 2rem; margin-bottom: 8px; color: var(--color-secondary); }
#prof-email .input-group:focus-within input { border-color: var(--color-secondary); box-shadow: 0 0 0 3px rgba(147, 112, 219, 0.1); color: var(--color-primary); }
#prof-email .input-group:focus-within .left-icon { color: var(--color-primary); }
#prof-email .auth-submit { background: var(--color-secondary); box-shadow: 0 5px 15px rgba(147, 112, 219, 0.2); }
#prof-email .auth-submit:hover { background: #7a52b3; transform: translateY(-2px); }

/* -----------------------------------------
   7. ПРОФИЛ: ПАРОЛА (Оранжево)
   ----------------------------------------- */
#prof-password h3 { font-family: var(--font-heading); font-size: 2rem; margin-bottom: 8px; color: var(--color-primary); }
#prof-password .input-group:focus-within input { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(0, 139, 139, 0.1); color: var(--color-secondary); }
#prof-password .input-group:focus-within .left-icon { color: var(--color-secondary); }
#prof-password .auth-submit { background: var(--color-primary); box-shadow: 0 5px 15px rgba(0, 139, 139, 0.2); }
#prof-password .auth-submit:hover { background: #007777; transform: translateY(-2px); }

/* Линкове и Бутони */
.auth-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; font-size: 0.9rem; }
.auth-actions label { color: #666; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.auth-actions input[type="checkbox"] { accent-color: var(--color-secondary); }

.forgot-pass-link { color: #D2691E; text-decoration: none; transition: 0.2s; font-weight: 600; }
.forgot-pass-link:hover { text-decoration: underline; color: #943b00; }

.auth-terms-text { font-size: 0.8rem !important; margin-top: 20px; color: #999 !important; }
.auth-terms-text a { color: #D2691E; font-weight: 600; text-decoration: none; transition: 0.2s; }
.auth-terms-text a:hover { text-decoration: underline; color: #943b00; }

.auth-submit {
    width: 100%; padding: 15px; color: white; border: none; border-radius: 12px; 
    font-size: 1.05rem; font-weight: 700; letter-spacing: 1px; cursor: pointer; transition: 0.3s;
    background: var(--color-primary); box-shadow: 0 5px 15px rgba(0, 139, 139, 0.2);
}
.auth-submit:hover { background: #007777; transform: translateY(-2px); }
#loginForm .auth-submit { background: var(--color-secondary); box-shadow: 0 5px 15px rgba(147, 112, 219, 0.2); }
#loginForm .auth-submit:hover { background: #7a52b3; }

.auth-message { padding: 12px; border-radius: 8px; margin-bottom: 15px; font-size: 0.9rem; text-align: center; display: none; font-weight: 600; }
.auth-message.error { background: #fff2f2; color: #d9534f; border: 1px solid #f5c6cb; }
.auth-message.success { background: #f0fff4; color: #28a745; border: 1px solid #c3e6cb; }
/* =========================================
   РАЗДЕЛИТЕЛ И GOOGLE БУТОН
   ========================================= */
.google-btn-wrapper {
    display: flex; 
    justify-content: center; 
    width: 100%;
    margin-bottom: 5px;
}
.auth-separator {
    display: flex; align-items: center; text-align: center; margin: 20px 0; color: #aaa; font-size: 0.9rem;
}
.auth-separator::before, .auth-separator::after {
    content: ''; flex: 1; border-bottom: 1px solid #f0f0f0;
}
.auth-separator::before { margin-right: .8em; }
.auth-separator::after { margin-left: .8em; }
/* =========================================
   ПОТВЪРЖДЕНИЯ (МОДАЛИ ЗА ИЗТРИВАНЕ/ПАРОЛА)
   ========================================= */
.delete-modal-overlay.active .delete-modal-box { transform: translateY(0) scale(1); }

.delete-modal-icon { font-size: 3.5rem; color: #e74c3c; margin-bottom: 15px; }
.delete-modal-box h3 { font-family: var(--font-heading); font-size: 1.8rem; color: #333; margin-bottom: 10px; }
.delete-modal-box p { color: #666; font-size: 0.95rem; line-height: 1.6; margin-bottom: 25px; }

.delete-modal-actions { display: flex; gap: 15px; justify-content: center; }
.btn-cancel {
    flex: 1; padding: 14px; background: #f0f0f0; color: #555; border: none;
    border-radius: 12px; font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: 0.2s;
}
.btn-cancel:hover { background: #e0e0e0; color: #333; }
.btn-confirm-delete {
    width: 100%; padding: 14px; background: #e74c3c; color: #fff; border: none;
    border-radius: 12px; font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: 0.2s;
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.2);
}
.btn-confirm-delete:hover { background: #c0392b; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(231, 76, 60, 0.3); }

.close-delete-modal {
    position: absolute; top: 15px; right: 15px; background: #f5f5f5; border: none;
    font-size: 1.1rem; color: #888; cursor: pointer; transition: 0.3s;
    width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
}
.close-delete-modal:hover { background: #e74c3c; color: #fff; transform: rotate(90deg); }

/* =========================================
   МОЯТ ПРОФИЛ - СВЕТЪЛ И ЛУКСОЗЕН ИЗГЛЕД (LIGHT SPLIT VIEW)
   ========================================= */
.profile-layout { 
    display: flex; 
    width: 100%;
    min-height: 500px; 
}

/* Лява част - Елегантно светло меню */
.profile-sidebar {
    width: 300px; 
    background: #fcfcfc; /* Много нежно, почти бяло сиво */
    border-right: 1px solid #f0f0f0; /* Лека разделителна линия */
    padding: 40px 25px; 
    display: flex; flex-direction: column;
}

.sidebar-header { text-align: center; margin-bottom: 35px; }

.avatar-circle {
    width: 75px; height: 75px; 
    background: rgba(0, 139, 139, 0.08); /* Мек тюркоазен фон */
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center; 
    margin: 0 auto 15px;
    font-size: 2.4rem; color: var(--color-primary); 
}

.sidebar-header h4 { font-family: var(--font-heading); font-size: 1.4rem; color: #333; margin-bottom: 5px;}

/* Баджът "Клиент" - в цвят праскова/оранжево */
.role-badge { 
    font-size: 0.75rem; 
    background: #fff5eb; 
    color: var(--color-accent); 
    padding: 4px 12px; 
    border-radius: 12px; 
    font-weight: bold; 
    letter-spacing: 1px; 
    border: 1px solid rgba(210, 105, 30, 0.2);
}

.profile-menu { list-style: none; padding: 0; margin: 0; flex: 1; }
.profile-menu li { margin-bottom: 8px; }

/* Табовете в менюто */
.profile-tab {
    width: 100%; text-align: left; padding: 14px 18px; border: none; background: transparent;
    border-radius: 12px; cursor: pointer; color: #555; font-size: 0.95rem; font-weight: 600;
    font-family: var(--font-body); transition: all 0.3s ease; display: flex; align-items: center; gap: 12px;
}
.profile-tab i { font-size: 1.1rem; width: 22px; text-align: center; color: #aaa; transition: 0.3s; }

/* Ховър на табовете */
.profile-tab:hover { background: #f0fdfd; color: var(--color-primary); }
.profile-tab:hover i { color: var(--color-primary); }

/* Активен таб - Тюркоаз */
.profile-tab.active { background: var(--color-primary); color: #fff; box-shadow: 0 5px 15px rgba(0, 139, 139, 0.2); }
.profile-tab.active i { color: #fff; }

.sidebar-footer { margin-top: auto; padding-top: 20px; border-top: 1px solid #f0f0f0; }

/* Бутонът за изтриване - Червен контур */
.btn-danger-outline {
    width: 100%; padding: 14px; background: transparent; color: #e74c3c; border: 2px dashed rgba(231, 77, 60, 0.384);
    border-radius: 12px; font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: 0.3s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-danger-outline:hover { background: #e74c3c; color: #fff; border-color: #e74c3c; box-shadow: 0 5px 15px rgba(231, 76, 60, 0.2);}

/* Дясна част - Съдържание */
.profile-content { flex: 1; padding: 50px; background: #fff; text-align: left; position: relative;}

.prof-form { display: none; animation: fadeIn 0.4s ease; }
.prof-form.active { display: block; }
.prof-form h3 { font-family: var(--font-heading); font-size: 2rem; color: var(--color-primary); margin-bottom: 8px; }
.prof-form p { color: #777; font-size: 0.95rem; margin-bottom: 30px; line-height: 1.5;}

/* =========================================
   АДАПТИВНОСТ (ТАБЛЕТИ И ТЕЛЕФОНИ)
   ========================================= */

/* --- 1. ЗА ТАБЛЕТИ (между 577px и 900px) --- */
@media (max-width: 900px) {
    /* Падащото меню да стърчи наляво (навътре в екрана), а не навън */
    .profile-dropdown {
        left: auto;
        right: 0px;
    }
    
    /* Запазваме дизайна на модала като на компютър (две колони), 
       просто леко го свиваме, за да се събере на таблет */
    .auth-modal-overlay, .delete-modal-overlay { padding: 20px; }
    .profile-sidebar { width: 240px; padding: 30px 15px; } /* Малко по-тясна лява част */
    .profile-content { padding: 30px; }
}

/* --- 2. ЗА ТЕЛЕФОНИ (под 576px) --- */
@media (max-width: 576px) {
    /* Тук вече няма място и правим модала едно под друго */
    .auth-modal-overlay, .delete-modal-overlay { padding: 15px; }
    .auth-modal-box { padding: 30px 20px; }
    .profile-modal-box { padding: 0; }
    
    .profile-layout { flex-direction: column; min-height: auto; }
    .profile-sidebar { width: 100%; padding: 25px 20px; border-right: none; border-bottom: 1px solid #eee; }
    
    .sidebar-header { margin-bottom: 20px; }
    
    /* Менюто става хоризонтално на телефон, за да се скролва с пръст наляво-надясно */
    .profile-menu { display: flex; overflow-x: auto; padding-bottom: 10px; gap: 8px; margin-top: 5px; }
    .profile-menu li { margin: 0; flex-shrink: 0; }
    .profile-tab { padding: 10px 16px; font-size: 0.9rem; white-space: nowrap; }
    
    .sidebar-footer { margin-top: 15px; padding-top: 15px; }
    .profile-content { padding: 35px 20px; }
}