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

body {
    font-family: 'Arial', 'Helvetica', sans-serif;
    background: #fafafa;
    color: #1a1a1a;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ========================================
   PAGE D'ACCUEIL / ACHAT
======================================== */

.page-home {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 30px rgba(0, 107, 63, 0.08);
}

.header {
    background: linear-gradient(135deg, #00A651 0%, #00C965 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 166, 81, 0.2);
}

.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.logo-circle {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.logo {
    max-width: 100%;
    height: auto;
}

.event-title {
    font-size: 28px;
    font-weight: bold;
    line-height: 1.2;
}

.event-title span {
    font-size: 16px;
    font-weight: normal;
}

.event-info {
    padding: 30px 20px;
}

/* Compte à rebours */
.countdown-section {
    background: linear-gradient(135deg, #F9B233 0%, #FFC857 100%);
    padding: 25px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(249, 178, 51, 0.3);
}

.countdown-label {
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    color: #1a1a1a;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.countdown-display {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.countdown-item {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    text-align: center;
    min-width: 80px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.countdown-number {
    display: block;
    font-size: 32px;
    font-weight: bold;
    color: #006B3F;
    line-height: 1;
}

.countdown-text {
    display: block;
    font-size: 11px;
    color: #666;
    margin-top: 5px;
    font-weight: bold;
}

.info-card {
    display: flex;
    gap: 15px;
    align-items: center;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #F9B233;
}

.info-card .icon {
    font-size: 32px;
}

.theme-section {
    background: #fff;
    border: 2px solid #006B3F;
    padding: 20px;
    border-radius: 8px;
}

.theme-section h2 {
    color: #006B3F;
    font-size: 18px;
    margin-bottom: 10px;
}

.theme-section p {
    font-size: 14px;
    line-height: 1.5;
}

.purchase-section {
    padding: 20px;
    background: #f8fcfa;
}

.purchase-section h2 {
    text-align: center;
    color: #006B3F;
    margin-bottom: 20px;
    font-size: 22px;
}

/* Formulaire */
.ticket-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,107,63,0.08);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #1a1a1a;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 14px;
    border: 2px solid #e8e8e8;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fafafa;
}

.form-group input:focus {
    outline: none;
    border-color: #00A651;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.1);
}

.price-display {
    background: linear-gradient(135deg, #F9B233 0%, #FFC857 100%);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 25px 0;
}

.price-label {
    display: block;
    font-size: 14px;
    font-weight: bold;
    color: #1a1a1a;
    margin-bottom: 5px;
}

.price-amount {
    display: block;
    font-size: 32px;
    font-weight: bold;
    color: #1a1a1a;
}

.btn-submit {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #00A651 0%, #00C965 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 166, 81, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 166, 81, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
}

.footer {
    background: #1a1a1a;
    color: white;
    padding: 30px 20px;
    text-align: center;
}

.footer p {
    margin: 5px 0;
}

.footer .website {
    color: #F9B233;
    margin-top: 10px;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c00;
}

.alert-warning {
    background: #fffbf0;
    border: 1px solid #ffe4a1;
    color: #856404;
}

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

/* ========================================
   PAGE PAIEMENT EN ATTENTE
======================================== */

.page-pending {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #006B3F 0%, #00A651 100%);
}

.pending-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    max-width: 500px;
}

.pending-container h1 {
    color: #006B3F;
    margin: 20px 0;
}

.ticket-info {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    margin-top: 20px;
}

/* ========================================
   PAGE SUCCÈS / TICKET
======================================== */

.page-success {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.success-header {
    text-align: center;
    padding: 30px;
}

.check-icon {
    width: 80px;
    height: 80px;
    background: #00A651;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin: 0 auto 20px;
}

.success-header h1 {
    color: #006B3F;
    margin-bottom: 10px;
}

.ticket-display {
    background: white;
    border: 3px solid #006B3F;
    border-radius: 10px;
    overflow: hidden;
    margin: 30px 0;
}

.ticket-header {
    background: linear-gradient(135deg, #006B3F 0%, #00A651 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.ticket-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
}

.ticket-body {
    padding: 30px;
}

.ticket-info .info-row {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
}

.ticket-info .label {
    font-weight: bold;
    color: #666;
}

.ticket-info .value {
    color: #1a1a1a;
}

.ticket-info .code {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    color: #006B3F;
}

.qr-code-section {
    text-align: center;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-top: 20px;
}

.qr-code {
    max-width: 250px;
    height: auto;
}

.qr-instruction {
    margin-top: 15px;
    color: #666;
    font-size: 14px;
}

.ticket-footer {
    background: #1a1a1a;
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin: 30px 0;
}

.btn-download,
.btn-print {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s;
}

.btn-download {
    background: #006B3F;
    color: white;
}

.btn-download:hover {
    background: #005030;
}

.btn-print {
    background: white;
    border: 2px solid #006B3F;
    color: #006B3F;
}

.btn-print:hover {
    background: #f0f0f0;
}

.info-box {
    background: #fffbf0;
    border-left: 4px solid #F9B233;
    padding: 20px;
    margin-top: 20px;
}

.info-box ul {
    margin: 10px 0 0 20px;
}

.info-box li {
    margin: 5px 0;
}

/* ========================================
   PAGE SCANNER
======================================== */

.page-scan {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.scan-header {
    text-align: center;
    padding: 30px 20px;
    background: white;
    border-radius: 10px;
    margin-bottom: 20px;
}

.scan-header h1 {
    color: #006B3F;
    margin-bottom: 10px;
}

.scan-result {
    margin: 20px 0;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.result-success {
    background: #d4edda;
    border: 2px solid #00A651;
}

.result-error {
    background: #fee;
    border: 2px solid #c00;
}

.result-icon {
    font-size: 64px;
    margin-bottom: 10px;
}

.result-success .result-icon {
    color: #00A651;
}

.result-error .result-icon {
    color: #c00;
}

.ticket-details {
    margin-top: 15px;
    background: white;
    padding: 15px;
    border-radius: 5px;
}

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

.tab {
    flex: 1;
    padding: 15px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.tab.active {
    background: #006B3F;
    color: white;
    border-color: #006B3F;
}

.tab-content {
    display: none;
    background: white;
    padding: 30px;
    border-radius: 10px;
}

.tab-content.active {
    display: block;
}

.scan-instruction {
    text-align: center;
    margin-top: 15px;
    color: #666;
}

.manual-form {
    max-width: 400px;
    margin: 0 auto;
}

.btn-verify {
    width: 100%;
    padding: 15px;
    background: #006B3F;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
}

.btn-verify:hover {
    background: #005030;
}

.scan-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.stat-item {
    background: white;
    padding: 20px 40px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stat-number {
    display: block;
    font-size: 36px;
    font-weight: bold;
    color: #006B3F;
}

.stat-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

/* ========================================
   ADMIN
======================================== */

.admin-body {
    background: #f5f5f5;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: #1a1a1a;
    color: white;
    padding: 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header h2 {
    color: #F9B233;
    margin-bottom: 30px;
    text-align: center;
}

.sidebar-nav {
    margin-bottom: 30px;
}

.nav-item {
    display: block;
    padding: 12px 15px;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin-bottom: 5px;
    transition: background 0.3s;
}

.nav-item:hover,
.nav-item.active {
    background: #333;
}

.logout-form {
    margin-top: auto;
}

.btn-logout {
    width: 100%;
    padding: 12px;
    background: #c00;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-logout:hover {
    background: #a00;
}

.admin-content {
    margin-left: 250px;
    flex: 1;
    padding: 30px;
}

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

.btn-export {
    padding: 10px 20px;
    background: #006B3F;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
}

.btn-export:hover {
    background: #005030;
}

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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-card .stat-icon {
    font-size: 36px;
}

.stat-card h3 {
    font-size: 28px;
    color: #006B3F;
    margin-bottom: 5px;
}

.stat-card p {
    color: #666;
    font-size: 14px;
}

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

.detail-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.detail-card h3 {
    margin-bottom: 15px;
    color: #006B3F;
}

.simple-table {
    width: 100%;
}

.simple-table tr {
    border-bottom: 1px solid #e0e0e0;
}

.simple-table td {
    padding: 10px 0;
}

.simple-table td:last-child {
    text-align: right;
}

.text-green {
    color: #00A651;
}

.data-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.data-table thead {
    background: #006B3F;
    color: white;
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: bold;
}

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

.data-table tbody tr:hover {
    background: #f9f9f9;
}

.data-table code {
    background: #f0f0f0;
    padding: 3px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-error {
    background: #fee;
    color: #c00;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-gray {
    background: #e0e0e0;
    color: #666;
}

.filters-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.filters-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

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

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: bold;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
}

.btn-filter,
.btn-reset {
    padding: 8px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    align-self: flex-end;
}

.btn-filter {
    background: #006B3F;
    color: white;
}

.btn-reset {
    background: #e0e0e0;
    color: #333;
    text-decoration: none;
    display: inline-block;
}

.table-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.results-count {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
}

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

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #006B3F 0%, #00A651 100%);
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.login-container h1 {
    color: #006B3F;
    margin-bottom: 10px;
}

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

.back-link {
    margin-top: 20px;
}

.back-link a {
    color: #006B3F;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }

    .admin-content {
        margin-left: 0;
    }

    .admin-layout {
        flex-direction: column;
    }

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

    .action-buttons {
        flex-direction: column;
    }
}
