@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* --- Reset & Core --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-y: scroll;
    /* Force track on HTML level for consistent stability */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    margin: 0;
}

/* --- Universal Header (Fixed Top) --- */
.site-header {
    width: 100%;
    height: 70px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    padding: 0;
    /* Removing padding from header wrapper */
}

.header-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 50px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 32px;
    height: 100%;
}

.header-brand {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding-right: 28px;
    margin-right: 4px;
    border-right: 1px solid #e2e8f0;
}

.logo-link {
    display: block;
    line-height: 0;
}

.logo-link img {
    height: 50px;
    width: auto;
    max-width: 200px;
    display: block;
    object-fit: contain;
    object-position: left center;
}

/* Navigation */
.main-nav {
    display: flex;
    flex: 1;
    justify-content: center;
    gap: 23px;
    align-items: flex-end;
    height: 50px;
    padding-bottom: 0;
    min-width: 0;
}

.main-nav a {
    text-decoration: none;
    font-size: 18px;
    /* Increased from 16px */
    font-weight: 500;
    color: #64748b;
    padding: 13px 0 3px 0;
    /* Text down 1px, Gap 3px */
    /* Fixed padding */
    border-bottom: 3px solid transparent;
    /* Fixed border */
    transition: none !important;
    /* Force disable all animations */
    letter-spacing: -0.3px;
    line-height: normal;
}

.main-nav a:hover {
    color: #0f172a;
    border-bottom-color: #cbd5e1;
}

/* Active States */
.active-link {
    color: #0f172a !important;
    /* font-weight: 600 !important; REMOVED: Cause of vibration/shift */
}

.nav-usedsale.active-link {
    border-bottom-color: #FCCE08 !important;
}

.nav-services.active-link {
    border-bottom-color: #D92226 !important;
}

.nav-jobs.active-link {
    border-bottom-color: #008DD2 !important;
}

.nav-sms.active-link {
    border-bottom-color: #009846 !important;
}

.nav-post.active-link {
    border-bottom-color: #6A2F85 !important;
}

.nav-market.active-link {
    border-bottom-color: #E5097F !important;
}

.nav-edu.active-link {
    border-bottom-color: #0060AA !important;
}

.nav-movies.active-link {
    border-bottom-color: #EA5E20 !important;
}

.nav-videos.active-link {
    border-bottom-color: #393185 !important;
}

/* Header Right: Search & Profile */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 100%;
    flex-shrink: 0;
    margin-left: auto;
}

.search-bar {
    background: #f8fafc;
    border-radius: 24px;
    /* Pill shape for modern look */
    padding: 0 16px;
    display: flex;
    align-items: center;
    width: 260px;
    height: 40px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.search-bar:focus-within {
    background: #fff;
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 18px;
    /* Increased from 16px */
    width: 100%;
    color: #334155;
}

.nav-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 18px;
    /* Increased from 16px */
    /* Match Nav Links */
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: none !important;
    /* No Animation */
}

.btn-login {
    background: #0f172a;
    color: white;
}

.btn-login:hover {
    background: #334155;
    transform: none !important;
    /* No Movement */
}

/* --- Hero Section (Home Only) --- */
.hero-section {
    width: 100%;
    flex: 1;
    /* Pushes footer to bottom */
    background: white;
    padding: 60px 20px 260px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Center content vertically if short */
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
}

.hero-title {
    font-size: 18px;
    /* Increased from 16px */
    font-weight: 800;
    margin-bottom: 16px;
    color: #1e293b;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: 18px;
    /* Increased from 16px */
    color: #64748b;
    margin-bottom: 40px;
    max-width: 600px;
    line-height: 1.6;
}

.hero-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 20px;
    width: 100%;
    max-width: 100%;
    /* Allow full width scrolling */
    padding: 10px 0;
    /* Space for shadow/scrollbar */
    justify-content: center;
    /* Center if they fit, start if overflow (via margin auto if needed, but flex handles start) */
}

/* Optional: Hide scrollbar for cleaner look if desired, but keep functionality */
.hero-grid::-webkit-scrollbar {
    height: 6px;
}

.hero-grid::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.hero-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    text-decoration: none;
    color: #334155;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    min-width: 137px;
    /* Reduced by 3px from 140px */
    flex: 0 0 auto;
    /* Don't shrink */
}

.hero-card:hover {
    background: white;
    border-color: #cbd5e1;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transform: translateY(-4px);
}

.hero-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
}

.hero-label {
    font-weight: 700;
    font-size: 18px;
    /* Increased from 16px */
}

/* Updated label subtitle style if present (span inside hero-card) */
.hero-card span {
    font-size: 11px !important;
    opacity: 0.8;
}

/* --- Content & Footer --- */
.main-content,
.page-wrapper {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 15px;
    flex: 1;
}

.site-footer {
    background: white;
    border-top: 1px solid #e2e8f0;
    padding: 32px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

/* --- Used Sales Adjustments --- */
.classifieds-filter-bar {
    background: #ffffff;
    padding: 12px 15px;
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 70px;
    /* Matches header 70px */
    z-index: 1000;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 18px;
    }
}

/* --- Global Search Results --- */
#search-results {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    position: absolute;
    top: 100%;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
}

.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s;
    text-align: left;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #f8fafc;
    cursor: pointer;
}

/* --- Sakala Videos YouTube Style Layout --- */
.yt-layout {
    display: flex;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    align-items: flex-start;
}

/* Sidebar */
.yt-sidebar {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 70px; /* Header height */
    height: calc(100vh - 70px);
    padding: 12px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-right: 1px solid #e2e8f0;
    background: #f8fafc;
}

/* Hide scrollbar for sidebar */
.yt-sidebar::-webkit-scrollbar {
    width: 6px;
}
.yt-sidebar::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 3px;
}
.yt-sidebar:hover::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}

.yt-nav-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    color: #1e293b;
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    transition: background 0.2s;
}

.yt-nav-item svg {
    width: 24px;
    height: 24px;
    margin-right: 20px;
    fill: currentColor;
}

.yt-nav-item:hover {
    background: #f1f5f9;
}

.yt-nav-item.active {
    background: #e2e8f0;
    font-weight: 600;
}

.yt-divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 12px 0;
}

/* Main Content Area */
.yt-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Chips Bar */
.yt-chips-container {
    display: flex;
    gap: 12px;
    padding: 12px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: rgba(248, 250, 252, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: sticky;
    top: 70px; /* Header height */
    z-index: 10;
    overflow-x: auto;
    white-space: nowrap;
}

.yt-chips-container::-webkit-scrollbar {
    display: none;
}

.yt-chip {
    background: #e2e8f0;
    color: #1e293b;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.yt-chip:hover {
    background: #cbd5e1;
}

.yt-chip.active {
    background: #0f172a;
    color: #ffffff;
}

/* Video Grid */
.yt-videos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px 16px;
    padding: 24px;
}

/* Video Card */
.yt-video-card {
    text-decoration: none;
    color: #1e293b;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.yt-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    position: relative;
    margin-bottom: 12px;
    transition: border-radius 0.2s;
}

.yt-video-card:hover .yt-thumb {
    border-radius: 0;
}

.yt-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 4px;
    border-radius: 4px;
}

.yt-details {
    display: flex;
    gap: 12px;
    padding-right: 12px;
}

.yt-channel-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: #e2e8f0;
}

.yt-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.yt-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    color: #0f172a;
}

.yt-channel-name {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.yt-channel-name:hover {
    color: #1e293b;
}

.yt-verified-icon {
    width: 14px;
    height: 14px;
    fill: #94a3b8;
}

.yt-meta {
    font-size: 14px;
    color: #64748b;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .yt-sidebar {
        width: 72px;
        padding: 12px 4px;
    }
    .yt-nav-item span {
        display: none;
    }
    .yt-nav-item svg {
        margin-right: 0;
        margin: 0 auto;
    }
    .yt-nav-item {
        flex-direction: column;
        justify-content: center;
        padding: 16px 0;
    }
}

@media (max-width: 768px) {
    .yt-sidebar {
        display: none;
    }
    .yt-chips-container {
        top: 60px; /* Assuming header is smaller on mobile */
    }
    .yt-videos-grid {
        grid-template-columns: 1fr;
        gap: 24px 0;
        padding: 12px 0;
    }
    .yt-thumb {
        border-radius: 0;
    }
}