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

body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #333;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Canvas pour les particules */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Cartes */
.card {
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15) !important;
}

.card-header {
    border-bottom: none;
    border-radius: 16px 16px 0 0 !important;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
}

.bg-gradient-success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
}

/* Zone de dépôt de fichier */
.file-drop-area {
    background-color: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    min-height: 300px;
    overflow: hidden;
}

.file-drop-area:hover {
    border-color: #4f46e5;
    background-color: #f1f5f9;
    transform: scale(1.01);
}

.file-drop-area.is-dragover {
    border-color: #10b981;
    background-color: rgba(16, 185, 129, 0.05);
    transform: scale(1.02);
}

.file-input-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: none;
    display: block;
    border-radius: 8px;
    transition: opacity 0.3s ease;
}

.file-drop-area-text {
    text-align: center;
    position: absolute;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #475569;
    transition: all 0.3s ease;
    z-index: 2;
}

.file-drop-area-footer {
    position: absolute;
    bottom: 1rem;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 2;
}

/* Indicateur de chargement */
.preview-loading-indicator {
    position: absolute;
    display: none;
    z-index: 3;
}

.file-drop-area.preview-loading .preview-loading-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
}

.file-drop-area.preview-loading .file-drop-area-text,
.file-drop-area.preview-loading .file-drop-area-footer {
    opacity: 0.3;
}

.file-drop-area.preview-loaded .file-input-preview {
    opacity: 1;
}

.file-drop-area.preview-loaded .file-drop-area-text {
    background-color: rgba(15, 23, 42, 0.7);
    border-radius: 10px;
    color: #f8fafc;
    backdrop-filter: blur(4px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    opacity: 0.7;
}

.file-drop-area.preview-loaded:hover .file-drop-area-text {
    opacity: 1;
    background-color: rgba(15, 23, 42, 0.85);
}

/* Zone de texte Base64 */
.base64-output {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background-color: #f8fafc;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.base64-output:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 0.25rem rgba(79, 70, 229, 0.25);
    background-color: #ffffff;
}

/* Zone d'aperçu Base64 */
.base64-preview-container {
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    background-color: #f8fafc;
    transition: all 0.3s ease;
}

.base64-preview-container:hover {
    border-color: #cbd5e1;
}

/* Boutons */
.btn {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    padding: 0.5rem 1.25rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

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

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border: none;
}

.btn-outline-primary {
    border-color: #4f46e5;
    color: #4f46e5;
}

.btn-outline-primary:hover {
    background-color: #4f46e5;
    border-color: #4f46e5;
}

/* Groupe de boutons radio */
.btn-group .btn-check:checked + .btn {
    background-color: #4f46e5;
    border-color: #4f46e5;
    color: white;
}

/* Messages d'erreur */
#image-url-errors:not(:empty) {
    margin-top: 1rem;
}

.alert {
    border-radius: 10px;
    border: none;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Texte */
.text-light {
    color: #f1f5f9 !important;
}

.text-light-soft {
    color: #cbd5e1 !important;
}

/* Badge */
.badge {
    border-radius: 50px;
    font-weight: 600;
}

/* Footer */
footer a:hover {
    color: #a5b4fc !important;
}

/* Responsive */
@media (max-width: 768px) {
    .file-drop-area {
        min-height: 250px;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .btn-group {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .btn {
        margin-bottom: 0.5rem;
    }
}

/* Animation de chargement */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.spinner-border {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}