/* ==================== VARIABLES ==================== */
:root {
    --primary: #1dd1a1;
    --primary-dark: #10ac84;
    --secondary: #0984e3;
    --danger: #d63031;
    --warning: #fdcb6e;
    --success: #00b894;
    --dark: #2d3436;
    --light: #dfe6e9;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow: 0 10px 30px rgba(0,0,0,0.2);
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.1);
    --radius: 20px;
    --radius-sm: 10px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--dark);
    overflow-x: hidden;
}

/* ==================== SCREENS ==================== */
.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ==================== AUTH SCREEN ==================== */
.auth-container {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
    max-width: 450px;
    width: 100%;
    animation: fadeInUp 0.5s ease;
}

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

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-size: 2.5em;
    color: var(--primary);
    margin-bottom: 10px;
}

.tagline {
    color: var(--dark);
    font-size: 1em;
    margin-bottom: 5px;
}

.tech-tag {
    font-size: 0.8em;
    color: #636e72;
    font-weight: 300;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: var(--light);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1em;
    font-weight: 600;
    color: var(--dark);
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

.tab-btn:hover:not(.active) {
    background: #b2bec3;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--light);
    border-radius: var(--radius-sm);
    font-size: 1em;
    font-family: 'Poppins', sans-serif;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.color-picker {
    display: flex;
    align-items: center;
}

.color-picker input[type="color"] {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

/* ==================== BUTTONS ==================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1em;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(29, 209, 161, 0.3);
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-large {
    padding: 18px 40px;
    font-size: 1.3em;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn-outline {
    background: transparent;
    border: 2px solid white;
    color: white;
}

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

/* ==================== DASHBOARD SCREEN ==================== */
#dashboardScreen.active {
    display: block;
    padding: 0;
}

.navbar {
    background: white;
    box-shadow: var(--shadow-sm);
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.nav-brand h2 {
    font-size: 1.8em;
    color: var(--primary);
}

.nav-menu {
    display: flex;
    gap: 10px;
}

.nav-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--dark);
}

.nav-btn.active,
.nav-btn:hover {
    background: var(--primary);
    color: white;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.balance {
    background: var(--success);
    color: white;
    padding: 8px 15px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

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

/* ==================== DASHBOARD CONTAINER ==================== */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ==================== HOME PAGE ==================== */
.welcome-section {
    text-align: center;
    margin-bottom: 40px;
}

.welcome-section h1 {
    font-size: 2.5em;
    color: white;
    margin-bottom: 10px;
}

.welcome-section .subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 1.1em;
}

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

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

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

.stat-value {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.stat-label {
    color: #636e72;
    font-weight: 600;
}

.action-section {
    text-align: center;
    margin-bottom: 40px;
}

.top-players-section {
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow-sm);
}

.top-players-section h2 {
    margin-bottom: 20px;
    color: var(--dark);
}

.top-players-list {
    display: grid;
    gap: 15px;
}

.player-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: var(--light);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.player-item:hover {
    background: #b2bec3;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.player-name {
    font-weight: 600;
}

.player-stats {
    display: flex;
    gap: 20px;
    color: #636e72;
    font-size: 0.9em;
}

/* ==================== GAME CONTAINER ==================== */
#gameContainer {
    margin: 20px auto;
    display: flex;
    justify-content: center;
}

.game-status {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    font-size: 1.2em;
    font-weight: 600;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
    margin: 20px auto;
    max-width: 600px;
}

/* ==================== STANDINGS PAGE ==================== */
.standings-table {
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

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

.standings-table th,
.standings-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--light);
}

.standings-table th {
    font-weight: 700;
    color: var(--primary);
}

.standings-table tr:hover {
    background: var(--light);
}

/* ==================== PROFILE PAGE ==================== */
.profile-content {
    max-width: 800px;
    margin: 0 auto;
}

.profile-card {
    background: white;
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-sm);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--light);
}

.jersey-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
}

.profile-info h2 {
    font-size: 2em;
    color: var(--dark);
    margin-bottom: 5px;
}

.profile-info p {
    color: #636e72;
}

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

.profile-stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.profile-stat .label {
    color: #636e72;
    font-size: 0.9em;
}

.profile-stat .value {
    font-size: 2em;
    font-weight: 700;
    color: var(--primary);
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    min-width: 300px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }

/* ==================== LOADING ==================== */
.loading {
    text-align: center;
    padding: 40px;
    color: #636e72;
    font-size: 1.1em;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-menu {
        flex-wrap: wrap;
    }

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

    .profile-header {
        flex-direction: column;
        text-align: center;
    }
}
