/* ========================
   Modern Header Styles
   ======================== */

/* Desktop Header */
.modern-header {
    background: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #f0f0f0;
}

:root {
    --header-icon-btn-size: 50px;
    --header-avatar-size: 32px;
    --header-icon-size: 1.75rem;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 2rem;
    direction: ltr;
}

/* Header Logo */
.header-logo {
    margin-right: auto;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.header-logo:hover {
    opacity: 0.8;
}

.header-logo .logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

/* Download Button */
.modern-download-btn {
    background: #ffdf00;
    border: 2px solid #ffdf00;
    color: #000000;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modern-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    background: #f5d700;
}

.download-icon {
    font-size: 1.1rem;
}

/* Notifications */
.notifications-wrapper {
    position: relative;
}

.notification-btn {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    padding: 0.75rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    width: var(--header-icon-btn-size);
    height: var(--header-icon-btn-size);
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-btn:hover {
    background: #ebebeb;
    transform: scale(1.05);
}

.notification-icon {
    font-size: var(--header-icon-size);
    color: #666;
    transition: color 0.3s ease;
}

.notification-icon.has-notifications {
    color: #ff4757;
    animation: pulse 2s infinite;
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 12px;
    height: 12px;
    background: #ff4757;
    border-radius: 50%;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Modern Dropdown */
.modern-dropdown {
    background: white;
    border: none;
    border-radius: 16px;
    padding: 0.5rem 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    margin-top: 0.5rem;
}

.modern-notification-item {
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0.25rem 0.5rem;
}

.modern-notification-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modern-notification-item.unread {
    background: rgba(102, 126, 234, 0.1);
    font-weight: 600;
}

.notification-text {
    flex: 1;
}

.new-badge {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.view-all-notifications a {
    color: #667eea;
    font-weight: 600;
    text-align: center;
    display: block;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.view-all-notifications a:hover {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
}

.empty-notification {
    text-align: center;
    color: #999;
    padding: 2rem 1rem;
    display: block;
}

/* Login Button */
.modern-login-btn {
    background: #ffdf00;
    color: #000000;
    border: 2px solid #ffdf00;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modern-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
    background: #f5d700;
}

/* User Dropdown */
.modern-user-dropdown {
    position: relative;
}

.user-profile-btn {
    background: transparent;
    border: 2px solid #e0e0e0;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    width: var(--header-icon-btn-size);
    height: var(--header-icon-btn-size);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.user-profile-btn:hover {
    transform: scale(1.05);
    border-color: #667eea;
}

.user-avatar,
.default-avatar {
    width: var(--header-avatar-size);
    height: var(--header-avatar-size);
    border-radius: 50%;
    object-fit: cover;
}

.default-avatar {
    color: #667eea;
    font-size: var(--header-icon-size);
}

.modern-user-menu {
    background: white;
    border: none;
    border-radius: 16px;
    padding: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    margin-top: 0.5rem;
}

.modern-user-menu .dropdown-item {
    padding: 0.875rem 1.25rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
}

.modern-user-menu .dropdown-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modern-user-menu .menu-icon {
    font-size: 1.25rem;
}

.logout-item:hover {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%) !important;
}

/* ========================
   Mobile Header Styles
   ======================== */

.modern-mobile-header {
    display: none;
    background: white;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    direction: ltr;
}

.mobile-menu-btn {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    padding: 0.625rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn .menu-icon {
    color: #666;
    font-size: 1.5rem;
}

.modern-mobile-download-btn {
    background: #ffdf00;
    border: 2px solid #ffdf00;
    color: #000000;
    padding: 0.625rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modern-mobile-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 223, 0, 0.3);
    background: #f5d400;
    border-color: #f5d400;
    color: #0b0b0b;
}

.modern-mobile-login-btn {
    background: #ffdf00;
    color: #000000;
    border: 2px solid #ffdf00;
    padding: 0.625rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modern-mobile-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 223, 0, 0.3);
    background: #f5d400;
    border-color: #f5d400;
    color: #0b0b0b;
}

.mobile-user-btn {
    background: transparent;
    border: 2px solid #e0e0e0;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
}

.mobile-user-avatar,
.mobile-default-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.mobile-default-avatar {
    color: #667eea;
    font-size: 32px;
}

/* Off Canvas */
.modern-offcanvas {
    background: #ffffff;
}

.modern-offcanvas-header {
    border-bottom: 2px solid #f1f5f9;
    padding: 1.5rem;
    background: #ffffff;
}

.offcanvas-logo {
    max-width: 75px;
    height: auto;
    border-radius: 10px;
}

.modern-close-btn {
    background: #f1f5f9;
    border-radius: 50%;
    opacity: 1;
    padding: 0.5rem;
    filter: none;
}

.modern-offcanvas-body {
    padding: 2rem 1rem;
    direction: rtl;
    background: #ffffff;
}

.modern-mobile-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modern-mobile-menu li {
    margin-bottom: 0.5rem;
}

.modern-mobile-menu a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    color: #0b0b0b;
    text-decoration: none;
    border-radius: 16px;
    transition: all 0.3s ease;
    font-weight: 600;
    background: transparent;
    flex-direction: row;
    justify-content: flex-start;
}

.modern-mobile-menu a:hover {
    background: rgba(255, 223, 0, 0.1);
    transform: translateX(5px);
}

.modern-mobile-menu .menu-icon {
    font-size: 1.5rem;
    color: #0b0b0b;
}

.modern-mobile-menu a,
.modern-mobile-menu a span,
.modern-mobile-menu a .menu-icon {
    color: #0b0b0b;
}

/* ========================
   Modal Styles
   ======================== */

.modern-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999 !important;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
    direction: rtl;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modern-modal {
    background: #ffdf00;
    border-radius: 24px;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    overflow: hidden;
    position: relative;
    z-index: 100000 !important;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modern-modal-header {
    background: #f5d300;
    padding: 1.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modern-modal-header h3 {
    color: #0b0b0b;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.close-modal-btn {
    background: rgba(11, 11, 11, 0.1);
    backdrop-filter: blur(10px);
    border: none;
    color: #0b0b0b;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.25rem;
}

.close-modal-btn:hover {
    background: rgba(11, 11, 11, 0.2);
    transform: rotate(90deg);
}

.modern-modal-body {
    padding: 2rem;
}

.auth-method-btn {
    width: 100%;
    background: #fff9cc;
    border: 2px solid #d4c000;
    padding: 1rem 1.5rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #0b0b0b;
}

.auth-method-btn:hover {
    border-color: #d4c000;
    background: #f5d300;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 192, 0, 0.3);
}

.method-icon {
    font-size: 1.5rem;
    color: #0b0b0b;
}

.google-icon {
    color: #EA4335;
}

.terms-text {
    color: #0b0b0b;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-top: 1.5rem;
    margin-bottom: 0;
    text-align: center;
}

.modern-modal-footer {
    background: #f5d300;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.modern-modal-footer span {
    color: #0b0b0b;
}

.switch-auth-btn {
    background: none;
    border: none;
    color: #0b0b0b;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.switch-auth-btn:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Form Styles */
.modern-auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.modern-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modern-form-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.modern-input,
.modern-phone-input {
    padding: 0.875rem 1.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.modern-input:focus,
.modern-phone-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.modern-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.otp-input-group {
    display: flex;
    gap: 0.75rem;
}

.otp-input-group input {
    flex: 1;
}

.modern-send-otp-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.modern-send-otp-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.modern-send-otp-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.modern-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.modern-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.modern-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ========================
   Responsive Design
   ======================== */

@media (max-width: 768px) {

    .modern-mobile-login-btn {
        padding: 0.55rem 1.25rem;
        font-size: 0.85rem;
    }
    .modern-header {
        display: none;
    }

    .modern-mobile-header {
        display: flex;
    }

    .modern-modal {
        max-width: 95%;
        margin: 1rem;
    }

    .modern-modal-header {
        padding: 1.25rem 1.5rem;
    }

    .modern-modal-header h3 {
        font-size: 1.25rem;
    }

    .modern-modal-body {
        padding: 1.5rem;
    }

    .otp-input-group {
        flex-direction: column;
    }

    .modern-send-otp-btn {
        width: 100%;
    }
}

/* Extra-small devices (real mobiles ~300-360px) */
@media (max-width: 360px) {
    :root {
        --header-icon-btn-size: 44px;
        --header-avatar-size: 30px;
        --header-icon-size: 1.5rem;
    }

    .modern-mobile-header {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .modern-mobile-download-btn {
        padding: 0.55rem 0.85rem;
        font-size: 0.8rem;
    }

    .modern-mobile-login-btn {
        padding: 0.55rem 1.1rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 320px) {
    .modern-mobile-download-btn span {
        display: none;
    }
}

@media (min-width: 769px) {
    .modern-mobile-header {
        display: none !important;
    }
}
