@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;700&family=Poppins:wght@800;900&display=swap');

:root {
    /* World Cup 2026 Inspired Palette */
    --primary: #4100F5; /* Vibrant Purple */
    --primary-dark: #1E1B4B; /* Deep Blue/Purple for dark accents */
    --secondary: #00FF87; /* Neon Green/Cyan from the logo pattern */
    --accent: #FF004D; /* Vibrant Red/Pink */
    --bg-dark: #000000;
    --text-light: #FFFFFF;
    --text-dark: #111111;
    --glass-bg: rgba(30, 27, 75, 0.4);
    --glass-border: rgba(255, 255, 255, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans', sans-serif;
}

h1, h2, h3, h4, h5, h6, .brand-font {
    font-family: 'Poppins', sans-serif;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

body {
    background: url('../img/estadio_azteca.jpg') no-repeat center center;
    background-size: cover;
    background-attachment: fixed; /* Parallax effect */
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Background overlay for readability */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(65, 0, 245, 0.6) 0%, rgba(0, 0, 0, 0.9) 100%);
    z-index: -1;
}

header {
    background: rgba(0, 0, 0, 0.7);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--secondary);
    backdrop-filter: blur(10px);
}

header h1 {
    font-size: 1.8rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
}

header h1 span {
    color: var(--secondary);
}

.auth-links a, .nav-links a, .nav-links span {
    color: #fff;
    text-decoration: none;
    margin-left: 15px;
    font-weight: 700;
    transition: color 0.3s;
}

.auth-links a:hover, .nav-links a:hover {
    color: var(--secondary);
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    flex: 1;
    position: relative;
}

.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(20px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    position: relative;
}

/* Auth Forms */
.auth-form {
    max-width: 400px;
    margin: 4rem auto;
    text-align: center;
}

.auth-form h2 {
    margin-bottom: 1.5rem;
    color: var(--secondary);
    font-weight: 800;
}

.form-group {
    margin-bottom: 1.2rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #ccc;
}

.form-control {
    width: 100%;
    padding: 0.9rem;
    border-radius: 10px;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-dark);
    font-size: 1rem;
    transition: all 0.3s;
    font-family: 'Noto Sans', sans-serif;
    font-weight: 700;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(65, 0, 245, 0.3);
}

.btn {
    display: inline-block;
    padding: 0.9rem 1.5rem;
    border: none;
    border-radius: 10px;
    background: var(--secondary);
    color: #000;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
    width: 100%;
    text-transform: uppercase;
}

.btn:hover {
    background: #00cc6a;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 255, 135, 0.3);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: #2a00a3;
    box-shadow: 0 10px 20px rgba(65, 0, 245, 0.4);
}

/* Dashboard Tabs */
.tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 2rem;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    padding-bottom: 15px;
    overflow-x: auto;
}

.tab-btn {
    background: transparent;
    color: #fff;
    border: 2px solid transparent;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 30px;
    transition: all 0.3s;
    white-space: nowrap;
    text-transform: uppercase;
}

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

.tab-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--secondary);
    box-shadow: 0 0 15px rgba(65,0,245,0.5);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Matches List */
.match-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s, border-color 0.3s;
}
.match-card:hover {
    transform: translateY(-3px);
    background: rgba(0, 0, 0, 0.6);
    border-color: var(--primary);
}

.match-info {
    flex: 1;
}
.match-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 1.4rem;
    font-weight: 900;
    margin-bottom: 15px;
    font-family: 'Poppins', sans-serif;
}
.team {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 40%;
}
.team.home {
    justify-content: flex-end;
}
.team.away {
    justify-content: flex-start;
}
.vs {
    color: var(--accent);
    font-size: 1rem;
    background: #fff;
    padding: 3px 8px;
    border-radius: 5px;
}

/* Radio buttons for predictions */
.prediction-options {
    display: flex;
    justify-content: center;
    gap: 15px;
}
.prediction-options label {
    background: rgba(255,255,255,0.05);
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    font-size: 0.95rem;
    font-weight: 700;
}
.prediction-options input[type="radio"] {
    display: none;
}
.prediction-options input[type="radio"]:checked + label {
    background: var(--primary);
    color: #fff;
    border-color: var(--secondary);
    box-shadow: 0 0 15px rgba(65,0,245,0.6);
}
.prediction-options input[type="radio"]:disabled + label {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    overflow: hidden;
}
th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
th {
    background: var(--primary-dark);
    color: var(--secondary);
    font-weight: 800;
    text-transform: uppercase;
    font-family: 'Poppins', sans-serif;
}
tr:last-child td {
    border-bottom: none;
}
tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-error {
    background: rgba(255, 0, 77, 0.15);
    border: 1px solid var(--accent);
    color: #ff85a1;
}
.alert-success {
    background: rgba(0, 255, 135, 0.15);
    border: 1px solid var(--secondary);
    color: #a3ffb4;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
}
.badge.paid { background: var(--secondary); color: #000; }
.badge.unpaid { background: var(--accent); color: white; }
.badge.pending { background: #FFD700; color: black; }
.badge.submitted { background: var(--primary); color: white; }

.phase-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.6);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    border-left: 5px solid var(--secondary);
}
.phase-selector h2 {
    color: #fff;
    margin: 0;
}

/* Tab Transition Loader Overlay */
#tab-loader {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
#tab-loader.show {
    opacity: 1;
    pointer-events: all;
}
#tab-loader img {
    width: 200px;
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.8; }
    100% { transform: scale(1.1); opacity: 1; filter: drop-shadow(0 0 30px var(--secondary)); }
}

.swipe-indicator {
    display: none;
    font-size: 0.8rem;
    color: var(--secondary);
    text-align: right;
    margin-top: -10px;
    margin-bottom: 15px;
    font-weight: bold;
    animation: bounceX 2s infinite;
}

@keyframes bounceX {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

/* Responsive Design for Mobile Devices */
@media (max-width: 768px) {
    .swipe-indicator { display: block; }
    body {
        overflow-x: hidden;
        touch-action: pan-y pinch-zoom;
    }
    
    header { 
        flex-direction: column; 
        gap: 10px; 
        text-align: center; 
        padding: 1rem;
    }
    header h1 {
        font-size: 1.3rem;
        flex-direction: column;
        gap: 5px;
    }
    
    .nav-links, .auth-links { 
        display: flex; 
        flex-direction: column; 
        align-items: center; 
        gap: 10px; 
        width: 100%;
        margin-top: 5px;
        font-size: 0.9rem;
    }
    .nav-links a, .nav-links span, .auth-links a { margin-left: 0; }
    
    .container {
        margin: 1rem auto;
        padding: 0 10px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .glass-panel { 
        padding: 1.2rem; 
        border-radius: 15px;
    }
    
    .phase-selector {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 15px;
    }
    .phase-selector h2 {
        font-size: 1.2rem;
    }
    
    /* Allow tabs to scroll horizontally with touch */
    .tabs { 
        flex-wrap: nowrap; 
        overflow-x: auto; 
        -webkit-overflow-scrolling: touch; 
        padding-bottom: 10px; 
        justify-content: flex-start; 
    }
    .tab-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
    }
    
    /* Rules List */
    .tab-content ol, .tab-content ul {
        padding-left: 15px;
        font-size: 0.9rem;
        word-wrap: break-word;
    }
    .tab-content h3 {
        font-size: 1.1rem;
    }
    
    /* Match cards stacking */
    .match-card { flex-direction: column; gap: 15px; padding: 1rem; }
    .match-teams { flex-direction: column; font-size: 1.2rem; gap: 5px; }
    .team.home, .team.away { width: 100%; justify-content: center; text-align: center; }
    .vs { margin: 5px 0; font-size: 0.8rem; }
    
    .prediction-options { flex-direction: column; width: 100%; gap: 10px; }
    .prediction-options label { text-align: center; display: block; width: 100%; font-size: 0.85rem; padding: 12px; }
    
    /* Tables horizontal scroll */
    table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; font-size: 0.85rem; }
    th, td { padding: 10px; }
}
