:root {
    --primary: #0066cc;
    --primary-dark: #0052a3;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --light: #f8f9fa;
    --dark: #343a40;
    --border: #dee2e6;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.minimal-container {
    max-width: 600px;
    width: 100%;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.header {
    background: linear-gradient(135deg, #495057, #343a40);
    color: white;
    padding: 2rem;
    text-align: center;
}

.header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

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

.main-content {
    padding: 2rem;
}

.upload-section {
    margin-bottom: 2rem;
    width: 100%;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.upload-zone {
    border: 3px dashed var(--border);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    background: var(--light);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    margin-bottom: 1.5rem;
    width: 100%;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-restrictions {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 102, 204, 0.2);
    border-radius: 6px;
    padding: 1rem;
    margin-top: 1.5rem;
    width: 100%;
    max-width: 400px;
}

.upload-restrictions .restriction-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.upload-restrictions .restriction-item:last-child {
    margin-bottom: 0;
}

.upload-restrictions .restriction-label {
    font-weight: 500;
    color: var(--dark);
    min-width: 50px;
}

.upload-restrictions .restriction-value {
    color: var(--primary);
    font-weight: 600;
}

.upload-restrictions .current-count {
    color: #6c757d;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(0, 102, 204, 0.05);
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: block;
}

.upload-text {
    font-size: 1.2rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.upload-subtext {
    color: #6c757d;
    font-size: 0.9rem;
}

.file-input {
    display: none;
}

.file-preview {
    display: none;
    background: rgba(40, 167, 69, 0.1);
    border: 2px solid var(--success);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.file-details h4 {
    color: var(--success);
    margin-bottom: 0.25rem;
}

.file-meta {
    font-size: 0.9rem;
    color: #6c757d;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
}

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

.progress-container {
    display: none;
    margin: 1.5rem 0;
}

.progress {
    height: 10px;
    background: var(--light);
    border-radius: 5px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, .2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, .2) 50%,
        rgba(255, 255, 255, .2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 50px 50px;
    animation: move 2s linear infinite;
}

@keyframes move {
    0% { background-position: 0 0; }
    100% { background-position: 50px 50px; }
}

.progress-text {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--dark);
}

.result {
    display: none;
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-top: 1.5rem;
}

.result.success {
    background: rgba(40, 167, 69, 0.1);
    border: 2px solid var(--success);
    color: var(--dark);
}

.result.error {
    background: rgba(220, 53, 69, 0.1);
    border: 2px solid var(--danger);
    color: var(--dark);
}

.result h3 {
    margin-bottom: 1rem;
    color: inherit;
}

.file-url {
    background: rgba(0,0,0,0.05);
    padding: 1rem;
    border-radius: var(--radius);
    font-family: 'Courier New', monospace;
    word-break: break-all;
    margin: 1rem 0;
    border-left: 4px solid var(--primary);
}

.file-url a {
    color: var(--primary);
    text-decoration: none;
}

.file-url a:hover {
    text-decoration: underline;
}

/* ============= NOUVELLE SECTION: AMÉLIORATIONS UI ============= */

/* Boîte d'infos pour les restrictions */
.info-card {
    background: linear-gradient(135deg, #f8f9ff 0%, #e6f0ff 100%);
    border: 1px solid rgba(0, 102, 204, 0.2);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.1);
}

.info-card-header {
    padding: 1rem;
    background: rgba(0, 102, 204, 0.05);
    border-bottom: 1px solid rgba(0, 102, 204, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-icon {
    font-size: 1.2rem;
}

.info-title {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
}

.info-card-content {
    padding: 1rem;
}

.restriction-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.restriction-item:last-child {
    margin-bottom: 0;
}

.restriction-icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.restriction-label {
    font-weight: 500;
    color: var(--dark);
    min-width: 120px;
}

.restriction-value {
    color: var(--primary);
    font-weight: 600;
}

.current-count {
    color: #6c757d;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

/* Queue des fichiers améliorée */
.files-queue {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 1.5rem 0;
}

.queue-header {
    padding: 1rem;
    background: var(--light);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.queue-header h4 {
    margin: 0;
    color: var(--dark);
    font-size: 1.1rem;
}

.queue-count {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.queue-list {
    max-height: 300px;
    overflow-y: auto;
}

/* Élément de fichier dans la queue */
.file-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: background 0.2s ease;
}

.file-item:hover {
    background: rgba(0, 102, 204, 0.02);
}

.file-item:last-child {
    border-bottom: none;
}

.file-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}

.file-details {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.file-meta {
    font-size: 0.85rem;
    color: #6c757d;
}

.file-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    min-width: 100px;
    justify-content: flex-end;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.pending {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

.status-badge.uploading {
    background: rgba(0, 102, 204, 0.1);
    color: var(--primary);
}

.status-badge.completed {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.status-badge.error {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

/* Progress bar individuelle pour chaque fichier */
.file-progress {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.file-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* Résumé d'upload */
.upload-summary {
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin: 1.5rem 0;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.summary-header h4 {
    margin: 0;
    color: var(--dark);
    font-size: 1rem;
}

.summary-status {
    font-weight: 600;
    font-size: 0.9rem;
}

.summary-status.in-progress {
    color: var(--primary);
}

.summary-status.completed {
    color: var(--success);
}

.summary-status.error {
    color: var(--danger);
}

.summary-stats {
    display: flex;
    gap: 1.5rem;
}

.stat-item {
    font-size: 0.9rem;
    color: #6c757d;
}

.stat-item span {
    font-weight: 600;
    color: var(--dark);
}

/* Actions d'upload */
.upload-actions {
    padding: 1rem;
    background: var(--light);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    justify-content: center;
}

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

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-icon {
    margin-right: 0.5rem;
}

.welcome-section {
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.welcome-section h2 {
    margin-bottom: 1rem;
    color: var(--dark);
}

.welcome-section p {
    margin-bottom: 2rem;
    color: #6c757d;
    font-size: 1.1rem;
}

.api-info {
    background: var(--light);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: left;
    max-width: 500px;
    margin: 0 auto;
}

.api-info h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.api-info code {
    background: var(--primary);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
}

.api-info pre {
    background: #343a40;
    color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
}

.test-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.test-section h3 {
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.test-section p {
    margin-bottom: 1.5rem;
    color: #6c757d;
}

.test-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.test-link {
    background: var(--light);
    padding: 1rem;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--dark);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    display: block;
}

.test-link:hover {
    background: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--dark);
}

.test-link strong {
    color: var(--primary);
    display: block;
    margin-bottom: 0.25rem;
}

.test-link small {
    color: #6c757d;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
}

.generated-link {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1rem;
}

.generated-link h4 {
    color: #155724;
    margin-bottom: 1rem;
}

.link-result {
    background: white;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.link-result a {
    color: var(--primary);
    word-break: break-all;
}

.path-info {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.2);
}

.path-info code {
    background: rgba(255,255,255,0.2);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', monospace;
}

.status-bar {
    background: var(--light);
    padding: 1rem 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Interface de redirection améliorée */
.redirect-info {
    background: linear-gradient(135deg, #e8f5e8, #f0f8f0);
    border: 2px solid var(--success);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1rem;
    text-align: center;
}

.redirect-info p {
    margin-bottom: 1rem;
    font-weight: 500;
    color: var(--dark);
}

.countdown-container {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 2px solid var(--warning);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1rem;
}

.countdown-timer {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--danger);
    animation: countdown-pulse 1s infinite;
}

@keyframes countdown-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    margin: 0.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #0052a3);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

/* Animation du bouton de redirection */
.redirect-button {
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .container {
        margin: 0;
        border-radius: 0;
    }
    
    .file-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .path-grid {
        grid-template-columns: 1fr;
    }
}