/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Focus styles for accessibility */
:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

.filter-btn:focus-visible,
.hl-tab:focus-visible,
.theme-toggle:focus-visible,
.expand-btn:focus-visible,
.load-more-btn button:focus-visible,
.back-to-top:focus-visible,
.read-original:focus-visible,
.highlight-card:focus-visible,
.news-card:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Skip link for keyboard users */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-blue);
    color: white;
    padding: 8px 16px;
    z-index: 1000;
    text-decoration: none;
    font-weight: 500;
}
.skip-link:focus {
    top: 0;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:root {
    --primary-blue: #1877f2;
    --light-blue: #e7f3ff;
    --dark-blue: #1565c0;
    --white: #ffffff;
    --gray-100: #f5f6f7;
    --gray-200: #e4e6eb;
    --gray-300: #d1d5db;
    --gray-600: #65676b;
    --gray-800: #3a3b3c;
    --text-primary: #050505;
    --text-secondary: #65676b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 2px 8px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] {
    --primary-blue: #5a9fff;
    --light-blue: #1e2d3d;
    --dark-blue: #3d8bdc;
    --white: #1a1c1e;
    --gray-100: #242628;
    --gray-200: #2e3134;
    --gray-300: #44484c;
    --gray-600: #c8cacc;
    --gray-800: #f0f1f2;
    --text-primary: #f0f1f2;
    --text-secondary: #c8cacc;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 2px 10px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--gray-100);
    color: var(--text-primary);
    line-height: 1.5;
}

/* Header */
.site-header {
    background: var(--primary-blue);
    color: var(--white);
    padding: 12px 16px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-content {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.logo-icon {
    font-size: 28px;
}

.logo h1 {
    font-size: 20px;
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.header-info {
    font-size: 12px;
    opacity: 0.9;
}

.update-time {
    font-size: 12px;
    opacity: 0.9;
}

/* Search Input */
.search-input {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    font-size: 13px;
    width: 150px;
    transition: width 0.3s ease, background 0.2s ease;
    outline: none;
}
.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}
.search-input:focus {
    width: 200px;
    background: rgba(255, 255, 255, 0.25);
}

@media (max-width: 480px) {
    .search-input { width: 100px; }
    .search-input:focus { width: 140px; }
}
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.header-date {
    font-size: 12px;
    opacity: 0.9;
    white-space: nowrap;
    margin-right: 12px;
    margin-left: 4px;
}

.theme-toggle:hover {
    opacity: 1;
}

/* Filter Bar */
.filter-bar {
    background: var(--white);
    padding: 10px 16px;
    max-width: 100%;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 8px;
    border-bottom: 1px solid var(--gray-200);
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 99;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.filter-bar::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    background: var(--gray-100);
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: var(--gray-200);
}

.filter-btn.active {
    background: var(--primary-blue);
    color: var(--white);
}

/* News Feed Container */
.news-feed {
    padding: 16px;
    max-width: 680px;
    margin: 0 auto;
    margin-top: 120px;
}

.feed-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* News Card */
.news-card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.news-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
}

.source-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--white);
}

/* New badge */
.new-badge {
    background: #e41e31;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    margin-left: 8px;
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Source colors */
.source-bbc { background: #bb1919; }
.source-sky { background: #0072c9; }
.source-espn { background: #cc0000; }
.source-guardian { background: #052962; }
.source-gazzetta { background: #e30613; }
.source-novasports { background: #ff6600; }
.source-redaroume { background: #d4213d; }
.source-opa { background: #1a8c5e; }
.source-sdna { background: #e63946; }
.source-sportfm { background: #003566; }
.source-sportal { background: #ff6b35; }
.source-newsgr { background: #2a9d8f; }
.source-newsbeast { background: #264653; }
.source-football-italia { background: #0066cc; }
.source-german-fn { background: #000000; }
.source-french-fn { background: #002395; }
.source-spanish-fn { background: #c8102e; }
.source-italian-fn { background: #0066cc; }
.source-great-goals { background: #ff6600; }
.source-default { background: var(--gray-600); }

/* Competition badges */
.comp-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    color: white;
    margin-left: 6px;
    text-transform: uppercase;
}
.comp-cl { background: #1a237e; }
.comp-el { background: #e65100; }
.comp-ecl { background: #2e7d32; }

.post-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.card-body {
    padding: 12px 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.card-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding-top 0.35s ease, border-top-color 0.35s ease;
    padding-top: 0;
    border-top: 1px solid transparent;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.card-content.expanded {
    max-height: 500px;
    padding-top: 10px;
    border-top-color: var(--gray-200);
}

.card-content p {
    margin-bottom: 12px;
}

.read-original {
    display: inline-block;
    margin-top: 8px;
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
}

.read-original:hover {
    text-decoration: underline;
}

/* Card Footer & Expand Button */
.card-footer {
    padding: 8px 16px 12px;
}

.expand-btn {
    width: 100%;
    background: var(--gray-100);
    border: none;
    border-radius: 6px;
    padding: 10px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: background 0.2s ease;
}

.expand-btn:hover {
    background: var(--gray-200);
}

.expand-btn.active {
    color: var(--primary-blue);
}

.expand-icon {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.expand-btn.active .expand-icon {
    transform: rotate(180deg);
}

/* Loading Skeleton */
.skeleton-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skeleton-card {
    background: var(--white);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.skeleton-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
}

.skeleton-badge {
    width: 80px;
    height: 22px;
    border-radius: 10px;
    background: var(--gray-200);
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-time {
    width: 50px;
    height: 14px;
    border-radius: 4px;
    background: var(--gray-200);
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    animation-delay: 0.2s;
}

.skeleton-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-line {
    height: 14px;
    border-radius: 4px;
    background: var(--gray-200);
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-line-long { width: 90%; animation-delay: 0.1s; }
.skeleton-line-medium { width: 60%; animation-delay: 0.3s; }

@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Load More Button */
.load-more-btn {
    text-align: center;
    padding: 16px;
}

.load-more-btn button {
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    border-radius: 8px;
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.load-more-btn button:hover {
    background: var(--dark-blue);
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--dark-blue);
    transform: translateY(-3px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 24px 16px;
    color: var(--text-secondary);
    font-size: 12px;
    border-top: 1px solid var(--gray-200);
    margin-top: 16px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* Filter divider */
.filter-divider {
    background: none !important;
    color: var(--gray-300) !important;
    cursor: default !important;
    padding: 0 2px !important;
    font-weight: 300 !important;
}

/* === HIGHLIGHTS SECTION === */
.highlights-section {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 16px 16px;
}

.highlights-header {
    margin-bottom: 12px;
}

.highlights-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.highlights-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.highlights-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.highlights-tabs::-webkit-scrollbar {
    display: none;
}

.hl-tab {
    background: var(--gray-100);
    border: none;
    border-radius: 16px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.hl-tab:hover {
    background: var(--gray-200);
}

.hl-tab.active {
    background: var(--primary-blue);
    color: var(--white);
}

.highlights-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.highlight-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.highlight-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.highlight-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.highlight-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.highlight-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.highlight-card:hover .highlight-play {
    background: var(--primary-blue);
}

.highlight-play::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 0 8px 14px;
    border-color: transparent transparent transparent white;
    margin-left: 3px;
}

.highlight-comp-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0,0,0,0.75);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.platform-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.dm-badge {
    background: #0066dc;
    color: white;
}

.highlight-info {
    padding: 10px 12px;
}

.highlight-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.highlight-meta {
    font-size: 11px;
    color: var(--text-secondary);
}

.highlight-video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.highlight-video-modal.active {
    display: flex;
}

.highlight-video-modal .modal-content {
    width: 100%;
    max-width: 800px;
    position: relative;
}

.highlight-video-modal .modal-content iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    border-radius: 12px;
}

.highlight-video-modal .modal-player {
    position: relative;
    width: 100%;
}

.modal-unavailable {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: 12px;
    color: var(--text-secondary);
    text-align: center;
    padding: 20px;
}

.modal-unavailable p {
    font-size: 14px;
    margin-bottom: 12px;
}

.highlight-video-modal .modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
}

.highlights-loading {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .filter-bar {
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        gap: 8px;
    }

    .header-date {
        font-size: 11px;
        text-align: center;
    }

    .logo h1 {
        font-size: 18px;
    }

    .card-title {
        font-size: 15px;
    }

    .filter-bar {
        top: 72px;
    }

    .news-feed {
        margin-top: 145px;
    }

    .back-to-top {
        bottom: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .highlights-list {
        grid-template-columns: 1fr;
    }

    .highlights-loading {
        grid-template-columns: 1fr;
    }
}
