:root {
    /* Default Dark Theme */
    --bg-dark: #0f1115;
    --bg-card: #1a1d24;
    --primary: #d4a017;
    --primary-hover: #f0b51d;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --border-color: #2c303a;
    --success: #10b981;
    --danger: #ef4444;
    --header-bg: rgba(15, 17, 21, 0.95);
}

[data-theme="light"] {
    --bg-dark: #f0f2f5;
    --bg-card: #ffffff;
    --primary: #d4a017;
    /* Keep Gold */
    --primary-hover: #b88a14;
    --text-main: #1a1d24;
    --text-muted: #666666;
    --border-color: #e0e0e0;
    --success: #059669;
    --danger: #dc2626;
    --header-bg: rgba(255, 255, 255, 0.95);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    /* Prevent horizontal scroll from off-canvas menu */
    position: relative;
    width: 100%;
}

html {
    overflow-x: hidden;
}

main {
    flex: 1 0 auto;
    padding-bottom: 100px;
    /* Increased visual spacing */
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

.container {
    max-width: 95%;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    background-color: var(--primary);
    color: #000;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

/* --- SEARCH RESULTS --- */
.search-results-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-top: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    overflow: hidden;
}

.mobile-results-container {
    display: none;
    width: 100%;
    margin-top: 10px;
    background: transparent;
}

.search-result-item {
    border-bottom: 1px solid var(--border-color);
}

.search-result-item:last-child {
    border-bottom: none;
}

.result-link {
    display: flex;
    /* Flexbox for alignment */
    align-items: center;
    /* Vertical center */
    padding: 12px 15px;
    text-decoration: none;
    transition: 0.2s;
    gap: 15px;
    /* Spacing between image and text */
    width: 100%;
    /* Ensure full width */
}

.result-link:hover {
    background: var(--bg-dark);
}

.result-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    /* Prevent image shrinking */
}

.result-info {
    flex: 1;
    /* Take remaining space */
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center text vertically if needed */
    min-width: 0;
    /* Enable truncation for flex children */
}

.result-title {
    font-weight: 600;
    color: var(--text-main);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-type {
    font-size: 11px;
    color: var(--primary);
    text-transform: uppercase;
    margin-top: 2px;
}

.no-results {
    padding: 15px;
    color: var(--text-muted);
    text-align: center;
    font-size: 13px;
}


.btn-block {
    display: block;
    width: 100%;
}

/* Green Action Button */
.btn-green {
    background: #10b981;
    color: #fff;
    transition: 0.2s;
}

.btn-green:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Header */
header {
    background-color: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

header nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

header nav a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

header nav a:hover {
    color: var(--text-main);
}

/* Utils */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 10px;
}

.mt-2 {
    margin-top: 20px;
}

.mt-4 {
    margin-top: 40px;
}

.section-title {
    font-size: 32px;
    font-weight: 800;
}

/* --- RESPONSIVE HEADER STYLES --- */

/* --- RESPONSIVE HEADER STYLES --- */

.header-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    /* Left, Center, Right */
    align-items: center;
    padding: 10px 20px;
    height: 70px;
    gap: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-center {
    display: flex;
    justify-content: center;
    width: 100%;
}

.header-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
}

.logo {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    /* Pill Shape */
    padding: 10px 25px;
    width: 600px;
    /* Wide search as per reference */
    max-width: 100%;
    transition: 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.search-bar:focus-within {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-main);
    width: 100%;
    outline: none;
    padding: 8px 0;
    font-size: 14px;
}

.search-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Dropdowns */
.city-selector,
.user-menu {
    position: relative;
}

.selector-btn,
.user-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: 8px;
    opacity: 0;
    transform: translateY(10px);
    transition: 0.2s;
}

.dropdown-menu.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 10px 15px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 14px;
}

.dropdown-menu a:hover {
    background: var(--bg-dark);
    color: var(--text-main);
}

.dropdown-menu .title {
    display: block;
    color: var(--text-main);
    font-weight: 600;
}

.dropdown-menu .subtitle {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 5px 0;
}

.text-danger {
    color: var(--danger);
}

.text-muted {
    color: var(--text-muted);
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
}

#mobile-menu-drawer {
    display: none;
    /* Hide globally on desktop */
}

.mobile-header-actions,
.mobile-search-bar {
    display: none;
    /* Globally hidden, shown only in mobile media query */
}

.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.theme-toggle:hover {
    background: var(--bg-card);
    color: var(--primary);
    border-color: var(--primary);
}

/* MOBILE RESPONSIVE */
@media (max-width: 900px) {
    .header-container {
        display: flex;
        /* Single row */
        justify-content: space-between;
        align-items: center;
        padding: 5px 15px;
        height: 60px;
        /* Compact mobile height */
    }

    .header-left {
        flex: 1;
        /* Logo takes left space */
    }

    /* Hide desktop elements */
    #desktop-search,
    .header-center {
        display: none !important;
    }

    /* Ensure Mobile Actions are visible and aligned */
    .mobile-header-actions {
        display: flex !important;
        align-items: center;
        gap: 15px;
    }

    .icon-btn {
        background: transparent;
        border: none;
        color: var(--text-main);
        padding: 8px;
        /* Touch target size */
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-menu-btn {
        display: block !important;
        background: transparent;
        border: none;
        color: var(--text-main);
        padding: 5px;
    }

    .mobile-close-btn {
        display: block !important;
        /* Visible on mobile */
        align-self: flex-end;
        background: transparent;
        border: none;
        color: var(--text-main);
        font-size: 24px;
        margin-bottom: 20px;
        cursor: pointer;
    }

    /* Mobile Search "Popup" Overlay */
    .mobile-search-bar {
        display: none;
        position: fixed;
        /* Fixed to cover screen */
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        /* Full screen */
        background: rgba(0, 0, 0, 0.9);
        /* Dark overlay */
        padding: 20px;
        z-index: 2000;
        /* Highest z-index */
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 80px;
        /* Space from top */
        gap: 15px;
        backdrop-filter: blur(5px);
    }

    .mobile-search-close {
        position: absolute;
        top: 20px;
        right: 20px;
        background: transparent;
        border: none;
        color: #fff;
        font-size: 24px;
        cursor: pointer;
    }

    .mobile-search-bar.active {
        display: flex !important;
        /* Override global hide */
        animation: fadeIn 0.2s ease-out;
    }

    .mobile-search-bar input {
        width: 100%;
        background: var(--bg-card);
        border: 1px solid var(--primary);
        padding: 15px 20px;
        border-radius: 50px;
        /* Pill shape on mobile too */
        color: var(--text-main);
        outline: none;
        font-size: 18px;
        /* Larger font */
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    }

    /* --- MOBILE DRAWER (SonBilet Style) --- */
    #mobile-menu-drawer {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        /* Full Width */
        height: 100vh;
        background: var(--bg-card);
        z-index: 3000;
        display: flex !important;
        /* Force show on mobile */
        flex-direction: column;

        /* Animation Logic */
        transform: translateX(100%);
        /* Start completely off-screen */
        visibility: hidden;
        /* Prevent clicks when closed */
        transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.3s;

        padding: 0;
        overflow-y: auto;
    }

    #mobile-menu-drawer.active {
        transform: translateX(0);
        /* Slide in */
        visibility: visible;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }

    /* Hide Desktop Nav on Mobile */
    .header-right {
        display: none !important;
    }

    /* Drawer Header */
    .drawer-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px;
        border-bottom: 1px solid var(--border-color);
        background: var(--bg-card);
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .drawer-header .logo {
        font-size: 22px;
    }

    .drawer-close-btn {
        background: var(--bg-dark);
        border: none;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        color: var(--text-main);
        font-size: 18px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Drawer Body */
    .drawer-body {
        padding: 20px;
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 30px;
    }

    /* Auth Buttons */
    .drawer-auth-buttons {
        display: flex;
        gap: 10px;
    }

    .drawer-auth-buttons .btn {
        flex: 1;
        padding: 12px;
        font-size: 14px;
        text-align: center;
    }

    .btn-outline {
        border: 1px solid var(--border-color);
        background: transparent;
        color: var(--text-main);
    }

    /* Sections */
    .drawer-section h4 {
        color: var(--text-muted);
        font-size: 12px;
        text-transform: uppercase;
        margin-bottom: 15px;
        letter-spacing: 0.5px;
    }

    .drawer-section a {
        display: block;
        padding: 8px 0;
        font-size: 16px;
        font-weight: 600;
        color: var(--text-main);
    }

    /* Drawer Footer (Socials) */
    .drawer-footer {
        padding: 20px;
        border-top: 1px solid var(--border-color);
        background: var(--bg-card);
    }

    .social-icons {
        display: flex;
        justify-content: center;
        gap: 20px;
    }

    .social-btn {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: 0.2s;
    }

    .social-btn.instagram {
        background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
        color: #fff;
    }

    .social-btn.twitter {
        background: #1da1f2;
        color: #fff;
    }

    .social-btn.facebook {
        background: #1877f2;
        color: #fff;
    }

    /* User Info */
    .drawer-user-info {
        background: var(--bg-dark);
        padding: 15px;
        border-radius: 8px;
        text-align: center;
    }

    .header-nav {
        flex-direction: column;
        width: 100%;
        gap: 20px;
        margin-top: 20px;
    }

    .city-selector {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 15px;
        margin-right: 0 !important;
    }

    .selector-btn {
        width: 100%;
        justify-content: space-between;
        padding: 0;
    }
}

/* GLOBAL RESPONSIVE UTILITIES */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
        /* Reduced from 15px */
        width: 100%;
        max-width: 100%;
    }

    h1,
    .h1 {
        font-size: 28px !important;
    }

    h2,
    .h2 {
        font-size: 24px !important;
    }

    h3,
    .h3 {
        font-size: 20px !important;
    }

    .hero p {
        font-size: 14px !important;
    }

    /* Auto-collapse grids */
    .grid-responsive {
        grid-template-columns: 1fr !important;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --- TOAST NOTIFICATIONS --- */
#toast-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.custom-toast {
    background: rgba(15, 17, 21, 0.95);
    /* Extremely dark glass */
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 12px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    min-width: 300px;
    max-width: 90vw;
    opacity: 0;
    transform: translateY(20px);
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
}

.custom-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-icon {
    font-size: 18px;
}

.toast-message {
    font-size: 14px;
    font-weight: 500;
}

.toast-love {
    border-color: #ef4444;
}

.toast-success {
    border-color: var(--success);
}

.toast-error {
    border-color: var(--danger);
}

.toast-clap {
    border-color: var(--primary);
}

@media (max-width: 600px) {
    #toast-container {
        bottom: 20px;
        width: 100%;
        padding: 0 20px;
    }

    .custom-toast {
        width: 100%;
        justify-content: center;
    }
}