/* -------------------------------------------------------------------
   Media Format Converter - stylesheet
   A clean, modern layout with a soft gradient background and a card.
   ------------------------------------------------------------------- */

/* Ensure [hidden] always wins over display rules on component classes. */
[hidden] {
    display: none !important;
}

:root {
    --bg-start: #6366f1;
    --bg-end: #8b5cf6;
    --card-bg: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --error-bg: #fee2e2;
    --error-text: #b91c1c;
    --success-bg: #dcfce7;
    --success-text: #15803d;
    --radius: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
}

.app {
    width: 100%;
    max-width: 720px;
}

.app__header {
    text-align: center;
    color: #ffffff;
    margin-bottom: 24px;
}

.app__header h1 {
    margin: 0 0 8px;
    font-size: 2rem;
    font-weight: 700;
}

.app__subtitle {
    margin: 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

/* Card ------------------------------------------------------------- */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
}

/* Format controls -------------------------------------------------- */
.controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 24px;
}

.control {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 0 0 180px;
}

.control--arrow {
    flex: 0 0 auto;
    font-size: 1.5rem;
    color: var(--muted);
    padding-bottom: 8px;
}

.control label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

select {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    color: var(--text);
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Dropzone --------------------------------------------------------- */
.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: #f9fafb;
    text-align: center;
    padding: 32px 16px;
    transition: border-color 0.15s, background 0.15s;
}

.dropzone.dragover {
    border-color: var(--primary);
    background: #eef2ff;
}

.dropzone__title {
    margin: 0 0 4px;
    font-weight: 600;
}

.dropzone__or {
    margin: 6px 0;
    color: var(--muted);
    font-size: 0.85rem;
}

/* Buttons ---------------------------------------------------------- */
.btn {
    display: inline-block;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}

.btn--small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn--primary {
    background: var(--primary);
    color: #fff;
}

.btn--primary:hover {
    background: var(--primary-dark);
}

.btn--secondary {
    background: #eef2ff;
    color: var(--primary-dark);
}

.btn--secondary:hover {
    background: #e0e7ff;
}

.btn--danger {
    background: #fee2e2;
    color: #b91c1c;
}

.btn--danger:hover {
    background: #fecaca;
}

.btn--ghost {
    background: #e5e7eb;
    color: #4b5563;
}

.btn--ghost:hover {
    background: #d1d5db;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* File list -------------------------------------------------------- */
.file-list {
    list-style: none;
    padding: 0;
    margin: 20px 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
}

.file-list .file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 310px;
}

.file-list .file-size {
    color: var(--muted);
    flex: 0 0 auto;
    font-size: 0.8rem;
    width: 80px;
    text-align: center;
}

.file-remove {
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    flex: 0 0 auto;
}

.file-remove:hover {
    color: var(--error-text);
}

.file-list__total {
    border-top: 2px solid var(--border);
    font-weight: 600;
}

/* Messages --------------------------------------------------------- */
.message {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.message--error {
    background: var(--error-bg);
    color: var(--error-text);
}

.message--success {
    background: var(--success-bg);
    color: var(--success-text);
}

.message--warning {
    background: #fef3c7;
    color: #b45309;
}

/* Progress --------------------------------------------------------- */
.progress {
    margin-top: 20px;
}

.progress__bar {
    height: 10px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.progress__fill {
    height: 100%;
    width: 0%;
    background: var(--primary);
    transition: width 0.2s ease;
}

.progress__text {
    margin: 8px 0 0;
    font-size: 0.85rem;
    color: var(--muted);
    text-align: center;
}

/* Download all ------------------------------------------------------ */
.download-all-row {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

/* Actions ---------------------------------------------------------- */
.actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Small screens ---------------------------------------------------- */
@media (max-width: 520px) {
    .control--arrow {
        display: none;
    }

    .actions {
        flex-direction: column-reverse;
    }

    .actions .btn {
        width: 100%;
    }
}
