/* ============================================
   GameApp - Styles CSS
   ============================================ */

:root {
    --primary: #4CAF50;
    --secondary: #2196F3;
    --success: #4CAF50;
    --warning: #FF9800;
    --danger: #F44336;
    --dark: #333;
    --light: #f5f5f5;
    --white: #fff;
    --border: #ddd;
    --shadow: rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--light);
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px var(--shadow);
}

.login-card h1 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 2em;
}

.tagline {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer a {
    color: var(--secondary);
    text-decoration: none;
}

/* ============================================
   LAYOUT
   ============================================ */

.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px var(--shadow);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.nav-brand a {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
}

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

.user-points {
    font-weight: bold;
    color: var(--success);
}

.user-rank {
    padding: 5px 12px;
    border-radius: 20px;
    color: var(--white);
    font-weight: bold;
    font-size: 0.9em;
}

.user-name {
    color: var(--dark);
}

.notif-badge {
    position: relative;
    text-decoration: none;
    font-size: 1.2em;
}

.notif-badge .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: var(--white);
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.7em;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 70px;
    bottom: 0;
    width: 250px;
    background: var(--white);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 20px 0;
}

.nav-menu {
    list-style: none;
}

.nav-menu li {
    margin-bottom: 5px;
}

.nav-menu a {
    display: block;
    padding: 12px 20px;
    color: var(--dark);
    text-decoration: none;
    transition: all 0.3s;
}

.nav-menu a:hover {
    background: var(--light);
    border-left: 3px solid var(--primary);
    padding-left: 17px;
}

.nav-menu a.active {
    background: var(--light);
    border-left: 3px solid var(--primary);
    padding-left: 17px;
    color: var(--primary);
    font-weight: bold;
}

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 15px 20px;
}

.nav-section {
    padding: 10px 20px;
    color: #999;
    font-size: 0.85em;
    font-weight: bold;
    text-transform: uppercase;
}

.main-content {
    margin-left: 250px;
    padding: 30px;
    min-height: calc(100vh - 120px);
}

.footer {
    text-align: center;
    padding: 20px;
    background: var(--white);
    border-top: 1px solid var(--border);
    margin-left: 250px;
    color: #666;
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1em;
    transition: border 0.3s;
}

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

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    background: #45a049;
}

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

.btn-secondary:hover {
    background: #1976D2;
}

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

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

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

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

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

.btn-link {
    background: none;
    color: var(--primary);
    padding: 0;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: var(--white);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow);
    margin-bottom: 20px;
}

.card h2 {
    margin-bottom: 15px;
    color: var(--dark);
    font-size: 1.3em;
}

.card-full {
    grid-column: 1 / -1;
}

/* ============================================
   DASHBOARD
   ============================================ */

.dashboard h1 {
    margin-bottom: 30px;
    color: var(--dark);
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: var(--light);
    border-radius: 8px;
}

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

.stat-label {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

/* ============================================
   LEADERBOARD
   ============================================ */

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border);
    gap: 15px;
}

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

.leaderboard-item.current-user {
    background: #f0f8ff;
    font-weight: bold;
}

.leaderboard-item .rank {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary);
    min-width: 40px;
}

.leaderboard-item .username {
    flex: 1;
}

.leaderboard-item .points {
    color: var(--success);
    font-weight: bold;
}

.leaderboard-item .badge {
    padding: 5px 12px;
    border-radius: 20px;
    color: var(--white);
    font-weight: bold;
    font-size: 0.9em;
}

/* ============================================
   ACTIONS
   ============================================ */

.actions-list {
    max-height: 500px;
    overflow-y: auto;
}

.action-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border);
    gap: 15px;
}

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

.action-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--white);
}

.action-icon.success {
    background: var(--success);
}

.action-icon.warning {
    background: var(--warning);
}

.action-icon.danger {
    background: var(--danger);
}

.action-details {
    flex: 1;
}

.action-user {
    font-weight: bold;
}

.action-name {
    color: #666;
}

.action-time {
    font-size: 0.85em;
    color: #999;
}

.action-points {
    font-size: 1.2em;
    font-weight: bold;
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.action-status .badge {
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    color: var(--white);
}

.badge-pending {
    background: var(--warning);
}

.badge-validated {
    background: var(--success);
}

.badge-rejected {
    background: var(--danger);
}

.badge-contested {
    background: #9C27B0;
}

.badge-auto_validated {
    background: var(--secondary);
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.alert-warning {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

/* ============================================
   UTILITIES
   ============================================ */

.text-muted {
    color: #999;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content,
    .footer {
        margin-left: 0;
    }
    
    .nav-user {
        font-size: 0.9em;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
