/* Reset et 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;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* En-tête */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Zone de drag-and-drop */
.drop-zone {
    background: white;
    border: 3px dashed #ccc;
    border-radius: 20px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.drop-zone:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.1);
}

.drop-zone.drag-over {
    border-color: #28a745;
    background: #f0fff4;
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.2);
}

.drop-content {
    position: relative;
    z-index: 2;
}

.drop-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
}

.drop-zone h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #333;
}

.drop-zone p {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #666;
}

.browse-text {
    color: #667eea;
    text-decoration: underline;
    font-weight: 600;
}

.drop-zone small {
    color: #999;
    font-size: 0.9rem;
}

/* Messages de statut */
.status-message {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s ease;
}

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

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

.status-message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Loader/Spinner */
.loader {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loader p {
    font-size: 1.1rem;
    color: #666;
    margin: 0;
}

/* Section résultat QR */
.result-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    text-align: center;
}

.result-section h3 {
    color: #28a745;
    margin-bottom: 25px;
    font-size: 1.5rem;
}

.qr-container {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.qr-container canvas,
.qr-container img {
    max-width: 256px;
    height: auto;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    padding: 10px;
}

.result-info {
    text-align: left;
}

.result-info p {
    margin-bottom: 10px;
    font-size: 1rem;
}

.result-info strong {
    color: #333;
}

.result-info a {
    color: #667eea;
    text-decoration: none;
    word-break: break-all;
}

.result-info a:hover {
    text-decoration: underline;
}

.result-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Boutons */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-align: center;
    min-width: 120px;
    justify-content: center;
}

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

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

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

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

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

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

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
    min-width: auto;
}

/* Debug panel */
.debug-panel {
    background: rgba(0, 0, 0, 0.9);
    color: #00ff00;
    font-family: 'Courier New', monospace;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.debug-panel h4 {
    color: #ffff00;
    margin-bottom: 15px;
}

#debugLog {
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: pre-wrap;
    margin-bottom: 15px;
}

.debug-actions {
    display: flex;
    gap: 10px;
}

.debug-actions .btn {
    background: #333;
    color: #00ff00;
    border: 1px solid #00ff00;
    font-size: 0.8rem;
    padding: 6px 12px;
}

.debug-actions .btn:hover {
    background: #00ff00;
    color: #000;
}

/* Classes utilitaires */
.hidden {
    display: none !important;
}

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

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

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

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .drop-zone {
        padding: 40px 15px;
    }
    
    .drop-zone h2 {
        font-size: 1.5rem;
    }
    
    .result-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .drop-icon {
        font-size: 3rem;
    }
    
    .drop-zone h2 {
        font-size: 1.3rem;
    }
}