/* Enhanced LaLiga Frontend - SofaScore Inspired */

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

:root {
    --primary: #FF6B00;
    --primary-dark: #e55e00;
    --dark: #1a1a2e;
    --dark-light: #2a2a3e;
    --gray: #f8f9fa;
    --gray-dark: #e9ecef;
    --text: #333;
    --text-light: #666;
    --text-lighter: #999;
    --white: #fff;
    --success: #00aa00;
    --danger: #ff0000;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--gray);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Header */
header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--gray-dark);
}

.navbar {
    padding: 16px 0;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: var(--transition);
}

.logo:hover {
    transform: translateY(-1px);
}

.logo h1 {
    color: var(--dark);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-menu a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-menu a:hover {
    background: var(--gray);
    color: var(--primary);
}

/* Live Scores Section */
.live-scores {
    background: var(--white);
    padding: 24px;
    margin: 20px 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.scores-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.scores-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.3px;
}

.live-indicator {
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

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

.match-card-link {
    text-decoration: none;
    color: inherit;
}

.match-card {
    background: var(--gray);
    padding: 20px;
    border-radius: var(--radius);
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
}

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

.match-card.live {
    background: linear-gradient(135deg, #fff5f5 0%, var(--gray) 100%);
    border-left: 4px solid var(--danger);
}

.match-card.upcoming {
    border-left: 4px solid var(--primary);
}

.match-time {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 16px;
    letter-spacing: 0.3px;
}

.match-card.live .match-time {
    color: var(--danger);
}

.match-teams {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

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

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

.team-score {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    min-width: 30px;
    text-align: right;
}

.match-status {
    display: inline-block;
    padding: 4px 12px;
    background: var(--danger);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.match-card.upcoming .match-status {
    background: var(--primary);
}

/* Hero Section */
.hero {
    margin: 20px 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
    height: 400px;
}

.hero-image {
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding: 40px;
    position: relative;
}

.hero-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
}

.badge {
    display: inline-block;
    background: var(--primary);
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.hero h2 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.2;
    color: var(--white);
    letter-spacing: -1px;
}

.hero p {
    font-size: 16px;
    margin-bottom: 20px;
    color: rgba(255,255,255,0.9);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3);
}

/* League Table */
.league-table {
    margin: 30px 0;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--dark);
    letter-spacing: -0.5px;
}

.table-container {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--dark);
    color: var(--white);
}

th {
    padding: 16px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

tbody tr {
    border-bottom: 1px solid var(--gray-dark);
    transition: var(--transition);
}

tbody tr:hover {
    background: var(--gray);
}

tbody tr:last-child {
    border-bottom: none;
}

td {
    padding: 16px 14px;
    font-size: 14px;
}

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

.team-badge {
    font-size: 16px;
}

.champions-zone {
    border-left: 4px solid #0066cc;
}

.europa-zone {
    border-left: 4px solid var(--primary);
}

.relegation-zone {
    border-left: 4px solid var(--danger);
}

/* Player Stats */
.player-stats {
    margin: 30px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

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

.player-rank {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    min-width: 40px;
}

.player-info {
    flex: 1;
}

.player-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 2px;
}

.player-team {
    font-size: 13px;
    color: var(--text-light);
}

.player-stat {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
}

/* News Grid */
.news-grid {
    margin: 30px 0;
}

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

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

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

.news-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 20px;
}

.category {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.news-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--dark);
    line-height: 1.3;
    letter-spacing: -0.3px;
}

.news-card p {
    color: var(--text-light);
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.time {
    color: var(--text-lighter);
    font-size: 12px;
    font-weight: 500;
}

/* Footer */
footer {
    background: var(--dark);
    color: var(--white);
    padding: 50px 0 20px;
    margin-top: 60px;
}

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

.footer-section h3 {
    margin-bottom: 16px;
    font-size: 16px;
    color: var(--primary);
    font-weight: 700;
}

.footer-section p {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    line-height: 1.6;
}

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

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

.footer-section a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--primary);
}

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

/* Responsive */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 12px;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero {
        height: 300px;
    }

    .hero h2 {
        font-size: 28px;
    }

    .scores-container,
    .grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 12px 8px;
    }
}

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

/* Selection */
::selection {
    background: var(--primary);
    color: var(--white);
}
