/* ===== Layout CSS - Travel SIM ===== */
/* Custom styles that complement TailwindCSS */

/* ===== DARK THEME OVERRIDES ===== */
[data-theme="dark"] body,
[data-theme="dark"] [data-body] {
    background-color: #0f0c29 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .header-main {
    background-color: #1a1744 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .header-main a:not(.bg-gradient-to-r),
[data-theme="dark"] .header-main button {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .header-main a[class*="text-brand-magenta"] {
    color: #E91E8C !important;
}

[data-theme="dark"] .header-main a:hover:not(.bg-gradient-to-r):not([class*="text-brand-magenta"]) {
    color: #E91E8C !important;
}

[data-theme="dark"] .header-main button:hover,
[data-theme="dark"] .header-main a:not(.bg-gradient-to-r):hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] #mobileMenu {
    background-color: #1a1744 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] #mobileMenu a {
    color: rgba(255, 255, 255, 0.7) !important;
}

[data-theme="dark"] #mobileMenu a[class*="text-brand-magenta"] {
    color: #E91E8C !important;
}

[data-theme="dark"] .user-menu__dropdown {
    background-color: #1a1744 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .user-menu__dropdown a {
    color: rgba(255, 255, 255, 0.7) !important;
}

[data-theme="dark"] .user-menu__dropdown a:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* ===== GRADIENT TEXT UTILITY ===== */
.text-gradient {
    background: linear-gradient(135deg, #E91E8C, #2196F3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== BRAND GRADIENT BG ===== */
.bg-brand-gradient {
    background: linear-gradient(135deg, #E91E8C, #2196F3);
}

/* ===== SMOOTH SCROLL ===== */
html {
    scroll-behavior: smooth;
}

/* ===== SCROLL ANIMATION ===== */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== USER MENU ===== */
.user-menu.active .user-menu__dropdown {
    display: block !important;
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #1a1744;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header-main .container {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ===== BRAND GRADIENT TEXT ===== */
.brand-gradient-text {
    background: linear-gradient(135deg, #E91E8C, #2196F3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== TOAST NOTIFICATIONS ===== */
#toast-container {
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border-left: 4px solid;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.toast-item.toast-show {
    transform: translateX(0);
    opacity: 1;
}

.toast-item.toast-hide {
    transform: translateX(120%);
    opacity: 0;
}

.toast-success { border-color: #10b981; }
.toast-error { border-color: #ef4444; }
.toast-warning { border-color: #f59e0b; }
.toast-info { border-color: #3b82f6; }

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast-success .toast-icon { color: #10b981; }
.toast-error .toast-icon { color: #ef4444; }
.toast-warning .toast-icon { color: #f59e0b; }
.toast-info .toast-icon { color: #3b82f6; }

.toast-message {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    flex-shrink: 0;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #4b5563;
}

/* Dark mode toast */
[data-theme="dark"] .toast-item {
    background: #1a1744;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .toast-message {
    color: #e5e7eb;
}

[data-theme="dark"] .toast-close {
    color: #6b7280;
}

/* ============================================================
   MOBILE DRAWER
   ============================================================ */
.mobile-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.mobile-drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    max-width: 85vw;
    background: #ffffff;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 4px 0 32px rgba(0, 0, 0, 0.18);
}
.mobile-drawer.open {
    transform: translateX(0);
}

body.drawer-open {
    overflow: hidden;
}

/* Drawer Header */
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
}
.drawer-close-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.drawer-close-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Drawer User Section */
.drawer-user-section {
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(233,30,140,0.06), rgba(33,150,243,0.06));
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
}

/* Drawer Nav */
.drawer-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
    overscroll-behavior: contain;
}
.drawer-nav-item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 18px;
    font-size: 14.5px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.drawer-nav-item:hover,
.drawer-nav-item.active {
    background: rgba(233, 30, 140, 0.07);
    color: #E91E8C;
}
.drawer-nav-item i {
    width: 20px;
    text-align: center;
    font-size: 15px;
    color: #9ca3af;
    flex-shrink: 0;
    transition: color 0.15s;
}
.drawer-nav-item:hover i,
.drawer-nav-item.active i {
    color: #E91E8C;
}
.drawer-nav-divider {
    height: 1px;
    background: #f3f4f6;
    margin: 6px 18px;
}
.drawer-section-label {
    padding: 10px 18px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
}

/* Drawer Footer */
.drawer-footer {
    padding: 14px 18px;
    border-top: 1px solid #f3f4f6;
    flex-shrink: 0;
}
.drawer-btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, #E91E8C, #2196F3);
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.2s;
}
.drawer-btn-login:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}
.drawer-btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    background: #fff1f2;
    color: #ef4444;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}
.drawer-btn-logout:hover {
    background: #ffe4e6;
}

/* ============================================================
   BOTTOM NAVIGATION BAR
   ============================================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    background: #ffffff;
    border-top: 1px solid #f3f4f6;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: stretch;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px 6px;
    min-height: 56px;
    text-decoration: none;
    color: #9ca3af;
    font-size: 10px;
    font-weight: 500;
    gap: 4px;
    transition: color 0.2s;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.bottom-nav-item i {
    font-size: 19px;
    line-height: 1;
    transition: transform 0.2s;
}
.bottom-nav-item span.label {
    font-size: 10px;
    letter-spacing: -0.01em;
}
.bottom-nav-item.active {
    color: #E91E8C;
}
.bottom-nav-item.active i {
    transform: translateY(-1px);
}
.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15%;
    right: 15%;
    height: 2px;
    background: linear-gradient(90deg, #E91E8C, #2196F3);
    border-radius: 0 0 3px 3px;
}
/* Cart badge on bottom nav */
.bnav-cart-badge {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(4px);
    min-width: 16px;
    height: 16px;
    background: #ef4444;
    color: white;
    font-size: 9px;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* Push main content up so bottom nav doesn't cover it */
@media (max-width: 767px) {
    main.has-bottom-nav {
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    }
    /* Move chat support button above bottom nav */
    #chatSupportBtn {
        bottom: calc(70px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* ============================================================
   DARK THEME — DRAWER
   ============================================================ */
[data-theme="dark"] .mobile-drawer {
    background: #1a1744;
}
[data-theme="dark"] .drawer-header {
    border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .drawer-close-btn {
    color: rgba(255,255,255,0.5);
}
[data-theme="dark"] .drawer-close-btn:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
[data-theme="dark"] .drawer-user-section {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .drawer-nav-item {
    color: rgba(255,255,255,0.75);
}
[data-theme="dark"] .drawer-nav-item i {
    color: rgba(255,255,255,0.35);
}
[data-theme="dark"] .drawer-nav-item:hover,
[data-theme="dark"] .drawer-nav-item.active {
    background: rgba(233,30,140,0.12);
    color: #E91E8C;
}
[data-theme="dark"] .drawer-nav-item:hover i,
[data-theme="dark"] .drawer-nav-item.active i {
    color: #E91E8C;
}
[data-theme="dark"] .drawer-nav-divider {
    background: rgba(255,255,255,0.08);
}
[data-theme="dark"] .drawer-section-label {
    color: rgba(255,255,255,0.3);
}
[data-theme="dark"] .drawer-footer {
    border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .drawer-btn-logout {
    background: rgba(239,68,68,0.12);
    color: #f87171;
}
[data-theme="dark"] .drawer-btn-logout:hover {
    background: rgba(239,68,68,0.2);
}

/* ============================================================
   DARK THEME — BOTTOM NAV
   ============================================================ */
[data-theme="dark"] .bottom-nav {
    background: #1a1744;
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
}
[data-theme="dark"] .bottom-nav-item {
    color: rgba(255,255,255,0.35);
}
[data-theme="dark"] .bottom-nav-item.active {
    color: #E91E8C;
}