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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

h1 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

h2 {
    color: #555;
    margin: 25px 0 15px;
}

/* Taula de ranking */
.ranking-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.ranking-table thead {
    background: #667eea;
    color: white;
}

.ranking-table th,
.ranking-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.ranking-table tbody tr:hover {
    background: #f5f5f5;
}

.ranking-table td:first-child {
    font-weight: bold;
    color: #667eea;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    color: #888;
    margin-top: 5px;
    font-size: 12px;
}

/* Botons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
    margin-right: 10px;
}

.btn:hover {
    background: #5a67d8;
}

.btn-success {
    background: #48bb78;
}

.btn-success:hover {
    background: #38a169;
}

.btn-danger {
    background: #f56565;
}

.btn-danger:hover {
    background: #e53e3e;
}

.btn-info {
    background: #4299e1;
}

.btn-info:hover {
    background: #3182ce;
}

/* Missatges */
.success {
    background: #c6f6d5;
    color: #22543d;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #48bb78;
}

.error {
    background: #fed7d7;
    color: #742a2a;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #f56565;
}

/* Estadístiques */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
}

/* Login */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 30px;
}

.login-form {
    margin-top: 20px;
}

/* Opcions de resultat */
.resultat-opcions {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    transition: all 0.3s;
}

.radio-option:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.radio-option input[type="radio"] {
    margin-right: 8px;
}

.radio-label {
    font-size: 16px;
}

/* Previsualització */
.previsualitzacio {
    margin: 20px 0;
    padding: 15px;
    background: #f0f4ff;
    border-radius: 5px;
    border-left: 4px solid #667eea;
}

.previsualitzacio h3 {
    color: #4a5568;
    font-size: 16px;
    margin-bottom: 10px;
}

.previsualitzacio p {
    line-height: 1.6;
}

/* Colors per valors positius/negatius */
.positive {
    color: #48bb78;
    font-weight: bold;
}

.negative {
    color: #f56565;
    font-weight: bold;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge.victory {
    background: #c6f6d5;
    color: #22543d;
}

.badge.draw {
    background: #e2e8f0;
    color: #4a5568;
}

/* Filtres */
.filtres {
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.filtres-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

/* Taula normal */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table th {
    background: #667eea;
    color: white;
    padding: 12px;
    text-align: left;
}

.table td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
}

.table tbody tr:hover {
    background: #f7fafc;
}

/* Admin actions */
.admin-actions {
    margin: 30px 0;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 15px;
}

/* Admin link */
.admin-link {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.admin-link a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
}

.admin-link a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    .ranking-table {
        font-size: 14px;
    }
    
    .ranking-table th,
    .ranking-table td {
        padding: 8px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
        text-align: center;
    }
    
    .filtres-form {
        grid-template-columns: 1fr;
    }
}

/* Estils per stats mini */
.stats-mini {
    background: #f7fafc;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #667eea;
}

.stats-mini p {
    margin: 5px 0;
    color: #4a5568;
}

.stats-mini strong {
    color: #2d3748;
    width: 120px;
    display: inline-block;
}
