/* Reset และพื้นฐาน */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a5fb4;
    --secondary-color: #e01b24;
    --dark-color: #1a1a1a;
    --light-color: #f5f5f5;
    --gray-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --border-radius: 12px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Kanit', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--dark-color) 0%, #2c2c2c 100%);
    color: white;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 0.9rem;
    color: var(--secondary-color);
    font-weight: 500;
    padding: 4px 8px;
    background: rgba(224, 27, 36, 0.1);
    border-radius: 4px;
}

.nav ul {
    display: flex;
    list-style: none;
    gap: 5px;
}

.nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 8px 16px;
    position: relative;
    border-radius: 6px;
    display: block;
}

.nav ul li a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--secondary-color);
}

.nav ul li a.active {
    background: var(--secondary-color);
    color: white;
}

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), 
                url('https://images.unsplash.com/photo-1575361204480-aadea25e6e68?ixlib=rb-4.0.3&auto=format&fit=crop&w=1950&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    padding: 120px 0;
    text-align: center;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 1s ease;
}

.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 1s ease 0.2s;
    animation-fill-mode: both;
}

.search-bar {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease 0.4s;
    animation-fill-mode: both;
}

.search-bar input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 50px 0 0 50px;
    font-size: 1rem;
    font-family: 'Kanit', sans-serif;
}

.search-bar input:focus {
    outline: none;
}

.search-bar button {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0 30px;
    border-radius: 0 50px 50px 0;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.2rem;
}

.search-bar button:hover {
    background: #c4161f;
    transform: scale(1.05);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Styling */
section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 50px;
    text-align: center;
    color: var(--dark-color);
    position: relative;
    font-weight: 700;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* Live Matches */
.live-matches {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.live-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    color: var(--danger-color);
    font-weight: 700;
    font-size: 1.2rem;
}

.live-dot {
    width: 12px;
    height: 12px;
    background-color: var(--danger-color);
    border-radius: 50%;
    margin-right: 10px;
    animation: pulse 1.5s infinite;
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* Matches Container */
.matches-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.match-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.match-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.match-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.match-card.live {
    border: 2px solid var(--danger-color);
    animation: liveBorder 2s infinite;
}

@keyframes liveBorder {
    0%, 100% {
        border-color: var(--danger-color);
    }
    50% {
        border-color: #ff6b6b;
    }
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.league-name {
    font-size: 0.9rem;
    color: var(--gray-color);
    font-weight: 500;
}

.live-badge {
    background: var(--danger-color);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    animation: pulse 1.5s infinite;
}

.match-body {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.team-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
    object-fit: contain;
    transition: var(--transition);
}

.match-card:hover .team-logo {
    transform: scale(1.1);
}

.team-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--dark-color);
}

.match-score {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    text-align: center;
}

.live-score {
    color: var(--danger-color);
    animation: scoreFlash 2s infinite;
}

@keyframes scoreFlash {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.match-vs {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--gray-color);
    text-align: center;
}

.match-status {
    text-align: center;
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.status-live {
    background: linear-gradient(135deg, var(--danger-color), #ff6b6b);
    color: white;
}

.status-finished {
    background: linear-gradient(135deg, var(--success-color), #34ce57);
    color: white;
}

.status-upcoming {
    background: linear-gradient(135deg, var(--warning-color), #ffdb4d);
    color: var(--dark-color);
}

/* Filters */
.date-filter,
.league-filter {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.date-btn,
.filter-btn {
    padding: 10px 20px;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    border-radius: 25px;
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    font-weight: 500;
    transition: var(--transition);
}

.date-btn:hover,
.filter-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.date-btn.active,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(26, 95, 180, 0.3);
}

/* Results */
.results {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

/* Standings */
.standings {
    background: white;
}

.league-selector {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.league-selector select {
    padding: 12px 20px;
    border-radius: 25px;
    border: 2px solid var(--primary-color);
    font-family: 'Kanit', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    width: 300px;
    cursor: pointer;
    background: white;
    color: var(--primary-color);
    transition: var(--transition);
}

.league-selector select:hover {
    background: var(--primary-color);
    color: white;
}

.league-selector select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 95, 180, 0.2);
}

.table-responsive {
    overflow-x: auto;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.standings-table th,
.standings-table td {
    padding: 15px;
    text-align: left;
}

.standings-table th {
    background: linear-gradient(135deg, var(--primary-color), #2472c8);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.standings-table tbody tr {
    transition: var(--transition);
    border-bottom: 1px solid #f0f0f0;
}

.standings-table tbody tr:hover {
    background: #f8f9fa;
    transform: scale(1.01);
}

.standings-table tr.champions {
    border-left: 4px solid #00c853;
}

.standings-table tr.europa {
    border-left: 4px solid #ff6d00;
}

.standings-table tr.relegation {
    border-left: 4px solid var(--danger-color);
}

.rank-cell {
    font-weight: 700;
    font-size: 1.1rem;
}

.team-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.team-cell img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.points-cell {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.standings-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.legend-box {
    width: 20px;
    height: 15px;
    border-radius: 3px;
}

.legend-item.champions .legend-box {
    background: #00c853;
}

.legend-item.europa .legend-box {
    background: #ff6d00;
}

.legend-item.relegation .legend-box {
    background: var(--danger-color);
}

/* Statistics */
.statistics {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.stat-card h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--dark-color);
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: var(--transition);
}

.stat-item:hover {
    background: var(--light-color);
    transform: translateX(5px);
}

.stat-rank {
    width: 30px;
    height: 30px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.stat-logo {
    width: 25px;
    height: 25px;
    object-fit: contain;
}

.stat-name {
    flex: 1;
    font-weight: 500;
}

.stat-value {
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-form {
    font-weight: 600;
    letter-spacing: 2px;
    font-size: 0.9rem;
}

/* News */
.news {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.news-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.news-image {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.1);
}

.news-content {
    padding: 25px;
}

.news-date {
    display: inline-block;
    color: var(--gray-color);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.news-content h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--dark-color);
    font-weight: 600;
}

.news-content p {
    color: var(--gray-color);
    margin-bottom: 15px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: var(--transition);
}

.read-more::after {
    content: '→';
    margin-left: 8px;
    transition: margin-left 0.3s;
    font-size: 1.2rem;
}

.read-more:hover {
    color: var(--secondary-color);
}

.read-more:hover::after {
    margin-left: 15px;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--dark-color) 0%, #0d0d0d 100%);
    color: white;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 20px;
    color: white;
    font-weight: 600;
}

.footer-section h3 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-section p {
    color: #bbb;
    line-height: 1.8;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section ul li a {
    color: #bbb;
    text-decoration: none;
    transition: var(--transition);
    display: inline-block;
}

.footer-section ul li a:hover {
    color: white;
    transform: translateX(5px);
}

.footer-section ul li i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    font-size: 0.9rem;
}

/* Loading และ Messages */
.loading,
.no-matches,
.error-message {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
    border-radius: var(--border-radius);
    background: white;
}

.loading {
    color: var(--primary-color);
    font-weight: 500;
}

.no-matches {
    color: var(--gray-color);
}

.no-matches i {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
    opacity: 0.5;
}

.error-message {
    color: var(--danger-color);
}

.error-message i {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--dark-color);
        padding: 20px;
        display: none;
    }
    
    .nav.active {
        display: block;
    }
    
    .nav ul {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav ul li {
        width: 100%;
    }
    
    .nav ul li a {
        display: block;
        text-align: center;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .hero {
        padding: 80px 0;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .matches-container,
    .results-container,
    .news-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .match-body {
        gap: 10px;
    }
    
    .team-logo {
        width: 50px;
        height: 50px;
    }
    
    .match-score {
        font-size: 1.5rem;
    }
    
    .standings-table {
        font-size: 0.85rem;
    }
    
    .standings-table th,
    .standings-table td {
        padding: 10px 8px;
    }
    
    .date-filter,
    .league-filter {
        gap: 8px;
    }
    
    .date-btn,
    .filter-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 60px 0;
    }
    
    section {
        padding: 50px 0;
    }
    
    .match-card {
        padding: 15px;
    }
    
    .team-name {
        font-size: 0.85rem;
    }
    
    .league-selector select {
        width: 100%;
    }
    
    .search-bar {
        flex-direction: column;
    }
    
    .search-bar input,
    .search-bar button {
        border-radius: 25px;
        width: 100%;
    }
    
    .search-bar button {
        margin-top: 10px;
        padding: 12px;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}
