/* Styles personnalisés pour CompressIO */

/* Variables CSS */
:root {
    --primary-bg: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #000000 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glossy-gradient: linear-gradient(145deg, #ffffff, #e0e0e0);
    --shadow-light: rgba(255, 255, 255, 0.3);
    --shadow-dark: rgba(0, 0, 0, 0.3);
}

/* Background principal */
body {
    background: var(--primary-bg);
    background-attachment: fixed;
}

/* Effet de verre */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Boutons glossy */
.glossy-button {
    background: var(--glossy-gradient);
    box-shadow: 
        inset 2px 2px 5px var(--shadow-light),
        inset -2px -2px 5px rgba(0, 0, 0, 0.1),
        2px 2px 10px var(--shadow-dark);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.glossy-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.glossy-button:hover {
    transform: translateY(-1px);
    box-shadow: 
        inset 1px 1px 3px rgba(255, 255, 255, 0.4),
        inset -1px -1px 3px rgba(0, 0, 0, 0.2),
        4px 4px 15px rgba(0, 0, 0, 0.4);
}

.glossy-button:hover::before {
    left: 100%;
}

.glossy-button:active {
    transform: translateY(1px);
    box-shadow: 
        inset 3px 3px 8px rgba(0, 0, 0, 0.2),
        inset -1px -1px 3px rgba(255, 255, 255, 0.1),
        1px 1px 5px rgba(0, 0, 0, 0.3);
}

/* Inputs glossy */
.glossy-input {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        inset 2px 2px 5px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.glossy-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 
        inset 2px 2px 5px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.2),
        0 0 0 3px rgba(255, 255, 255, 0.1);
}

/* Navigation */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #ffffff, #cccccc);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.1);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* Pages */
.page {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Barre de progression */
.progress-bar {
    background: linear-gradient(90deg, #ffffff, #cccccc);
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.3);
    border-radius: 1rem;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Zone de drop */
#dropzone,
#batchDropzone {
    transition: all 0.3s ease;
    position: relative;
}

#dropzone:hover,
#batchDropzone:hover,
#dropzone.dragover,
#batchDropzone.dragover {
    border-color: #ffffff !important;
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.02);
}

#dropzone.dragover::before,
#batchDropzone.dragover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Aperçu d'image */
#imagePreview {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#previewImg {
    max-height: 300px;
    object-fit: contain;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Statistiques */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffffff;
}

.stat-label {
    font-size: 0.875rem;
    color: #cccccc;
    margin-top: 0.25rem;
}

/* Éléments de batch */
.batch-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.batch-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.batch-item.processing {
    border-color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
}

.batch-item.completed {
    border-color: #34d399;
    background: rgba(52, 211, 153, 0.1);
}

.batch-item.error {
    border-color: #f87171;
    background: rgba(248, 113, 113, 0.1);
}

/* Status indicators */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-waiting { background-color: #6b7280; }
.status-processing { 
    background-color: #60a5fa;
    animation: blink 1s infinite;
}
.status-completed { background-color: #34d399; }
.status-error { background-color: #f87171; }

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* Comparaison modal */
.comparison-modal {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.comparison-content {
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sliders personnalisés */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-track {
    background: rgba(255, 255, 255, 0.2);
    height: 6px;
    border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(145deg, #ffffff, #e0e0e0);
    height: 20px;
    width: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        inset 1px 1px 3px rgba(255, 255, 255, 0.3),
        inset -1px -1px 3px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 
        inset 1px 1px 3px rgba(255, 255, 255, 0.4),
        inset -1px -1px 3px rgba(0, 0, 0, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.4);
}

input[type="range"]::-moz-range-track {
    background: rgba(255, 255, 255, 0.2);
    height: 6px;
    border-radius: 3px;
    border: none;
}

input[type="range"]::-moz-range-thumb {
    background: linear-gradient(145deg, #ffffff, #e0e0e0);
    height: 20px;
    width: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        inset 1px 1px 3px rgba(255, 255, 255, 0.3),
        inset -1px -1px 3px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

/* Checkboxes personnalisées */
input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

input[type="checkbox"]:checked {
    background: linear-gradient(145deg, #ffffff, #e0e0e0);
    border-color: rgba(255, 255, 255, 0.6);
}

input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000000;
    font-size: 12px;
    font-weight: bold;
}

input[type="checkbox"]:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
}

/* Responsive design */
@media (max-width: 768px) {
    .nav-link {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
    
    h1 {
        font-size: 3rem !important;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .glass-effect {
        margin: 0.5rem;
    }
}

@media (max-width: 640px) {
    .glossy-button {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .grid.md\\:grid-cols-2,
    .grid.md\\:grid-cols-3 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Animations d'entrée */
.animate-bounce-in {
    animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Effet de loading */
.loading-spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tooltip */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Focus visible pour l'accessibilité */
*:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
    border-radius: 2px;
}