:root {
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --accent-color: #007bff;
    --accent-hover: #0056b3;
    --border-color: #dee2e6;
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    margin-bottom: 2.5rem;
    text-align: center;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--text-primary);
}

.back-link svg {
    width: 16px;
    height: 16px;
}

h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Drop Zone */
.drop-zone {
    background: var(--card-bg);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--accent-color);
    background: rgba(0, 123, 255, 0.02);
}

.drop-icon {
    width: 64px;
    height: 64px;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.drop-zone p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.drop-zone p span {
    color: var(--accent-color);
    font-weight: 600;
}

/* Editor Section */
.editor-section {
    animation: fadeIn 0.4s ease-out;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-details .icon {
    width: 48px;
    height: 48px;
    background: #f1f3f5;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e03131;
}

.file-details .icon svg {
    width: 24px;
    height: 24px;
}

.file-details h3 {
    font-size: 1rem;
    font-weight: 600;
}

.file-details p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.btn-icon {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 50%;
    color: var(--text-secondary);
    transition: var(--transition);
}

.btn-icon:hover {
    background: #f1f3f5;
    color: #e03131;
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Inputs */
.input-group {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: var(--transition);
}

.input-group:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.input-group input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
}

.input-group .suffix {
    padding: 0 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    background: #e9ecef;
    height: 100%;
    display: flex;
    align-items: center;
}

.meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 480px) {
    .meta-grid {
        grid-template-columns: 1fr;
    }
}

.input-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.input-field label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-field input {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.input-field input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Slider */
.slider-container {
    margin-bottom: 2rem;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-weight: 500;
    font-size: 0.95rem;
}

#quality-slider {
    width: 100%;
    height: 6px;
    background: #dee2e6;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

#quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: var(--transition);
}

#quality-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Actions */
.actions {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Footer */
footer {
    margin-top: auto;
    padding: 3rem 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.file-item {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow);
    transition: var(--transition);
    animation: fadeIn 0.3s ease-out;
}

.file-item:hover {
    border-color: rgba(0, 0, 0, 0.1);
}

.file-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.file-item .file-info-mini {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-item .file-icon {
    width: 40px;
    height: 40px;
    color: #ef4444;
}

.file-item .file-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
}

/* Individual Settings */
.item-settings {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

@media (max-width: 850px) {
    .item-settings {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

.item-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.item-input-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.item-input-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.item-input-field input {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.item-quality-control {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.item-actions-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.03);
}

.item-status-pill {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    background: #f1f3f5;
    color: var(--text-secondary);
}

.item-status-pill.status-done { background: #ecfdf5; color: #059669; }
.item-status-pill.status-processing { background: #eff6ff; color: #2563eb; }

.file-list {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.bulk-actions {
    position: sticky;
    bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    padding: 1rem 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 1000;
    margin-top: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.bulk-info {
    font-weight: 700;
    color: var(--text-primary);
}

.button-group {
    display: flex;
    gap: 0.75rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.action-group {
    display: flex;
    gap: 0.5rem;
}

.action-group .download-btn:hover {
    background: #ecfdf5;
    color: #10b981;
}

.action-group .download-cover-btn:hover {
    background: #eff6ff;
    color: #3b82f6;
}

/* Helpers */
.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loader */
.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
