/* ═══════════════════════════════════════════════════════
   BeatSync — Component-specific styles
   (Shared styles are in common.css)
   ═══════════════════════════════════════════════════════ */

/* ── Section Layout ─────────────────────────────────── */
.section {
    margin-bottom: 48px;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-number {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gold);
    background: rgba(245, 158, 11, 0.15);
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.05em;
}

/* ── Upload Zones ───────────────────────────────────── */
.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.upload-zone {
    background: var(--bg-card);
    border: 2px dashed var(--border-subtle);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--gold);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.upload-zone.drag-over {
    border-style: solid;
}

.upload-zone.has-files {
    border-color: var(--green);
    border-style: solid;
}

.upload-zone-inner {
    padding: 40px 24px;
    text-align: center;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    display: block;
    animation: pulse-icon 2s ease-in-out infinite;
}

@keyframes pulse-icon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.upload-zone h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

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

.upload-hint {
    color: var(--text-muted) !important;
    font-size: 0.75rem !important;
    margin-top: 8px;
}

.upload-progress-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: none;
}

.upload-progress-bar.active {
    display: block;
}

.upload-progress-fill {
    height: 100%;
    background: var(--gradient-accent);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 0 2px 2px 0;
}

/* ── Files Preview ──────────────────────────────────── */
.files-preview {
    margin-top: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.files-list h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.file-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    animation: slide-in 0.3s ease;
}

@keyframes slide-in {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.file-card .file-icon {
    font-size: 1.2rem;
}

.file-card .file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.file-card .file-size {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.file-card .file-remove {
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.15s ease;
    background: none;
    border: none;
    font-size: 1rem;
    padding: 2px 6px;
}

.file-card .file-remove:hover {
    color: var(--red);
}

/* ── Settings Grid ──────────────────────────────────── */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

.setting-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: var(--transition);
}

.setting-card:hover {
    border-color: var(--border-active);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.format-card {
    grid-column: 1 / -1;
}

.setting-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.setting-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gold);
    background: rgba(245, 158, 11, 0.12);
    padding: 2px 10px;
    border-radius: 12px;
}

/* ── Format Toggle ──────────────────────────────────── */
.format-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.format-btn {
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    color: var(--text-secondary);
}

.format-btn:hover {
    border-color: var(--gold);
    color: var(--text-primary);
}

.format-btn.active {
    border-color: var(--gold);
    background: rgba(245, 158, 11, 0.1);
    color: var(--text-primary);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.1);
}

.format-icon {
    font-size: 1.8rem;
    display: block;
    margin-bottom: 6px;
}

.format-label {
    font-size: 1rem;
    font-weight: 600;
    display: block;
}

.format-detail {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

/* ── Duration Selector ──────────────────────────────── */
.custom-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color 0.15s ease;
}

.custom-select:hover,
.custom-select:focus {
    border-color: var(--gold);
    outline: none;
}

.custom-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ── Sliders ────────────────────────────────────────── */
.custom-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    margin: 4px 0;
}

.custom-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gradient-accent);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.custom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.6);
}

.custom-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gradient-accent);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Generate Button ────────────────────────────────── */
.generate-wrapper {
    text-align: center;
    margin-top: 32px;
}

.btn-generate {
    background: var(--gradient-accent);
    border: none;
    color: #0F0F1A;
    font-family: var(--font);
    font-size: 1.15rem;
    font-weight: 700;
    padding: 16px 48px;
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-generate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.btn-generate:hover::before {
    left: 100%;
}

.btn-generate:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(245, 158, 11, 0.4);
}

.btn-generate:active {
    transform: translateY(-1px);
}

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

.btn-generate .btn-icon {
    font-size: 1.3rem;
    width: auto;
    height: auto;
    display: inline;
    background: none;
    border: none;
    color: inherit;
}

/* ── Processing Overlay ─────────────────────────────── */
.processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 26, 0.92);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fade-in 0.3s ease;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.processing-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 48px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.processing-animation {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--gold);
    animation: pulse-expand 2s ease-out infinite;
    opacity: 0;
}

.pulse-ring.delay-1 { animation-delay: 0.6s; }
.pulse-ring.delay-2 { animation-delay: 1.2s; }

@keyframes pulse-expand {
    0% { transform: scale(0.5); opacity: 0.8; }
    100% { transform: scale(1.5); opacity: 0; }
}

.processing-icon {
    font-size: 2.5rem;
    z-index: 1;
    animation: icon-float 3s ease-in-out infinite;
}

@keyframes icon-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.processing-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.processing-message {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
    min-height: 24px;
}

/* ── Progress Bar ───────────────────────────────────── */
.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-accent);
    border-radius: 4px;
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.progress-percent {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gold);
    min-width: 36px;
}

/* ── Processing Steps ───────────────────────────────── */
.processing-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.step.active {
    color: var(--text-primary);
}

.step.done {
    color: var(--green);
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: var(--transition);
    flex-shrink: 0;
}

.step.active .step-dot {
    background: var(--gold);
    box-shadow: 0 0 8px var(--gold);
    animation: dot-pulse 1s ease-in-out infinite;
}

@keyframes dot-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.4); }
}

.step.done .step-dot {
    background: var(--green);
}

/* ── Result Card ────────────────────────────────────── */
.result-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: slide-up 0.5s ease;
}

@keyframes slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.video-player-wrapper {
    width: 100%;
    background: #000;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-player-wrapper.shorts {
    aspect-ratio: 9/16;
    max-height: 70vh;
    margin: 0 auto;
    max-width: 400px;
}

.result-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ── Rating ──────────────────────────────────────────── */
.rating-section {
    padding: 24px;
    text-align: center;
    border-top: 1px solid var(--border-subtle);
}

.rating-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.rating-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.star-rating {
    display: inline-flex;
    gap: 6px;
    font-size: 2.2rem;
    cursor: pointer;
}

.star {
    color: var(--text-muted);
    transition: all 0.15s ease;
    user-select: none;
}

.star:hover,
.star.hover {
    color: var(--gold);
    transform: scale(1.15);
}

.star.active {
    color: var(--gold);
}

.rating-label {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    min-height: 22px;
}

/* ── Result Actions ──────────────────────────────────── */
.result-actions {
    padding: 20px 24px;
    display: flex;
    gap: 12px;
    justify-content: center;
    border-top: 1px solid var(--border-subtle);
}

.btn-download, .btn-regenerate {
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
}

.btn-download {
    background: var(--gradient-accent);
    color: #0F0F1A;
    box-shadow: 0 2px 12px rgba(245, 158, 11, 0.3);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.btn-regenerate {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-regenerate:hover {
    border-color: var(--gold);
    background: var(--bg-card-hover);
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 480px) {
    .processing-card {
        padding: 32px 24px;
    }

    .btn-generate {
        font-size: 1rem;
        padding: 14px 32px;
    }

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

    .star-rating {
        font-size: 1.8rem;
    }
}
