/* YouTube Video Aggregator - Mobile First CSS */

:root {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --accent: #ff0050;
    --accent-hover: #e00045;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Header */
.site-header {
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-primary);
}

.site-logo svg {
    color: var(--accent);
}

.header-search {
    display: flex;
    align-items: center;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    padding: 0.25rem 0.5rem 0.25rem 1rem;
    width: 100%;
    max-width: 320px;
}

.header-search input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.875rem;
    width: 100%;
}

.header-search button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
}

.header-search button:hover {
    color: var(--accent);
}

.btn-submit-header {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.45rem 0.85rem;
    border-radius: 9999px;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn-submit-header:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

/* Categories Nav */
.categories-nav {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}
.categories-nav::-webkit-scrollbar {
    display: none;
}

.categories-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.5rem 1rem;
    display: flex;
    gap: 0.5rem;
}

.cat-link {
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 9999px;
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.cat-link:hover, .cat-link.active {
    background: var(--accent);
    color: #fff;
}

/* Main Container */
.main-content {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    flex: 1;
}

.section-header {
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 700;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.25rem;
}

@media (min-width: 576px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .video-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Video Card */
.video-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border-color);
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--bg-card-hover);
}

.thumb-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}

.thumb-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-card:hover .thumb-container img {
    transform: scale(1.05);
}

.badge-category {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.badge-time {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.card-body {
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.4rem;
}

/* Detail Page Layout */
.detail-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 992px) {
    .detail-layout {
        grid-template-columns: 1fr 340px;
    }
}

.player-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-info-box {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-top: 1rem;
    border: 1px solid var(--border-color);
}

.video-detail-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.video-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-share {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: none;
    cursor: pointer;
    color: #fff;
    transition: opacity 0.2s ease;
}

.btn-share:hover {
    opacity: 0.9;
}

.btn-whatsapp { background: #25D366; }
.btn-facebook { background: #1877F2; }
.btn-x { background: #000; }
.btn-copy { background: #475569; }

.video-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: pre-line;
    line-height: 1.6;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.breadcrumbs a {
    color: var(--text-secondary);
}

.breadcrumbs a:hover {
    color: var(--accent);
}

/* Sidebar */
.sidebar-box {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.sidebar-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 2rem;
}

.page-link {
    padding: 0.5rem 0.9rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.85rem;
}

.page-link.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.page-link:hover:not(.active) {
    background: var(--bg-card-hover);
}

/* Footer */
.site-footer {
    background: #090d16;
    border-top: 1px solid var(--border-color);
    padding: 2rem 1rem 1rem;
    margin-top: 3rem;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .footer-container {
        grid-template-columns: 2fr 1fr;
    }
}

.footer-brand p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    max-width: 480px;
}

.footer-links h4 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.footer-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.footer-links a {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-bottom {
    max-width: 1280px;
    margin: 1.5rem auto 0;
    padding-top: 1rem;
    padding-bottom: 4rem; /* Extra spacing for fixed sticky bar */
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Fixed Mobile Sticky Navigation Bar (Matching Screenshot) */
.mobile-sticky-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 60px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    justify-content: space-between !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 999999 !important;
    box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.4) !important;
    background: #0f172a;
}

.mobile-sticky-bar .sticky-bar-item {
    flex: 1 1 0% !important;
    width: 33.333% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 4px 2px !important;
    margin: 0 !important;
    text-decoration: none !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    box-sizing: border-box !important;
    transition: opacity 0.2s ease, filter 0.2s ease !important;
}

.mobile-sticky-bar .sticky-bar-item i {
    font-size: 1.35rem !important;
    margin-bottom: 3px !important;
    display: block !important;
}

.mobile-sticky-bar .sticky-bar-item span {
    display: block !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
}

.mobile-sticky-bar .sticky-bar-item:hover, 
.mobile-sticky-bar .sticky-bar-item:active {
    filter: brightness(1.15) !important;
    opacity: 0.95 !important;
}
