/* ==========================================
   RESET Y VARIABLES - PALETA CELESTE
   ========================================== */
:root {
    --primary: #0a2463;        /* Azul oscuro */
    --secondary: #1e3a8a;      /* Azul medio */
    --accent: #38bdf8;         /* Celeste brillante */
    --accent-hover: #0ea5e9;   /* Celeste oscuro */
    --accent-light: #bae6fd;   /* Celeste claro */
    --accent-dark: #0284c7;    /* Celeste profundo */
    --white: #ffffff;
    --gray-100: #f0f9ff;       /* Fondo con tono celeste */
    --gray-200: #e0f2fe;
    --gray-300: #bae6fd;
    --gray-400: #7dd3fc;
    --gray-500: #38bdf8;
    --gray-600: #0ea5e9;
    --gray-700: #0284c7;
    --gray-800: #0369a1;
    --gray-900: #0c4a6e;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow: 0 2px 12px rgba(56, 189, 248, 0.15);
    --shadow-hover: 0 8px 30px rgba(56, 189, 248, 0.25);
    --radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

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

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* ==========================================
   CONTENEDOR
   ========================================== */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--white);
    min-height: 100vh;
    box-shadow: 0 0 40px rgba(56, 189, 248, 0.08);
}

/* ==========================================
   HEADER - GRADIENTE CELESTE
   ========================================== */
.header {
    background: linear-gradient(135deg, #0a2463 0%, #1e3a8a 40%, #2563eb 100%);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid var(--accent);
}

.header-content {
    max-width: 1320px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: var(--accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
    transition: var(--transition);
}

.logo-icon:hover {
    transform: rotate(-5deg) scale(1.05);
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.5px;
}

.logo-text span {
    color: var(--accent);
}

/* ==========================================
   NAVEGACIÓN
   ========================================== */
.main-nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-link {
    color: rgba(255,255,255,0.7);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--white);
    background: rgba(56, 189, 248, 0.15);
}

.nav-link.active {
    color: var(--white);
    background: rgba(56, 189, 248, 0.2);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--accent);
    border-radius: 3px;
}

/* ==========================================
   HEADER ACTIONS
   ========================================== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn {
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    display: inline-block;
}

.btn-login {
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255,255,255,0.2);
}

.btn-login:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: var(--accent);
}

.btn-register {
    background: var(--accent);
    color: var(--primary);
}

.btn-register:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
}

.btn-logout {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    padding: 6px 16px;
    font-size: 13px;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.25);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--white);
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-points {
    background: rgba(56, 189, 248, 0.15);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--accent);
}

/* ==========================================
   MENU MOBILE
   ========================================== */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--white);
    border-radius: 3px;
    transition: var(--transition);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ==========================================
   BOTÓN "VER TODAS" - CON ÍCONO Y CELESTE
   ========================================== */
.see-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--white);
    font-weight: 700;
    font-size: 14px;
    padding: 8px 20px;
    border-radius: 25px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border: none;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.see-all .icon {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.see-all .text {
    position: relative;
}

.see-all::after {
    content: '→';
    transition: transform 0.3s ease;
    font-size: 16px;
}

.see-all:hover {
    transform: translateX(4px) scale(1.02);
    box-shadow: 0 6px 25px rgba(56, 189, 248, 0.5);
    background: linear-gradient(135deg, var(--accent-hover), #0284c7);
}

.see-all:hover::after {
    transform: translateX(4px);
}

/* Versión alternativa con borde */
.see-all-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-weight: 700;
    font-size: 14px;
    padding: 7px 19px;
    border-radius: 25px;
    border: 2px solid var(--accent);
    background: transparent;
    text-decoration: none;
    transition: all 0.3s ease;
}

.see-all-outline .icon {
    font-size: 16px;
}

.see-all-outline::after {
    content: '→';
    transition: transform 0.3s ease;
    font-size: 16px;
}

.see-all-outline:hover {
    background: var(--accent);
    color: var(--primary);
    transform: translateX(4px);
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.3);
}

.see-all-outline:hover::after {
    transform: translateX(4px);
}

/* ==========================================
   SECTION HEADER
   ========================================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.section-title .emoji {
    margin-right: 6px;
}

/* ==========================================
   MAIN CONTENT
   ========================================== */
.main-content {
    max-width: 1320px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ==========================================
   NOTICIAS DESTACADAS
   ========================================== */
.featured-news {
    margin-bottom: 40px;
}

.news-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
}

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

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

.news-card.featured {
    grid-row: span 2;
}

.news-link {
    display: block;
    height: 100%;
}

.news-image {
    position: relative;
    padding-top: 56.25%;
    background: var(--gray-200);
    overflow: hidden;
}

.news-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.news-content {
    padding: 16px;
}

.news-tag {
    display: inline-block;
    background: var(--accent);
    color: var(--primary);
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.news-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card.featured .news-title {
    font-size: 20px;
}

.news-excerpt {
    color: var(--gray-600);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card.featured .news-excerpt {
    -webkit-line-clamp: 4;
}

.news-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--gray-500);
    flex-wrap: wrap;
}

/* ==========================================
   ÚLTIMOS RESULTADOS
   ========================================== */
.latest-results {
    margin-bottom: 40px;
}

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

.result-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

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

.result-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.result-team {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.result-team.home {
    justify-content: flex-start;
}

.result-team.away {
    justify-content: flex-end;
}

.team-name {
    font-weight: 500;
    font-size: 13px;
}

.team-score {
    font-size: 20px;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}

.team-score.winner {
    color: var(--success);
}

.result-vs {
    color: var(--gray-400);
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.result-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gray-500);
    padding-top: 10px;
    border-top: 1px solid var(--gray-100);
    flex-wrap: wrap;
    gap: 4px;
}

/* ==========================================
   DOS COLUMNAS
   ========================================== */
.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 40px;
}

/* ==========================================
   PRÓXIMOS PARTIDOS
   ========================================== */
.upcoming-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upcoming-item {
    background: var(--white);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    gap: 12px;
    flex-wrap: wrap;
}

.upcoming-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
}

.upcoming-teams {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 120px;
}

.upcoming-team {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
}

.upcoming-vs {
    color: var(--gray-400);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.upcoming-info {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--gray-500);
    flex-wrap: wrap;
    justify-content: flex-end;
    flex-shrink: 0;
}

.upcoming-date {
    white-space: nowrap;
}

.upcoming-jornada {
    background: var(--gray-200);
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 11px;
    white-space: nowrap;
    color: var(--gray-700);
}

/* ==========================================
   RANKING
   ========================================== */
.ranking-list {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    transition: var(--transition);
    gap: 10px;
    flex-wrap: wrap;
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-item:hover {
    background: var(--gray-100);
}

.ranking-position {
    width: 30px;
    font-weight: 700;
    color: var(--gray-500);
    font-size: 14px;
    text-align: center;
    flex-shrink: 0;
}

.ranking-position.top1 { color: #f59e0b; }
.ranking-position.top2 { color: #94a3b8; }
.ranking-position.top3 { color: #d97706; }

.ranking-user {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 100px;
}

.ranking-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.ranking-name {
    font-weight: 500;
    font-size: 14px;
}

.ranking-team {
    font-size: 11px;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

.ranking-points {
    font-weight: 700;
    color: var(--accent);
    font-size: 16px;
    flex-shrink: 0;
    margin-left: auto;
}

/* ==========================================
   NOTICIAS RECIENTES
   ========================================== */
.recent-news {
    margin-top: 40px;
}

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

.recent-item {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.recent-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
}

.recent-link {
    display: block;
    padding: 16px;
    text-decoration: none;
    color: inherit;
}

.recent-image {
    padding-top: 56.25%;
    background: var(--gray-200);
    position: relative;
    overflow: hidden;
}

.recent-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-content {
    padding: 16px;
}

.recent-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recent-title:hover {
    color: var(--accent-dark);
}

.recent-meta {
    font-size: 13px;
    color: var(--gray-500);
}

/* ==========================================
   FOOTER
   ========================================== */
.footer {
    background: var(--primary);
    color: rgba(255,255,255,0.8);
    padding: 48px 24px 24px;
    border-top: 3px solid var(--accent);
}

.footer-content {
    max-width: 1320px;
    margin: 0 auto;
}

.footer-brand {
    margin-bottom: 32px;
    text-align: center;
}

.footer-description {
    max-width: 600px;
    margin: 16px auto 0;
    font-size: 15px;
    line-height: 1.6;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
    padding: 32px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-column h4 {
    color: var(--white);
    font-size: 16px;
    margin-bottom: 16px;
}

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

.footer-column ul li a {
    color: rgba(255,255,255,0.6);
    transition: var(--transition);
    font-size: 14px;
}

.footer-column ul li a:hover {
    color: var(--accent);
    padding-left: 4px;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.social-link {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: var(--transition);
}

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

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

.footer-bottom p:last-child {
    margin-top: 4px;
    font-size: 13px;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 1024px) {
    .news-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .news-card.featured {
        grid-column: 1 / -1;
        grid-row: span 1;
    }
}

@media (max-width: 768px) {
    .header-content {
        height: 60px;
        padding: 0 12px;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    .logo-icon {
        width: 34px;
        height: 34px;
        font-size: 18px;
    }

    .menu-toggle {
        display: flex !important;
    }
    
    .main-nav {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--primary);
        flex-direction: column;
        padding: 12px 16px;
        border-bottom: 3px solid var(--accent);
        z-index: 1000;
    }
    
    .main-nav.active {
        display: flex !important;
    }
    
    .nav-link {
        width: 100%;
        padding: 10px 14px;
        border-radius: 8px;
        font-size: 14px;
    }
    
    .nav-link.active::after {
        display: none;
    }

    .header-actions .btn-register {
        display: none;
    }
    
    .header-actions .btn-login {
        font-size: 13px;
        padding: 6px 14px;
    }
    
    .user-menu {
        font-size: 12px;
        gap: 8px;
    }
    
    .user-points {
        display: none;
    }

    .main-content {
        padding: 16px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .see-all,
    .see-all-outline {
        font-size: 13px;
        padding: 6px 16px;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .news-card.featured {
        grid-column: 1;
    }
    
    .news-card .news-title {
        font-size: 15px;
    }
    
    .news-card.featured .news-title {
        font-size: 18px;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .two-columns {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .upcoming-item {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .upcoming-teams {
        justify-content: center;
    }
    
    .upcoming-info {
        justify-content: center;
    }

    .ranking-item {
        padding: 10px 12px;
    }

    .footer-links {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .header-content {
        height: 56px;
        padding: 0 10px;
    }
    
    .logo-text {
        font-size: 16px;
    }
    
    .logo-icon {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    .main-content {
        padding: 12px;
    }
    
    .section-title {
        font-size: 16px;
    }
    
    .see-all,
    .see-all-outline {
        font-size: 12px;
        padding: 4px 12px;
    }
    
    .see-all .icon,
    .see-all-outline .icon {
        font-size: 14px;
    }

    .result-card {
        padding: 12px;
    }
    
    .team-name {
        font-size: 12px;
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .team-score {
        font-size: 16px;
    }

    .upcoming-item {
        padding: 10px 12px;
    }
    
    .upcoming-team {
        font-size: 13px;
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .upcoming-info {
        font-size: 11px;
        gap: 8px;
    }

    .ranking-item {
        padding: 8px 10px;
    }
    
    .ranking-position {
        width: 24px;
        font-size: 13px;
    }
    
    .ranking-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .ranking-name {
        font-size: 12px;
    }
    
    .ranking-team {
        font-size: 9px;
        padding: 1px 4px;
    }
    
    .ranking-points {
        font-size: 13px;
    }

    .news-card .news-content {
        padding: 12px;
    }
    
    .news-card .news-title {
        font-size: 14px;
    }
    
    .news-card.featured .news-title {
        font-size: 16px;
    }

    .footer {
        padding: 32px 16px 16px;
    }
    
    .footer-links {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ==========================================
   ANIMACIONES
   ========================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* ==========================================
   UTILIDADES
   ========================================== */
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.text-accent { color: var(--accent); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }