/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #212529;
    font-size: 18px;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 600px;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Flash messages */
.flash-messages {
    margin-bottom: 20px;
}

.flash {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 10px;
    font-weight: 500;
    text-align: center;
}

.flash-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flash-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Typography */
h1 {
    font-size: 32px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
}

h2 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

/* Scan page */
.scan-page {
    text-align: center;
}

.user-info {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
}

.scan-count {
    font-size: 20px;
    margin-top: 10px;
}

.scan-count strong {
    color: #667eea;
    font-size: 28px;
}

.welcome-message {
    margin-bottom: 25px;
    color: #555;
}

/* Forms */
.scan-form,
.name-form,
.reset-form {
    margin-bottom: 20px;
}

.input-large {
    width: 100%;
    padding: 18px 20px;
    font-size: 20px;
    border: 2px solid #ddd;
    border-radius: 12px;
    margin-bottom: 15px;
    transition: border-color 0.3s ease;
}

.input-large:focus {
    outline: none;
    border-color: #667eea;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 50px;
}

.btn-large {
    width: 100%;
    padding: 20px;
    font-size: 22px;
    min-height: 60px;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.button-group .btn {
    flex: 1;
    min-width: 150px;
}

/* Links */
.admin-link,
.back-link {
    margin-top: 30px;
    text-align: center;
}

.link,
.link-admin {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.link:hover,
.link-admin:hover {
    color: #5568d3;
    text-decoration: underline;
}

/* Tables */
.stats-table-container,
.history-table-container {
    overflow-x: auto;
    margin-bottom: 30px;
}

.stats-table,
.history-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.stats-table thead,
.history-table thead {
    background-color: #667eea;
    color: white;
}

.stats-table th,
.history-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 16px;
}

.stats-table td,
.history-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
}

.stats-table tbody tr:hover,
.history-table tbody tr:hover {
    background-color: #f8f9fa;
}

.stats-table td.number {
    font-weight: 600;
    color: #667eea;
    font-size: 20px;
}

.stats-table td.timestamp,
.history-table td.timestamp {
    font-size: 14px;
    color: #6c757d;
}

.no-data {
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
    font-style: italic;
}

/* Admin page */
.admin-page {
    text-align: center;
}

.admin-actions {
    margin-top: 30px;
}

.admin-actions h2 {
    font-size: 20px;
    margin-bottom: 15px;
}

/* History page */
.history-page {
    text-align: center;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.page-info {
    font-weight: 600;
    color: #667eea;
}

/* Responsive design */
@media (max-width: 480px) {
    body {
        padding: 10px;
        font-size: 16px;
    }

    .container {
        padding: 20px;
    }

    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 20px;
    }

    .btn {
        font-size: 16px;
        padding: 10px 20px;
    }

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

    .stats-table th,
    .history-table th,
    .stats-table td,
    .history-table td {
        padding: 10px;
        font-size: 14px;
    }

    .button-group {
        flex-direction: column;
    }

    .button-group .btn {
        width: 100%;
    }
}

@media (min-width: 768px) {
    .container {
        padding: 40px;
    }
}

/* Predictions Game Styles */

/* Bouton prédictions sur la page de scan */
.predictions-link-container {
    margin: 20px 0;
}

/* Page des prédictions */
.predictions-page {
    text-align: left;
}
.new-predictions {
    outline-style: solid;
    outline-color: red;
}

.existing-predictions,
.new-predictions {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
}

/* Carte de prédiction avec barre */
.prediction-card {
    background: white;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.prediction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.target-name {
    font-weight: 600;
    font-size: 18px;
    color: #333;
}

.prediction-stats {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
}

/* Barre de progression */
.progress-bar-container {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
    max-width: 100%;
}

.prediction-info {
    font-size: 14px;
    color: #6c757d;
}

/* Formulaire de nouvelles prédictions */
.prediction-form-item {
    margin-bottom: 20px;
}

.prediction-form-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.current-count {
    font-weight: 400;
    color: #6c757d;
    font-size: 14px;
}

.prediction-input {
    width: 100%;
    padding: 12px;
    font-size: 18px;
    border: 2px solid #ddd;
    border-radius: 10px;
    transition: border-color 0.3s ease;
}

.prediction-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Classement */
.leaderboard-page {
    text-align: center;
}

.leaderboard-table {
    margin: 20px auto;
}

.leaderboard-table .rank {
    font-size: 24px;
    text-align: center;
}

.leaderboard-table .rank-1 {
    background: linear-gradient(90deg, #fff9e6, transparent);
}

.leaderboard-table .rank-2 {
    background: linear-gradient(90deg, #f5f5f5, transparent);
}

.leaderboard-table .rank-3 {
    background: linear-gradient(90deg, #fff5e6, transparent);
}

.leaderboard-link {
    margin-top: 20px;
    text-align: center;
}

/* Player link in leaderboard */
.player-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.player-link:hover {
    color: #5568d3;
    text-decoration: underline;
}

/* Info message */
.info-message {
    background: #d1ecf1;
    color: #0c5460;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #0c5460;
}

/* Admin adjustment buttons */
.actions-cell {
    text-align: center;
}

.btn-adjust {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 3px;
}

.btn-plus {
    background-color: #28a745;
    color: white;
}

.btn-plus:hover {
    background-color: #218838;
    transform: scale(1.1);
}

.btn-minus {
    background-color: #dc3545;
    color: white;
}

.btn-minus:hover {
    background-color: #c82333;
    transform: scale(1.1);
}

.btn-adjust:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-adjust:disabled:hover {
    transform: none;
}

.btn-reset-pin {
    background-color: #ffc107;
    color: #333;
}

.btn-reset-pin:hover {
    background-color: #e0a800;
    transform: scale(1.1);
}

/* Admin login page */
.admin-login-page {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
}

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

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: left;
}

/* Admin footer */
.admin-footer {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.link-logout {
    color: #dc3545;
}

.link-logout:hover {
    color: #c82333;
}

/* Responsive pour prédictions */
@media (max-width: 480px) {
    .prediction-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .prediction-stats {
        margin-top: 5px;
    }

    .admin-footer {
        flex-direction: column;
        gap: 15px;
    }
}
