/**
 * ==============================================================================
 * FeelingsWheels - Main Layout Engine & Fully Responsive Grid
 * ==============================================================================
 * File: assets/css/layout.css
 */

/* -------------------------------------------------------------------------- */
/* GLOBAL RESET & BASE CONSTRAINTS                                            */
/* -------------------------------------------------------------------------- */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    position: relative;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

/* Global utility for hiding elements */
.is-hidden {
    display: none !important;
}

/* -------------------------------------------------------------------------- */
/* 1. STICKY TOP NAVIGATION HEADER                                            */
/* -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background-color: rgba(11, 15, 20, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-subtle);
    transition: background-color var(--transition-smooth, 0.25s ease);
}

[data-theme="light"] .site-header {
    background-color: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid #E2E8F0;
}

.header-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.header-brand .brand-logo {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    user-select: none;
}

.logo-accent {
    color: var(--accent-pink);
}

.logo-sparkle {
    font-size: 1.1rem;
}

/* Desktop Navigation */
.header-nav .nav-list {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color var(--transition-fast, 0.15s ease);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.btn-spin-no-ads {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    background: rgba(255, 46, 147, 0.1);
    border: 1px solid rgba(255, 46, 147, 0.35);
    color: var(--accent-pink);
    text-decoration: none;
    font-size: 0.825rem;
    font-weight: 700;
    transition: all var(--transition-fast, 0.15s ease);
}

.btn-spin-no-ads:hover {
    background: var(--accent-pink);
    color: #FFFFFF;
    box-shadow: 0 0 16px rgba(255, 46, 147, 0.4);
}

/* Dropdown Menu (Popular Wheels) - Smooth Hover Fix */
.dropdown-parent {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px); /* Gap ko chhota kiya */
    left: 0;
    width: 270px;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    z-index: 1010;
    animation: fadeInDropdown 0.2s ease forwards;
}

/* --- YAHAN INVISIBLE HOVER BRIDGE LAGAYA HAI --- */
/* Ye adrishya pul mouse ko kabhi disconnect nahi hone dega! */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    width: 100%;
    height: 12px;
    background: transparent;
}

.dropdown-parent:hover .dropdown-menu,
.dropdown-menu:hover {
    display: flex;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: background var(--transition-fast, 0.15s ease);
}

.dropdown-item:hover {
    background: var(--bg-elevated);
}

.item-icon { font-size: 1.25rem; }
.item-title { display: block; font-size: 0.875rem; font-weight: 600; }
.item-desc { display: block; font-size: 0.75rem; color: var(--text-muted); }
.dropdown-divider { height: 1px; background: var(--border-subtle); margin: 0.4rem 0; }
.dropdown-view-all { text-align: center; font-size: 0.8rem; font-weight: 600; color: var(--accent-cyan); padding: 0.4rem; text-decoration: none; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-trigger-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 0.4rem 0.85rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
}

.kbd-shortcut {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 0.1rem 0.35rem;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.util-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
}

.btn-signup-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-mint);
    color: #0B0F14;
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 700;
    padding: 0.45rem 1.15rem;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    text-decoration: none;
}

/* -------------------------------------------------------------------------- */
/* HAMBURGER TRIGGER BUTTON                                                   */
/* -------------------------------------------------------------------------- */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    padding: 0;
    z-index: 1005;
}

.mobile-menu-btn .hamburger-bar {
    display: block;
    width: 18px;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

/* -------------------------------------------------------------------------- */
/* DEDICATED MOBILE DRAWER OVERLAY & PANEL (Matching header.php IDs & Classes)*/
/* -------------------------------------------------------------------------- */
.mobile-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2000;
    display: flex;
    justify-content: flex-end;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-drawer-overlay.is-hidden {
    display: none !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.mobile-drawer-panel {
    width: min(320px, 85vw);
    height: 100%;
    height: 100dvh;
    background: var(--bg-card, #141A21);
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.6);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    animation: drawerSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes drawerSlideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Drawer Header */
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
}

.drawer-brand-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
}

.drawer-close-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
}

/* Drawer Search Box */
.drawer-search-box {
    width: 100%;
}

.drawer-search-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    box-sizing: border-box;
}

/* Drawer Links */
.drawer-nav {
    flex: 1;
    overflow-y: auto;
}

.drawer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.drawer-link {
    display: block;
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.15s ease;
}

.drawer-link:hover,
.drawer-link.active {
    background: var(--bg-card-subtle);
    color: var(--accent-mint);
}

/* Drawer Footer */
.drawer-footer {
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-subtle);
}

.drawer-pro-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 46, 147, 0.12);
    border: 1px solid rgba(255, 46, 147, 0.35);
    border-radius: var(--radius-full);
    color: var(--accent-pink);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 700;
    text-align: center;
    box-sizing: border-box;
}

/* -------------------------------------------------------------------------- */
/* 2. THE 3-COLUMN MAIN LAYOUT GRID (Adaptive Breakpoints)                    */
/* -------------------------------------------------------------------------- */
.main-container {
    width: 100%;
    max-width: 1600px;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
    flex: 1;
}

.layout-grid {
    display: grid;
    grid-template-columns: minmax(400px, 1.25fr) minmax(360px, 1fr) 336px; 
    gap: 1.5rem;
    align-items: start;
}

.col-stage {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    width: 100%;
}

.col-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.col-ads {
    position: sticky;
    top: 5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
}

/* -------------------------------------------------------------------------- */
/* 3. BELOW THE FOLD SEO & FOOTER LAYOUT                                      */
/* -------------------------------------------------------------------------- */
.seo-section {
    width: 100%;
    border-top: 1px solid var(--border-subtle);
    background: rgba(14, 19, 25, 0.4);
    margin-top: 3rem;
    padding: 4rem 1.5rem;
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
}

.site-footer {
    width: 100%;
    background: linear-gradient(180deg, #260210 0%, #110107 100%);
    border-top: 1px solid var(--border-subtle);
    padding: 3.5rem 1.5rem 2rem;
    margin-top: auto;

}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-top-brand {

    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
}

.footer-tagline {
    color: var(--text-secondary);
    font-size: 0.875rem;
    max-width: 500px;
    margin-top: 0.35rem;
}

.footer-trust-badges {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.trust-badge {
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 0.35rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.footer-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 2rem 0;
}

.footer-nav-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.col-heading {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-links-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0;
    margin: 0;
}

.footer-links-list a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
}

.footer-adsense-note {
    margin-top: 1rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.footer-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.825rem;
}

/* -------------------------------------------------------------------------- */
/* 4. TABLETS & SCREENS BREAKPOINT (<= 1200px)                                */
/* -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
    .layout-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.25rem;
    }

    .col-ads {
        grid-column: span 2;
        position: static;
        flex-direction: row;
        justify-content: center;
    }
}

/* -------------------------------------------------------------------------- */
/* 5. MOBILE & TABLET BREAKPOINT (<= 992px)                                   */
/* -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    /* Hide desktop-only elements */
    .hide-on-mobile,
    #desktop-nav {
        display: none !important;
    }

    /* Show hamburger button */
    .mobile-menu-btn {
        display: flex !important;
    }

    .header-container {
        padding: 0.65rem 1rem;
    }

    .footer-nav-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* -------------------------------------------------------------------------- */
/* 6. SMALL MOBILES BREAKPOINT (<= 768px)                                     */
/* -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .main-container {
        padding: 0 0.75rem;
        margin: 0.75rem auto;
    }

    .layout-grid {
        grid-template-columns: 100%;
        gap: 1.25rem;
    }

    .col-ads {
        grid-column: span 1;
        flex-direction: column;
        align-items: center;
        margin-top: 1rem;
    }

    .seo-section {
        padding: 2.5rem 1rem;
        margin-top: 2rem;
    }

    .footer-nav-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}


/* -------------------------------------------------------------------------- */
/* Custom Wheel Links Grid (2-Column Box Layout)                              */
/* -------------------------------------------------------------------------- */
.custom-links-box {
    margin-top: 2.5rem;
}

.custom-links-box .subsection-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.custom-wheels-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1rem !important;
}

.wheel-link-card {
    background: var(--bg-card-subtle) !important;
    border: 1px solid var(--border-subtle) !important;
    padding: 1rem 1.25rem !important;
    border-radius: var(--radius-lg) !important;
    text-decoration: none !important;
    color: var(--text-primary) !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.75rem !important;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    transition: all var(--transition-fast) !important;
    box-shadow: var(--shadow-sm) !important;
}

.wheel-link-card:hover {
    background: var(--bg-card) !important;
    border-color: var(--border-medium) !important;
    transform: translateY(-2px);
}

.wheel-card-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    flex: 1 1 auto;
}

.wheel-card-label > span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.wheel-emoji {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.spin-pill-badge {
    font-size: 0.825rem;
    font-weight: 700;
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
}

.spin-pill-badge.cyan {
    color: var(--accent-cyan);
    background: rgba(56, 225, 255, 0.1);
}

.spin-pill-badge.mint {
    color: var(--accent-mint);
    background: rgba(0, 229, 153, 0.1);
}


/* -------------------------------------------------------------------------- */
/* Responsive: Stack into 1 Column on Mobile                                  */
/* -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .custom-wheels-grid {
        grid-template-columns: 1fr !important;
    }

    .wheel-link-card {
        padding: 0.9rem 1rem !important;
    }

    .wheel-card-label {
        min-width: 0;
    }

    .wheel-card-label > span:last-child {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}