/**
 * 7m ผลบอลสด - Main Stylesheet
 * Color Scheme: น้ำเงิน, ขาว, เทา
 */

/* ==========================================
   CSS Variables
   ========================================== */
:root {
    /* Primary Colors */
    --primary-blue: #0066CC;
    --primary-blue-dark: #004C99;
    --primary-blue-light: #3388DD;
    
    /* Neutral Colors */
    --white: #FFFFFF;
    --gray-lightest: #F8F9FA;
    --gray-light: #F0F2F5;
    --gray: #E0E0E0;
    --gray-medium: #B0B0B0;
    --gray-dark: #808080;
    
    /* Text Colors */
    --text-dark: #333333;
    --text-muted: #666666;
    --text-light: #999999;
    
    /* Status Colors */
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --live-red: #FF0000;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    
    /* Sidebar Width */
    --sidebar-width: auto;
}

/* ==========================================
   Reset & Base
   ========================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-dark);
    background-color: var(--gray-light);
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
}

/* Custom scrollbar - overlay style */
html {
    overflow-y: scroll;
}

body {
    scrollbar-gutter: stable;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid transparent;
    background-clip: padding-box;
}

/* Firefox scrollbar */
@supports (scrollbar-width: thin) {
    html {
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
    }
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-blue-dark);
}

img {
    max-width: 100%;
    height: auto;
}

strong, b {
    font-weight: 600;
}

/* ==========================================
   Header
   ========================================== */
.header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: var(--white);
    padding: var(--spacing-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    width: 100%;
    min-width: 100%;
}

.header-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--white);
    text-decoration: none;
    font-size: 22px;
    font-weight: 700;
}

.logo strong {
    color: #FFD700;
    font-weight: 700;
}

.logo:hover {
    color: var(--white);
    opacity: 0.9;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background: var(--white);
    border-radius: 2px;
    transition: all var(--transition-normal);
    transform-origin: center;
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: var(--spacing-lg);
}

.nav-link {
    color: var(--white);
    font-size: 14px;
    font-weight: 500;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
}

.nav-link strong {
    color: #FFD700;
}

/* ==========================================
   Mobile Banner (visible only on mobile)
   ========================================== */
.mobile-banner {
    display: none;
    text-align: center;
}

.mobile-banner a {
    display: block;
    text-decoration: none;
}

.mobile-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* ==========================================
   Main Layout
   ========================================== */
.main-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: var(--spacing-md);
    padding-left: var(--spacing-lg);
    padding-right: var(--spacing-lg);
    box-sizing: border-box;
}

.main-content {
    width: 100%;
}

.content-wrapper {
    display: flex;
    gap: var(--spacing-lg);
    width: 100%;
}

.content-left {
    flex: 1;
    min-width: 0;
}

/* ==========================================
   Page Header
   ========================================== */
.page-header {
    background: var(--white);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-sm);
}

.page-header h1 {
    font-size: 20px;
    color: var(--primary-blue);
    margin-bottom: var(--spacing-xs);
}

.page-header h1 strong {
    color: var(--primary-blue-dark);
}

.page-header .subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

/* ==========================================
   Section Header
   ========================================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.section-header h2 {
    font-size: 16px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.section-header h2 strong {
    color: var(--primary-blue);
}

/* Live Indicator */
.live-indicator {
    width: 10px;
    height: 10px;
    background: var(--live-red);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.9); }
}

/* ==========================================
   Date Tabs
   ========================================== */
.date-tabs {
    display: flex;
    gap: var(--spacing-xs);
    background: var(--white);
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.date-tabs::-webkit-scrollbar {
    display: none;
}

.date-tab {
    flex: 1;
    min-width: 60px;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--gray-light);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.date-tab:hover {
    background: var(--gray);
}

.date-tab.active {
    background: var(--primary-blue);
    color: var(--white);
}

.date-tab .tab-date {
    display: block;
    font-size: 12px;
    font-weight: 600;
}

.date-tab .tab-label {
    display: block;
    font-size: 10px;
    opacity: 0.8;
}

.date-tab.active .tab-date,
.date-tab.active .tab-label {
    color: var(--white);
}

/* Date Panels */
.date-tabs-content {
    position: relative;
}

.date-panel {
    display: none;
}

.date-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==========================================
   League Group
   ========================================== */
.league-group {
    background: var(--white);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.league-header {
    background: linear-gradient(90deg, var(--primary-blue) 0%, var(--primary-blue-light) 100%);
    color: var(--white);
    padding: var(--spacing-sm) var(--spacing-md);
    font-weight: 600;
    font-size: 13px;
}

.league-name {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* ==========================================
   Fixtures List (Compact)
   ========================================== */
.fixtures-list {
    /* Compact layout */
}

.fixture-row {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--gray-light);
    transition: background var(--transition-fast);
}

.fixture-row:last-child {
    border-bottom: none;
}

.fixture-row:hover {
    background: var(--gray-lightest);
}

.fixture-row.live {
    background: #FFF5F5;
}

/* Fixture Time */
.fixture-time {
    width: 55px;
    text-align: center;
    flex-shrink: 0;
}

.fixture-time .time {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.live-badge {
    display: inline-block;
    background: var(--live-red);
    color: var(--white);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 600;
    animation: pulse 1.5s infinite;
}

.live-badge.live-minute {
    background: var(--live-red);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Live score animation */
.fixture-row.live .fixture-score .score {
    animation: scoreGlow 1.5s infinite;
}

@keyframes scoreGlow {
    0%, 100% { 
        color: var(--live-red);
    }
    50% { 
        color: #FF6666;
        text-shadow: 0 0 8px rgba(255, 0, 0, 0.5);
    }
}

.status-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 500;
}

.status-badge.finished {
    background: var(--gray);
    color: var(--text-dark);
}

/* Fixture Teams */
.fixture-teams {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}

.team {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    min-width: 0;
}

.team.home {
    justify-content: flex-end;
    text-align: right;
}

.team.away {
    justify-content: flex-start;
}

.team-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.team-name {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Fixture Score */
.fixture-score {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 var(--spacing-md);
    flex-shrink: 0;
}

.fixture-score .score {
    font-size: 16px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    color: var(--text-dark);
}

.fixture-score .separator {
    color: var(--gray-dark);
    font-weight: 400;
}

.fixture-row.live .fixture-score .score {
    color: var(--live-red);
}

/* No Fixtures */
.no-fixtures {
    padding: var(--spacing-xl);
    text-align: center;
    color: var(--text-muted);
}

/* Inline Banner in Fixtures */
.fixture-row.banner-row {
    padding: 0;
    background: linear-gradient(90deg, #fff9c4 0%, #fff59d 100%);
    border-bottom: 1px solid var(--gray-light);
    min-height: 40px;
    max-height: 45px;
    overflow: hidden;
}

.inline-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 40px;
    padding: 0 var(--spacing-md);
}

.inline-banner img {
    height: 32px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.inline-banner a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #333;
    font-size: 13px;
    font-weight: 500;
}

.inline-banner a:hover {
    color: var(--primary);
}

.inline-banner .banner-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 500px;
}

/* ==========================================
   Sidebar
   ========================================== */
.sidebar {
    width: 350px;
    flex-shrink: 0;
}

/* Sidebar Banner */
.sidebar-banner {
    margin-bottom: var(--spacing-md);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: var(--white);
}

.sidebar-banner a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.sidebar-banner img {
    display: block;
    width: 100%;
    height: auto;
}

.sidebar-banner .banner-text {
    display: block;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    background: var(--gray-lightest);
    text-align: center;
    line-height: 1.4;
}

.sidebar-banner a:hover .banner-text {
    background: var(--primary);
    color: var(--white);
}

/* Sidebar Standings */
.sidebar-standings {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.sidebar-title {
    background: var(--primary-blue);
    color: var(--white);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 14px;
    font-weight: 600;
}

/* League Tabs */
.league-tabs {
    display: flex;
    background: var(--gray-light);
    padding: var(--spacing-xs);
    gap: 2px;
}

.league-tab {
    flex: 1;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
}

.league-tab .league-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.league-tab .league-short {
    font-size: 11px;
    font-weight: 600;
}

.league-tab:hover {
    background: var(--gray);
}

.league-tab.active {
    background: var(--primary-blue);
    color: var(--white);
}

.league-tab.active .league-logo {
    filter: brightness(0) invert(1);
}

/* Standings Container */
.standings-container {
    /* No scrollbar - show full content */
}

.standings-panel {
    display: none;
}

.standings-panel.active {
    display: block;
}

/* Standings Table */
.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.standings-table th,
.standings-table td {
    padding: 6px 4px;
    text-align: center;
    border-bottom: 1px solid var(--gray-light);
}

.standings-table th {
    background: var(--gray-lightest);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 10px;
}

.standings-table td.position {
    font-weight: 600;
    width: 25px;
}

.standings-table td.team-name {
    text-align: left;
    white-space: nowrap;
}

.standings-table td.team-name img.team-logo {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
}

.standings-table td.points {
    font-weight: 700;
    color: var(--primary-blue);
}

.standings-table td.goal-diff.positive {
    color: var(--success);
}

.standings-table td.goal-diff.negative {
    color: var(--danger);
}

/* Position classes */
.standings-table tr.champions td:first-child {
    border-left: 3px solid var(--success);
}

.standings-table tr.europa td:first-child {
    border-left: 3px solid var(--primary-blue);
}

.standings-table tr.relegation td:first-child {
    border-left: 3px solid var(--danger);
}

.standings-panel .no-data {
    padding: var(--spacing-lg);
    text-align: center;
    color: var(--text-muted);
}

/* ==========================================
   SEO Content
   ========================================== */
.about-section {
    background: var(--white);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-top: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.about-section h2 {
    font-size: 16px;
    color: var(--primary-blue);
    margin-bottom: var(--spacing-md);
}

.about-section h2 strong {
    color: var(--primary-blue-dark);
}

.about-text p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
    line-height: 1.7;
}

.about-text p:last-child {
    margin-bottom: 0;
}

.about-text strong {
    color: var(--text-dark);
}

/* ==========================================
   Footer
   ========================================== */
.footer {
    background: var(--text-dark);
    color: var(--white);
    padding: var(--spacing-xl) var(--spacing-md);
    margin-top: var(--spacing-xl);
    width: 100%;
    min-width: 100%;
}

.footer-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.footer-section h4 {
    font-size: 14px;
    margin-bottom: var(--spacing-md);
    color: var(--white);
}

.footer-section h4 strong {
    color: #FFD700;
}

.footer-section p {
    font-size: 12px;
    color: var(--gray-medium);
    line-height: 1.7;
}

.footer-section strong {
    color: var(--white);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--spacing-sm);
}

.footer-links a {
    font-size: 12px;
    color: var(--gray-medium);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--white);
}

.footer-links a strong {
    color: #FFD700;
}

.footer-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.footer-keywords span {
    font-size: 11px;
    color: var(--gray-medium);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.footer-keywords span strong {
    color: #FFD700;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--spacing-md);
    text-align: center;
}

.footer-bottom p {
    font-size: 12px;
    color: var(--gray-medium);
}

.footer-bottom strong {
    color: #FFD700;
}

/* ==========================================
   Responsive Design
   ========================================== */

/* Tablet */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .content-wrapper {
        flex-direction: column;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 768px) {
    /* Header */
    .hamburger {
        display: flex;
    }
    
    .nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--primary-blue-dark);
        padding: 80px var(--spacing-lg) var(--spacing-lg);
        transition: left var(--transition-normal);
        z-index: 999;
    }
    
    .nav.active {
        left: 0;
    }
    
    .nav-list {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .nav-link {
        display: block;
        padding: var(--spacing-md);
        border-radius: var(--radius-sm);
    }
    
    /* Mobile Banner */
    .mobile-banner {
        display: block;
    }
    
    /* Main Content */
    .main-wrapper {
        padding: var(--spacing-sm);
    }
    
    .page-header {
        padding: var(--spacing-md);
    }
    
    .page-header h1 {
        font-size: 16px;
    }
    
    .page-header .subtitle {
        font-size: 11px;
    }
    
    /* Date Tabs */
    .date-tab {
        min-width: 50px;
        padding: var(--spacing-xs);
    }
    
    .date-tab .tab-date {
        font-size: 11px;
    }
    
    .date-tab .tab-label {
        font-size: 9px;
    }
    
    /* Fixtures */
    .fixture-row {
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .fixture-time {
        width: 45px;
    }
    
    .team-name {
        font-size: 11px;
    }
    
    .fixture-score {
        padding: 0 var(--spacing-sm);
    }
    
    .fixture-score .score {
        font-size: 14px;
        min-width: 18px;
    }
    
    .team-logo {
        width: 16px;
        height: 16px;
    }
    
    /* Inline Banner - Mobile */
    .fixture-row.banner-row {
        padding: var(--spacing-xs) var(--spacing-sm);
        min-height: auto;
    }
    
    .inline-banner {
        flex-direction: row;
        gap: 8px;
        padding: 0;
    }
    
    .inline-banner img {
        height: 24px;
        width: auto;
    }
    
    .inline-banner a {
        flex-direction: row;
        gap: 8px;
        font-size: 11px;
    }
    
    .inline-banner .banner-text {
        font-size: 11px;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .about-section {
        padding: var(--spacing-md);
    }
    
    .about-section h2 {
        font-size: 14px;
    }
    
    .about-text p {
        font-size: 12px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .logo {
        font-size: 18px;
    }
    
    .page-header h1 {
        font-size: 14px;
    }
    
    .section-header h2 {
        font-size: 14px;
    }
    
    .fixture-time {
        width: 40px;
    }
    
    .fixture-score {
        padding: 0 var(--spacing-xs);
    }
    
    .fixture-score .score {
        font-size: 13px;
    }
    
    .team-name {
        font-size: 10px;
    }
}

/* Overlay for mobile menu */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.nav-overlay.active {
    display: block;
}

/* ==========================================
   Auto Refresh Animations
   ========================================== */
.score-updated {
    animation: scoreUpdate 0.5s ease-out;
    color: var(--success) !important;
    font-weight: bold;
}

@keyframes scoreUpdate {
    0% {
        transform: scale(1);
        background-color: transparent;
    }
    50% {
        transform: scale(1.3);
        background-color: var(--warning);
        color: var(--text-dark);
    }
    100% {
        transform: scale(1);
        background-color: transparent;
    }
}

.fixture-row.live .fixture-score .score {
    color: var(--live-red);
    font-weight: bold;
}

.live-badge {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* ==========================================
   Utilities
   ========================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary-blue); }
.font-bold { font-weight: 700; }
.mt-md { margin-top: var(--spacing-md); }
.mb-md { margin-bottom: var(--spacing-md); }

