/*
 * Skynet AI - CSS global unifié
 * Regroupe et simplifie le style de toutes les pages (index, images-ai, collection-ai)
 */
:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --dark-bg: #0f172a;
    --darker-bg: #020617;
    --card-bg: #ffffff;
    --card-bg-dark: #1e293b;
    --text-light: #1e293b;
    --text-dark: #ffffff;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --border-color-dark: #334155;
    --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-heavy: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --gradient-success: linear-gradient(135deg, var(--success-color), #22d3ee);
    --gradient-bg: linear-gradient(135deg, var(--dark-bg) 0%, #1e293b 50%, #334155 100%);
}

* {
    box-sizing: border-box;
}

body {
    background: var(--gradient-bg);
    color: var(--text-light);
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    overflow-x: hidden;
}

.navbar {
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color-dark);
    box-shadow: var(--shadow-light);
}

/* Global Cards */
.card, .ai-stat-card, .stat-card, .result-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    color: var(--text-light);
    box-shadow: var(--shadow-light);
    position: relative;
}

.card-header, .card-footer {
    background: #f8fafc !important;
    color: var(--text-light);
    border: none;
}

.card:hover, .stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-heavy);
    border-color: var(--primary-color);
}

/* ==================== IMAGES AI SPECIFIC STYLES ==================== */

/* Icons Enhancement */
.header h1 i {
    margin-right: 16px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.1em;
}

.controls i {
    margin-right: 8px;
}

.stat-label i {
    margin-right: 8px;
    opacity: 0.8;
    font-size: 0.9rem;
}

.status i {
    margin-right: 8px;
    font-size: 1.1em;
}

h3 i {
    margin-right: 12px;
    color: var(--primary-color);
}

/* Enhanced Button Icons */
.btn-start i, .btn-stop i, .btn-reset i {
    margin-right: 8px;
    font-size: 1rem;
}

/* Pulse animation for running status icon */
.status.running i {
    animation: pulse-icon 1.5s infinite;
}

@keyframes pulse-icon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Special styling for different status icons */
.status.idle i {
    color: #1d4ed8;
}

.status.running i {
    color: #166534;
}

.status.completed i {
    color: #92400e;
}

.status.error i {
    color: #991b1b;
}

/* Main Container */
.container {
    max-width: 1600px;
    margin: 20px auto;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow-heavy);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 24px 24px 0 0;
    animation: gradient-flow 3s ease-in-out infinite;
}

@keyframes gradient-flow {
    0%, 100% { background: var(--gradient-primary); }
    50% { background: linear-gradient(135deg, var(--accent-color), var(--secondary-color)); }
}

/* Header Section */
.header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.header h1 {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 3.2rem;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.header p {
    color: var(--text-muted);
    font-size: 1.25rem;
    font-weight: 500;
    max-width: 600px;
    margin: 0 auto;
}

/* Control Buttons */
.controls {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.controls label {
    font-weight: 600;
    color: var(--text-light);
    margin-right: 8px;
}

/* Enhanced Buttons */
.btn-start, .btn-stop, .btn-reset {
    padding: 14px 28px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-medium);
}

.btn-start {
    background: linear-gradient(135deg, var(--success-color), #16a34a);
    color: white;
}

.btn-stop {
    background: linear-gradient(135deg, var(--error-color), #dc2626);
    color: white;
}

.btn-reset {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
    color: white;
}

.btn-start:hover, .btn-stop:hover, .btn-reset:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-heavy);
}

.btn-start:disabled, .btn-stop:disabled, .btn-reset:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-light);
}

/* Batch Size Input */
input[type="number"] {
    background: white;
    color: var(--text-light);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Stats Grid - Completely Redesigned */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
    padding: 0;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 32px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transition: height 0.3s ease;
}

.stat-card:hover::before {
    height: 8px;
}

.stat-card:hover .stat-number {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

.stat-card:hover .stat-label {
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.stat-card:nth-child(1)::before { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.stat-card:nth-child(2)::before { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.stat-card:nth-child(3)::before { background: linear-gradient(135deg, #10b981, #22d3ee); }
.stat-card:nth-child(4)::before { background: linear-gradient(135deg, #ef4444, #f97316); }
.stat-card:nth-child(5)::before { background: linear-gradient(135deg, #8b5cf6, #d946ef); }
.stat-card:nth-child(6)::before { background: linear-gradient(135deg, #f59e0b, #eab308); }

.stat-number {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--text-light);
    margin-bottom: 8px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Enhanced Progress Bar */
.progress-container {
    background: #f1f5f9;
    border-radius: 16px;
    height: 32px;
    margin: 40px 0;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
    position: relative;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 16px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-light);
    font-weight: 700;
    font-size: 1rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    z-index: 2;
}

/* Enhanced Status Messages */
.status {
    text-align: center;
    padding: 20px 24px;
    margin: 30px 0;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.status.idle {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1d4ed8;
    border-color: #93c5fd;
}

.status.running {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
    border-color: #86efac;
    animation: pulse-enhanced 2s infinite;
}

.status.completed {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border-color: #fbbf24;
}

.status.error {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    border-color: #f87171;
}

@keyframes pulse-enhanced {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { transform: scale(1.02); box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

/* Enhanced Log Container */
h3 {
    color: var(--text-light);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 40px 0 20px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.log-container {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border-radius: 20px;
    max-height: 500px;
    overflow-y: auto;
    padding: 24px;
    color: #e2e8f0;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    line-height: 1.6;
    border: 1px solid var(--border-color-dark);
    box-shadow: var(--shadow-medium);
    position: relative;
}

.log-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 20px 20px 0 0;
}

.log-entry {
    margin-bottom: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    border-left: 4px solid #22d3ee;
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.log-entry:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
}

.log-entry.error {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

.log-entry.success {
    border-left-color: #10b981;
    background: rgba(16, 185, 129, 0.08);
}

.timestamp {
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Enhanced Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.result-card {
    padding: 24px;
    border-radius: 20px;
    background: white;
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-success);
    border-radius: 20px 20px 0 0;
}

.result-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-heavy);
}

.result-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.result-title {
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 12px;
    font-size: 1.1rem;
    line-height: 1.4;
}

.result-alt {
    color: var(--text-muted);
    font-style: italic;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    padding: 16px;
    border-radius: 12px;
    margin-top: 12px;
    border: 1px solid var(--border-color);
    font-weight: 500;
    line-height: 1.5;
}

/* Enhanced Spinner */
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(99, 102, 241, 0.1);
    border-left: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin-enhanced 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

@keyframes spin-enhanced {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

/* ETA and Speed Indicators */
.eta {
    color: var(--warning-color);
    font-weight: 700;
    background: rgba(245, 158, 11, 0.1);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.speed-indicator {
    display: inline-block;
    margin-left: 12px;
    color: var(--success-color);
    font-weight: 700;
    background: rgba(16, 185, 129, 0.1);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        margin: 15px;
        padding: 30px;
    }
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 20px;
    }
    .header h1 {
        font-size: 2.5rem;
    }
    .controls {
        flex-direction: column;
        gap: 16px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .stat-number {
        font-size: 2.8rem;
    }
    .results-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Additional Global Styles */
.btn-primary, .btn-success, .btn-outline-primary, .btn-outline-secondary, .ai-btn {
    background: var(--gradient-primary);
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    color: var(--text-dark) !important;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-light);
}

.btn-success {
    background: var(--gradient-success);
}

.btn-outline-primary, .btn-outline-secondary {
    background: white;
    color: var(--primary-color) !important;
    border: 2px solid var(--primary-color);
}

.btn-primary:hover, .btn-success:hover, .btn-outline-primary:hover, .btn-outline-secondary:hover, .ai-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-heavy);
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    color: white !important;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-light);
}

.error-alert {
    background: linear-gradient(135deg, var(--error-color), #dc2626);
    border: none;
    border-radius: 12px;
    color: white;
    box-shadow: var(--shadow-medium);
}

.badge.bg-primary, .badge.bg-success, .badge.bg-warning, .badge.bg-secondary {
    color: white !important;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    flex-direction: column;
    gap: 20px;
}

/* Additional Components */
.ai-header {
    background: var(--gradient-primary);
    color: white;
    border-radius: 20px;
    padding: 40px 0 32px 0;
    margin-bottom: 40px;
    text-align: center;
    box-shadow: var(--shadow-heavy);
}

.ai-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0;
}

.ai-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.ai-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 160px;
    min-width: 250px;
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-light);
    margin: 8px 0;
    padding: 24px 16px;
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-heavy);
}

.ai-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    color: var(--secondary-color);
}

.ai-stat-card h2 {
    font-size: 2.8rem;
    font-weight: 800;
    margin: 0 0 8px 0;
    color: var(--text-light);
}

.ai-stat-card span {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-btn {
    display: inline-flex;
    align-items: center;
    background: var(--gradient-primary);
    color: white !important;
    font-weight: 700;
    border-radius: 12px;
    padding: 14px 28px;
    font-size: 1.1rem;
    text-decoration: none;
    box-shadow: var(--shadow-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-btn:hover {
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    color: white !important;
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-heavy);
} 