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

.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.auth-overlay.hidden { display: none; }

.auth-modal {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.auth-icon { color: #667eea; margin-bottom: 20px; }
.auth-modal h2 { color: #1a1a2e; margin-bottom: 10px; font-weight: 600; }
.auth-hint { color: #999; font-size: 14px; margin-bottom: 25px; }

.auth-modal input {
    width: 100%;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 24px;
    text-align: center;
    letter-spacing: 8px;
    font-weight: 600;
    outline: none;
    transition: border-color 0.3s;
}

.auth-modal input:focus { border-color: #667eea; }
.auth-modal input::placeholder { color: #ccc; letter-spacing: 8px; }

.auth-btn {
    width: 100%;
    padding: 16px;
    margin-top: 20px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3); }
.auth-btn:disabled { background: #ccc; cursor: not-allowed; transform: none; box-shadow: none; }
.auth-error { color: #e74c3c; font-size: 14px; margin-top: 15px; min-height: 20px; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    max-width: 1100px;
    width: 100%;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

h1 { text-align: center; color: #1a1a2e; margin-bottom: 30px; font-weight: 600; font-size: 28px; }

.header { text-align: center; margin-bottom: 30px; position: relative; }
.logo { display: flex; align-items: center; justify-content: center; gap: 4px; margin-bottom: 8px; }
.logo-icon { font-size: 36px; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }

.logo-text {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-slogan { font-size: 13px; color: #aaa; margin-bottom: 6px; font-weight: 400; letter-spacing: 4px; text-transform: uppercase; }
.header-subtitle { font-size: 13px; color: #999; }
.header-subtitle a { color: #667eea; text-decoration: none; font-weight: 500; }
.header-subtitle a:hover { color: #764ba2; }

.tabs { display: flex; gap: 10px; margin-bottom: 30px; }
.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: #f0f0f0;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}
.tab-btn:hover { background: #e0e0e0; }
.tab-btn.active { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; }
.tab-btn svg { flex-shrink: 0; }

.tab-content { display: none; }
.tab-content.active { display: block; }

.upload-area {
    border: 2px dashed #ccc;
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}
.upload-area:hover { border-color: #667eea; background: #f5f5ff; }
.upload-area.dragover { border-color: #667eea; background: #f0f0ff; transform: scale(1.02); }
.upload-area svg { color: #999; margin-bottom: 15px; }
.upload-area p { color: #666; font-size: 16px; margin-bottom: 5px; }
.upload-area .hint { color: #999; font-size: 13px; }
.upload-area input { display: none; }

.quality-slider { margin: 20px 0; padding: 15px; background: #f5f5f5; border-radius: 12px; }
.quality-slider label { display: block; margin-bottom: 10px; color: #444; font-weight: 500; }
.quality-slider input[type="range"] { width: 100%; height: 6px; border-radius: 3px; background: #ddd; outline: none; -webkit-appearance: none; }
.quality-slider input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); cursor: pointer; }

.file-list { margin: 20px 0; max-height: 200px; overflow-y: auto; }
.file-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 15px; background: #f8f8f8; border-radius: 10px; margin-bottom: 8px; }
.file-item .file-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.file-item .file-name { font-size: 14px; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item .file-size { font-size: 12px; color: #999; white-space: nowrap; }
.file-item .remove-btn { background: none; border: none; color: #999; cursor: pointer; padding: 5px; border-radius: 50%; transition: all 0.2s; }
.file-item .remove-btn:hover { background: #fee; color: #e74c3c; }
.file-item .custom-sound-name { flex: 1; max-width: 150px; padding: 6px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 12px; outline: none; transition: border-color 0.2s; margin: 0 10px; }
.file-item .custom-sound-name:focus { border-color: #667eea; }
.file-item .custom-sound-name::placeholder { color: #aaa; font-style: italic; }
.file-item .status { font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; }
.file-item .status.pending { background: #fff3cd; color: #856404; }
.file-item .status.processing { background: #cce5ff; color: #004085; }
.file-item .status.done { background: #d4edda; color: #155724; }
.file-item .status.error { background: #f8d7da; color: #721c24; }

.convert-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}
.convert-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3); }
.convert-btn:disabled { background: #ccc; cursor: not-allowed; }
.convert-btn.loading { pointer-events: none; }
.convert-btn.loading::after { content: ''; width: 20px; height: 20px; border: 2px solid white; border-top-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.history-section { margin-top: 30px; border-top: 1px solid #eee; padding-top: 20px; }
.history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.history-title { font-size: 16px; font-weight: 600; color: #444; }
.clear-history-btn { padding: 6px 12px; background: #f5f5f5; border: 1px solid #ddd; border-radius: 6px; color: #666; font-size: 12px; cursor: pointer; transition: all 0.2s; }
.clear-history-btn:hover { background: #ffebee; border-color: #ffcdd2; color: #c62828; }
.results { margin-top: 0; }

.result-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 15px; background: #e8f5e9; border-radius: 10px; margin-bottom: 8px; position: relative; animation: slideInResult 0.3s ease; border: 2px solid transparent; }
.result-item.expired { background: #ffebee; opacity: 0.7; }
.result-item .remove-result-btn { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: #e57373; border: none; color: white; font-size: 14px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity 0.2s; display: flex; align-items: center; justify-content: center; }
.result-item:hover .remove-result-btn { opacity: 1; }
.result-item .remove-result-btn:hover { background: #c62828; }
.result-item .result-info { display: flex; flex-direction: column; gap: 2px; }
.result-item .result-name { font-size: 14px; color: #333; font-weight: 500; }
.result-item .result-title { font-size: 12px; color: #888; font-style: italic; max-width: 400px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-item .result-size { font-size: 12px; color: #666; }
.result-item .download-btn { padding: 8px 16px; background: #4caf50; color: white; border: none; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.2s; }
.result-item .download-btn:hover { background: #43a047; }

.result-item.removing { animation: slideOutResult 0.3s ease forwards; pointer-events: none; }
.result-item.new-item { animation: slideInResult 0.3s ease, glowPulse 0.8s ease-in-out 3; border: 2px solid rgba(102, 126, 234, 0.6); }

.file-list::-webkit-scrollbar { width: 6px; }
.file-list::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 3px; }
.file-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.file-list::-webkit-scrollbar-thumb:hover { background: #bbb; }

.tab-description { text-align: center; color: #666; font-size: 13px; margin-bottom: 20px; padding: 10px; background: #f5f5f5; border-radius: 8px; }

.divider { display: flex; align-items: center; margin: 20px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: #ddd; }
.divider span { padding: 0 15px; color: #999; font-size: 13px; }

/* Кнопка со статусом внутри */
.convert-btn .btn-status {
    font-size: 14px;
}

/* Прогресс-бары под кнопкой */
.download-progress-container {
    margin-top: 12px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.download-progress-container .progress-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.download-progress-container .progress-row:last-child {
    margin-bottom: 0;
}

.download-progress-container .progress-label {
    font-size: 13px;
    font-weight: 500;
    color: #666;
    min-width: 50px;
}

.download-progress-container .progress-bar {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.download-progress-container .progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.2s ease;
}

.download-progress-container .video-fill {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.download-progress-container .audio-fill {
    background: linear-gradient(90deg, #4caf50 0%, #8bc34a 100%);
}

.download-progress-container .progress-percent {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    min-width: 36px;
    text-align: right;
}

/* Тёмная тема */
body.dark-theme .download-progress-container {
    background: #252530;
}

body.dark-theme .download-progress-container .progress-label {
    color: #aaa;
}

body.dark-theme .download-progress-container .progress-bar {
    background: #3a3a4a;
}

body.dark-theme .download-progress-container .progress-percent {
    color: #ddd;
}
