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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    padding: 20px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

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

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

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group select,
.form-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    background-color: white;
    cursor: pointer;
}

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

.help-text {
    display: block;
    margin-top: 8px;
    color: #888;
    font-size: 0.9em;
}

#urlPreview {
    color: #2c3e50;
    font-weight: 500;
}

.btn-primary {
    width: 100%;
    padding: 14px 20px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary:hover {
    background: #34495e;
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.loader {
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.results {
    animation: slideIn 0.3s ease-out;
}

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

.results h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.results-header h2 {
    margin: 0;
    padding: 0;
    border: none;
}

.btn-export {
    padding: 10px 20px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.metric-item {
    background: #f8f9fa;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.metric-name {
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.metric-type {
    display: inline-block;
    padding: 3px 8px;
    background: #667eea;
    color: white;
    border-radius: 4px;
    font-size: 0.8em;
    margin-bottom: 8px;
}

.metric-doc {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 10px;
}

.metric-samples {
    margin-top: 10px;
}

.sample-item {
    background: white;
    padding: 8px 12px;
    margin-top: 5px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.sample-value {
    color: #e91e63;
    font-weight: 600;
}

.error-message {
    background: #fff3cd;
    border: 2px solid #ffc107;
    color: #856404;
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 20px;
    animation: slideIn 0.3s ease-out;
}

.info-box {
    background: #f8f9fa;
    border-left: 4px solid #2c3e50;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

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

.stat-card {
    background: #2c3e50;
    color: white;
    padding: 20px;
    border-radius: 6px;
    text-align: center;
}

.stat-card.success {
    background: #27ae60;
}

.stat-card.error {
    background: #e74c3c;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
}

/* Styles pour les checks SUCCESS/ECHEC */
.checks-container {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

.check-card {
    background: white;
    padding: 20px;
    border-radius: 6px;
    border-left: 5px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.check-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.check-card.success {
    border-left-color: #27ae60;
    background: white;
}

.check-card.failed {
    border-left-color: #e74c3c;
    background: white;
}

.check-category {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.check-status-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.95em;
}

.check-status-display.success {
    background: #27ae60;
    color: white;
}

.check-status-display.failed {
    background: #e74c3c;
    color: white;
}

.check-icon {
    font-size: 1.2em;
}

.check-status-text {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.modal-content {
    background-color: #ffffff;
    margin: auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    padding: 30px;
    border-radius: 16px 16px 0 0;
    text-align: center;
    color: white;
}

.modal-icon {
    display: inline-block;
    width: 80px;
    height: 80px;
    background-color: white;
    color: #27ae60;
    border-radius: 50%;
    font-size: 48px;
    line-height: 80px;
    font-weight: bold;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 600;
}

.modal-body {
    padding: 30px;
    text-align: center;
    color: #555;
}

.modal-body p {
    font-size: 1.1em;
    line-height: 1.6;
    margin: 0;
}

.modal-footer {
    padding: 20px 30px 30px;
    text-align: center;
}

.btn-modal-export {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 14px 40px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-modal-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
}

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

.btn-modal-cancel {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 14px 40px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-modal-cancel:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
    background-color: #5a6268;
}

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

/* QR Code Scanner Styles */
.scanner-header {
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px 10px 0 0;
    margin: -20px -20px 20px -20px;
}

.scanner-header h2 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
}

.scan-mode-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 15px;
}

.mode-btn {
    flex: 1;
    padding: 12px 20px;
    background: #f5f5f5;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.mode-btn:hover {
    background: #e0e0e0;
}

.mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.mode-content {
    display: none;
}

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

.scanner-info {
    text-align: center;
    padding: 30px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 20px;
}

.scanner-icon {
    font-size: 4em;
    margin-bottom: 15px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.scanner-info p {
    margin: 10px 0;
    font-size: 1.1em;
    color: #555;
}

.scanner-hint {
    font-size: 0.9em !important;
    color: #888 !important;
    font-style: italic;
}

.camera-instructions {
    margin-top: 20px;
    padding: 15px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    text-align: left;
}

.instruction-title {
    font-weight: 600;
    color: #856404;
    margin-bottom: 10px;
    text-align: center;
}

.instruction-list {
    list-style: none;
    padding: 0;
    margin: 0;
    color: #856404;
}

.instruction-list li {
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
}

.instruction-list li:before {
    content: "→";
    position: absolute;
    left: 0;
    font-weight: bold;
}

.qr-input {
    width: 1px;
    height: 1px;
    padding: 0;
    border: none;
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.scan-status {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 1em;
    line-height: 1.5;
    display: none;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.scan-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.scan-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
    text-align: left;
    line-height: 1.8;
}

.scan-status.error strong {
    display: block;
    font-size: 1.1em;
    margin-bottom: 10px;
    text-align: center;
}

.scan-status.error u {
    font-weight: 600;
    text-decoration: none;
    color: #5a1a1f;
}

.scan-status.processing {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

/* Checking Loader Styles */
.checking-loader {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-top: 20px;
}

.loader-spinner {
    border: 5px solid rgba(102, 126, 234, 0.2);
    border-top: 5px solid #667eea;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.checking-loader p {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
    color: #667eea;
}

/* QR Code Reader (Camera) Styles */
.qr-reader {
    display: none;
    margin: 20px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#qr-reader {
    width: 100%;
    border-radius: 12px;
}

#qr-reader video {
    width: 100%;
    border-radius: 12px;
    display: block;
}

#qr-reader__dashboard {
    background: #f8f9fa !important;
    padding: 10px !important;
    border-radius: 0 0 12px 12px !important;
}

#qr-reader__dashboard_section {
    text-align: center;
}

#qr-reader__dashboard_section_swaplink {
    color: #667eea !important;
    text-decoration: none;
    font-weight: 600;
}

#qr-reader__scan_region {
    border-radius: 12px !important;
}

.btn-scan {
    width: 100%;
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-scan:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

.scan-status.info {
    background: #e3f2fd;
    color: #0d47a1;
    border: 1px solid #90caf9;
    display: block;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    .card {
        padding: 20px;
    }

    .scanner-header {
        margin: -20px -20px 15px -20px;
    }

    .scanner-header h2 {
        font-size: 1.2em;
    }

    .check-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .check-status-display {
        width: 100%;
        justify-content: center;
    }
}
