/* ==========================================================================
   Polla Mundialista CSS System - Armadillo ERP Custom Branding Theme
   ========================================================================== */

/* --- CSS Variables & Tokens (Armadillo Yellow & Dark Mode) --- */
:root {
    --bg-dark: #121212;
    --bg-card: rgba(24, 24, 24, 0.65);
    --bg-card-hover: rgba(34, 34, 34, 0.85);
    --border-glass: rgba(255, 255, 255, 0.06);
    --border-focus: #FFDE00; /* Armadillo Yellow */
    
    --text-primary: #ffffff;
    --text-secondary: #a3a3a3;
    --text-muted: #525252;
    
    --color-primary: #FFDE00; /* Armadillo Yellow */
    --color-accent: #FFDE00;  /* Armadillo Yellow */
    --color-success: #10b981; /* Green */
    --color-warning: #fbbf24; /* Amber */
    --color-danger: #ef4444;  /* Red */
    
    --grad-primary: linear-gradient(135deg, #FFDE00 0%, #e6c800 100%);
    --grad-accent: linear-gradient(135deg, #FFDE00 0%, #e6c800 100%);
    --grad-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --grad-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    
    --font-sans: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

/* --- Base & Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at 50% 0%, #262626 0%, #121212 100%);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
}

/* --- Container --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- Navbar --- */
.navbar {
    background: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1.25rem 0;
}

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

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 900;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
}

.navbar-brand span {
    color: var(--color-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-link:hover {
    color: var(--color-primary);
}

.nav-link.active {
    color: var(--color-primary);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    gap: 0.5rem;
}

.btn-primary {
    background: var(--grad-primary);
    color: #000000;
    box-shadow: 0 4px 14px rgba(255, 222, 0, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 222, 0, 0.45);
    background: #e6c800;
}

.btn-accent {
    background: var(--grad-accent);
    color: #000000;
    box-shadow: 0 4px 14px rgba(255, 222, 0, 0.2);
}

.btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 222, 0, 0.45);
    background: #e6c800;
}

.btn-glass {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    color: var(--color-primary);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.btn-danger:hover {
    background: var(--color-danger);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

/* --- Cards / Panels (Armadillo style) --- */
.panel {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-top: 3px solid var(--color-primary); /* Armadillo primary yellow top border style */
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    transition: var(--transition);
}

.panel:hover {
    border-color: rgba(255, 222, 0, 0.15);
    border-top-color: var(--color-primary);
}

/* --- Auth Page Layout --- */
.auth-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
}

.auth-card {
    width: 100%;
    max-width: 450px;
}

.auth-title {
    font-size: 2.25rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-subtitle {
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* --- Form Controls --- */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.form-control {
    width: 100%;
    background: rgba(18, 18, 18, 0.85);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 10px rgba(255, 222, 0, 0.15);
}

/* --- Ranking & Podium --- */
.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1.5rem;
    margin: 3rem 0;
    padding-top: 2rem;
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 200px;
    position: relative;
}

.podium-user {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.podium-medal {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--bg-dark);
    margin-bottom: 1rem;
    box-shadow: 0 0 20px rgba(255,255,255,0.05);
}

.podium-gold .podium-medal {
    background: linear-gradient(135deg, #ffe066 0%, #f5a623 100%);
    box-shadow: 0 0 25px rgba(245, 166, 35, 0.4);
}
.podium-silver .podium-medal {
    background: linear-gradient(135deg, #e2e8f0 0%, #94a3b8 100%);
    box-shadow: 0 0 20px rgba(148, 163, 184, 0.3);
}
.podium-bronze .podium-medal {
    background: linear-gradient(135deg, #fbcfe8 0%, #db2777 100%);
    box-shadow: 0 0 20px rgba(219, 39, 119, 0.3);
}

.podium-name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.podium-points {
    color: var(--color-primary);
    font-weight: 900;
    font-size: 1.35rem;
}

.podium-bar {
    width: 100%;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.8);
    font-size: 2rem;
}

.podium-gold .podium-bar {
    height: 160px;
    background: linear-gradient(to top, rgba(255, 222, 0, 0.05), rgba(255, 222, 0, 0.3));
    border-top: 3px solid var(--color-primary);
}
.podium-silver .podium-bar {
    height: 120px;
    background: linear-gradient(to top, rgba(148, 163, 184, 0.05), rgba(148, 163, 184, 0.3));
    border-top: 3px solid #94a3b8;
}
.podium-bronze .podium-bar {
    height: 80px;
    background: linear-gradient(to top, rgba(219, 39, 119, 0.05), rgba(219, 39, 119, 0.3));
    border-top: 3px solid #db2777;
}

/* --- Ranking Table --- */
.ranking-table-container {
    overflow-x: auto;
    margin-top: 2rem;
}

.ranking-table {
    width: 100%;
    min-width: 700px; /* Prevent columns from squishing on mobile */
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem; /* AdminLTE style */
}

.ranking-table th {
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-glass);
}

.ranking-table td {
    padding: 0.75rem 1.5rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-glass);
}

.ranking-row {
    transition: var(--transition);
}

.ranking-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.ranking-pos {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-secondary);
    width: 50px;
}

.ranking-pos-medal {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--bg-dark);
}

.ranking-pos-1 {
    background: #f5a623;
}
.ranking-pos-2 {
    background: #94a3b8;
}
.ranking-pos-3 {
    background: #db2777;
}

.ranking-user-name {
    font-weight: 600;
    font-size: 1rem;
}

.ranking-points-col {
    font-weight: 900;
    font-size: 1.15rem;
    color: var(--color-primary);
}

/* --- Dashboard User Info Header --- */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--grad-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 900;
    color: #000000;
    text-transform: uppercase;
}

.user-meta h1 {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--color-primary);
    text-transform: uppercase;
}

.user-meta p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
    width: 100%;
    max-width: 600px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    padding: 1rem;
    border-radius: var(--radius-sm);
    text-align: center;
}

.stat-val {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--color-primary);
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* --- Match Prediction Grid & Cards --- */
.section-title {
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    color: var(--color-primary);
}

.section-title span {
    width: 6px;
    height: 22px;
    background: var(--color-primary);
    display: inline-block;
}

.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.match-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
}

.match-card:hover {
    border-color: rgba(255, 222, 0, 0.2);
    background: var(--bg-card-hover);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 0.5rem;
}

.match-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.match-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.match-badge-pending {
    background: rgba(255, 222, 0, 0.15);
    color: var(--color-primary);
}

.match-badge-finished {
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-secondary);
}

.match-vs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem 0;
}

.team-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

.team-name {
    font-weight: 700;
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vs-divider {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
}

.match-result-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 900;
    font-size: 1.25rem;
}

/* Prediction Inputs */
.prediction-form {
    margin-top: 1rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.prediction-inputs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.score-input {
    width: 50px;
    height: 40px;
    text-align: center;
    background: rgba(18, 18, 18, 0.9);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
}

.score-input:focus {
    outline: none;
    border-color: var(--border-focus);
}

.prediction-summary {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    text-align: center;
    font-size: 0.85rem;
}

.prediction-summary span {
    font-weight: 800;
    font-size: 1rem;
}

.points-pill {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 700;
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

.points-pill-3 {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}
.points-pill-1 {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}
.points-pill-0 {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

/* --- Alerts & Notifications --- */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

@keyframes slideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* --- Footer --- */
footer {
    margin-top: auto;
    padding: 2rem 0;
    border-top: 1px solid var(--border-glass);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .navbar .nav-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .nav-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }
    .podium-container {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }
    .podium-item {
        max-width: 100%;
        width: 100%;
    }
    .podium-gold {
        order: 1;
    }
    .podium-silver {
        order: 2;
    }
    .podium-bronze {
        order: 3;
    }
    .podium-bar {
        display: none;
    }
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }
    .user-profile {
        justify-content: center;
        text-align: center;
        flex-direction: column;
    }
}
