:root {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent-color: #bb86fc;
    --accent-hover: #9965f4;
    --border-color: #333333;
    --dropzone-bg: #252525;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

h1 {
    color: var(--text-primary);
    margin-top: 0;
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Dropzone Styles */
.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: var(--dropzone-bg);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--accent-color);
    background: #2a2a2a;
}

.dropzone p {
    margin: 0;
    color: var(--text-secondary);
    pointer-events: none;
}

.dropzone input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

#file-count {
    margin-top: 8px;
    font-size: 0.9em;
    color: var(--accent-color);
    text-align: right;
}

/* Boutons */
button {
    background: var(--accent-color);
    color: #000;
    border: none;
    padding: 15px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    width: 100%;
    transition: background 0.3s, transform 0.1s;
}

button:hover {
    background: var(--accent-hover);
}

button:active {
    transform: scale(0.98);
}

.secondary-btn {
    background: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    padding: 10px 15px;
    font-size: 0.9rem;
}

.secondary-btn:hover {
    background: rgba(187, 134, 252, 0.1);
}

/* Loading State */
#loading {
    display: none;
    margin-top: 20px;
    color: var(--accent-color);
    font-weight: bold;
    text-align: center;
    padding: 20px;
    background: var(--dropzone-bg);
    border-radius: 8px;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px auto;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* File List (sans scroll) */
#file-list {
    margin-top: 15px;
    font-size: 0.9em;
    color: var(--text-secondary);
    text-align: left;
    background: transparent;
    display: none;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    background-color: var(--dropzone-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 15px 0 5px 0;
    overflow: hidden;
    height: 20px;
}

.progress-bar {
    height: 100%;
    background-color: var(--accent-color);
    width: 0%;
    transition: width 0.4s ease;
}

#progress-text {
    margin-top: 10px;
    font-weight: bold;
    color: var(--text-primary);
}

/* --- Nouveaux Styles Paramètres Globaux --- */

/* Champs pleine largeur */
.full-width {
    width: 80%;
    background: #111;
    color: white;
    border: 1px solid var(--border-color);
    padding: 12px 15px;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    font-size: 1rem;
    appearance: none;
}

/* Sélecteur de résolution pleine largeur */
.full-width-select {
    width: 100%;
    background: #111;
    color: white;
    border: 1px solid var(--border-color);
    padding: 12px 15px;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    font-size: 1rem;
    appearance: none;
    /* Retire la flèche native selon le navigateur */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23b3b3b3%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 15px top 50%;
    background-size: 12px auto;
}

.full-width-select:hover {
    border-color: var(--accent-color);
}

/* Boutons visuels pour le Fit Mode */
.fit-mode-container {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.fit-option {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.fit-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.fit-visual {
    background: var(--dropzone-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 15px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.fit-option span {
    display: block;
    text-align: center;
    margin-top: 8px;
    font-size: 0.9em;
    color: var(--text-secondary);
    transition: color 0.2s;
}

/* État sélectionné ou survolé */
.fit-option:hover .fit-visual {
    border-color: #555;
    background: #2a2a2a;
}

.fit-option:hover span {
    color: var(--text-primary);
}

.fit-option input[type="radio"]:checked+.fit-visual {
    border-color: var(--accent-color);
    background: rgba(187, 134, 252, 0.1);
}

.fit-option input[type="radio"]:checked~span {
    color: var(--accent-color);
    font-weight: bold;
}

/* Fichiers uploadés dynamiques */
.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #222;
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 6px;
    border: 1px solid #333;
    transition: background 0.2s;
}

.file-item:hover {
    background: #2a2a2a;
}

.file-item .filename {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
    color: var(--text-primary);
}

.effect-select {
    background: #111;
    color: white;
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    font-size: 0.9em;
}

/* Actions des fichiers */
.file-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 4px;
    width: auto;
    transition: color 0.2s, transform 0.1s;
}

.icon-btn:hover {
    background: none;
    color: var(--text-primary);
    transform: scale(1.1);
}

.icon-btn.delete-btn:hover {
    color: #ff4c4c;
}

/* Modale */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: 0.3s;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--accent-color);
    text-decoration: none;
    cursor: pointer;
}