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

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #0f0f0f;
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: #ffa500; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== ANIMATIONS ===== */
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 107, 107, 0.3), 0 0 40px rgba(255, 165, 0, 0.1); }
    50% { box-shadow: 0 0 30px rgba(255, 107, 107, 0.5), 0 0 60px rgba(255, 165, 0, 0.25); }
}

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

@keyframes border-glow {
    0%, 100% { border-color: rgba(255, 165, 0, 0.4); }
    50% { border-color: rgba(255, 107, 107, 0.8); }
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ===== NAVBAR ===== */
.navbar {
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #1a1a1a;
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ff6b6b, #ffa500, #ff6b6b, #ffa500);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s ease-in-out infinite;
}

.nav-logo:hover { text-decoration: none; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links a {
    color: #aaa;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.nav-links a:hover { color: #fff; text-decoration: none; }

.btn-nav {
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
    color: white !important;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.3s;
}

.btn-nav:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 165, 0, 0.4);
}

/* ===== FLASH MESSAGES ===== */
.flash-messages { max-width: 700px; margin: 16px auto; padding: 0 20px; }

.flash {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.95rem;
    animation: fade-in-up 0.4s ease-out;
}

.flash-error { background: #3a1515; border: 1px solid #ff4444; color: #ff6b6b; }
.flash-success { background: #153a15; border: 1px solid #44ff44; color: #6bff6b; }

/* ===== CONTAINER ===== */
.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* ===== LANDING PAGE ===== */
.landing {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero {
    text-align: center;
    padding: 80px 0 60px;
    animation: fade-in-up 0.8s ease-out;
}

.hero h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ff6b6b, #ffa500, #ff6b6b, #ffa500);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 5s ease-in-out infinite;
}

.hero-sub {
    font-size: 1.2rem;
    color: #888;
    max-width: 600px;
    margin: 0 auto 30px;
    line-height: 1.6;
    animation: breathe 4s ease-in-out infinite;
}

/* How it works */
.how-it-works {
    padding: 60px 0;
    text-align: center;
}

.how-it-works h2 {
    font-size: 2rem;
    margin-bottom: 40px;
    color: #fff;
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.step {
    background: #1a1a1a;
    padding: 30px 20px;
    border-radius: 16px;
    border: 1px solid #222;
    transition: transform 0.3s, border-color 0.5s, box-shadow 0.5s;
    animation: fade-in-up 0.6s ease-out both;
}

.step:nth-child(1) { animation-delay: 0.1s; }
.step:nth-child(2) { animation-delay: 0.25s; }
.step:nth-child(3) { animation-delay: 0.4s; }

.step:hover {
    transform: translateY(-6px);
    border-color: #ffa500;
    box-shadow: 0 8px 30px rgba(255, 165, 0, 0.15);
}

.step-num {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: white;
    margin: 0 auto 16px;
    animation: float 3s ease-in-out infinite;
}

.step:nth-child(2) .step-num { animation-delay: 0.5s; }
.step:nth-child(3) .step-num { animation-delay: 1s; }

.step h3 { margin-bottom: 8px; color: #fff; }
.step p { color: #888; font-size: 0.95rem; }

/* Pricing */
.pricing {
    padding: 60px 0 80px;
    text-align: center;
}

.pricing h2 {
    font-size: 2rem;
    margin-bottom: 40px;
    color: #fff;
}

.pricing-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 700px;
    margin: 0 auto;
}

.pricing-card {
    background: #1a1a1a;
    border: 1px solid #222;
    border-radius: 16px;
    padding: 36px 28px;
    position: relative;
    transition: transform 0.3s, box-shadow 0.5s;
    animation: fade-in-up 0.7s ease-out both;
}

.pricing-card:first-child { animation-delay: 0.2s; }
.pricing-card:last-child { animation-delay: 0.35s; }

.pricing-card:hover {
    transform: translateY(-4px);
}

.pricing-card-pro {
    border-color: #ffa500;
    background: #1a1508;
    animation: border-glow 3s ease-in-out infinite, fade-in-up 0.7s ease-out both;
    animation-delay: 0.35s;
}

.pricing-card-pro:hover {
    box-shadow: 0 0 40px rgba(255, 165, 0, 0.2);
}

.pro-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    background-size: 200% 200%;
    animation: gradient-shift 2s ease infinite;
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.pricing-card h3 { font-size: 1.3rem; margin-bottom: 12px; color: #fff; }

.price {
    font-size: 2.5rem;
    font-weight: 800;
    color: #ffa500;
    margin-bottom: 20px;
}

.price span { font-size: 1rem; font-weight: 400; color: #666; }

.pricing-card ul { list-style: none; margin-bottom: 24px; }

.pricing-card li {
    padding: 6px 0;
    color: #aaa;
    font-size: 0.95rem;
}

.pricing-card li::before {
    content: "\2713 ";
    color: #ffa500;
    font-weight: 700;
}

/* ===== AUTH PAGES ===== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 40px 20px;
}

.auth-card {
    background: #1a1a1a;
    border: 1px solid #222;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    animation: fade-in-up 0.5s ease-out;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 28px;
    color: #fff;
    font-size: 1.5rem;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 0.9rem;
}

/* ===== ACCOUNT PAGE ===== */
.account-page h1 { font-size: 1.8rem; margin-bottom: 24px; color: #fff; }

.account-card {
    background: #1a1a1a;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    transition: border-color 0.3s;
}

.account-card:hover { border-color: #333; }

.account-card h3 { color: #fff; margin-bottom: 12px; }
.account-card p { color: #aaa; margin-bottom: 8px; }

/* ===== USAGE BAR ===== */
.usage-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #1a1a1a;
    border: 1px solid #222;
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    color: #aaa;
    animation: fade-in-up 0.4s ease-out;
}

.plan-badge {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.plan-badge.pro {
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
    color: white;
}

.plan-badge.free { background: #333; color: #aaa; }

.btn-sm { padding: 5px 14px; font-size: 0.8rem; border-radius: 6px; }

.btn-upgrade {
    margin-left: auto;
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    animation: pulse-glow 2s ease-in-out infinite;
    transition: transform 0.2s;
}

.btn-upgrade:hover { transform: scale(1.05); }

/* ===== UPLOAD ZONE ===== */
.upload-zone {
    border: 2px dashed #444;
    border-radius: 16px;
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s, box-shadow 0.5s;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    min-height: 180px;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: #ffa500;
    background: rgba(255, 165, 0, 0.05);
    box-shadow: 0 0 30px rgba(255, 165, 0, 0.1);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    animation: float 3s ease-in-out infinite;
}

.upload-zone p { margin-bottom: 4px; }
.upload-hint { color: #666; font-size: 0.9rem; }
.upload-formats { color: #555; font-size: 0.8rem; margin-top: 6px; }

.upload-preview {
    position: absolute;
    inset: 0;
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 14px;
}

/* The preview-frame mirrors the actual video aspect ratio (9:16 or 16:9)
   so the subtitle overlay inside it aligns with the real output bounds. */
.preview-frame {
    position: relative;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    height: 100%;
    aspect-ratio: 9 / 16;
    max-width: 100%;
    container-type: inline-size;
}

.preview-frame.aspect-horizontal {
    height: auto;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 100%;
}

.preview-frame img,
.preview-frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.btn-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 0, 0, 0.7);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.btn-remove:hover { background: rgba(255, 0, 0, 0.9); transform: scale(1.1); }

/* Subtitle live preview overlay */
.upload-zone.has-preview { min-height: 420px; cursor: default; }

.subtitle-overlay {
    position: absolute;
    left: 7%;
    right: 7%;
    text-align: center;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-weight: 800;
    /* Font scales with the preview frame width (5.4% of frame inline size). */
    font-size: 5.4cqi;
    line-height: 1.2;
    color: #fff;
    text-shadow:
        -1px -1px 0 #000, 1px -1px 0 #000,
        -1px  1px 0 #000, 1px  1px 0 #000,
         0   -1px 0 #000, 0    1px 0 #000,
        -1px  0   0 #000, 1px  0   0 #000;
    pointer-events: none;
    white-space: pre-line;
    word-wrap: break-word;
    transition: top 0.25s, color 0.25s, opacity 0.3s;
    text-transform: none;
}

.subtitle-overlay.empty { display: none; }

/* ===== FORM ELEMENTS ===== */
.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #ccc;
    font-size: 0.95rem;
}

textarea, input[type="text"], input[type="email"], input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    background: #111;
    border: 1px solid #333;
    border-radius: 10px;
    color: #e0e0e0;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

textarea { resize: vertical; }

textarea:focus, input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus {
    outline: none;
    border-color: #ffa500;
    box-shadow: 0 0 12px rgba(255, 165, 0, 0.15);
}

.char-count {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    color: #666;
    font-size: 0.8rem;
    margin-top: 6px;
}

.char-count #durationEst { color: #ffa500; font-weight: 600; }

.btn-preview-play {
    background: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #444;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn-preview-play:hover {
    background: #333;
    border-color: #ffa500;
    color: #ffa500;
}


select {
    width: 100%;
    padding: 10px 14px;
    background: #111;
    border: 1px solid #333;
    border-radius: 10px;
    color: #e0e0e0;
    font-size: 1rem;
    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='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: border-color 0.3s, box-shadow 0.3s;
}

select:focus {
    outline: none;
    border-color: #ffa500;
    box-shadow: 0 0 12px rgba(255, 165, 0, 0.15);
}

input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #333;
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffa500;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(255, 165, 0, 0.4);
    transition: box-shadow 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    box-shadow: 0 0 16px rgba(255, 165, 0, 0.6);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffa500;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 8px rgba(255, 165, 0, 0.4);
}

.provider-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 4px;
}

.voice-desc { color: #666; font-size: 0.8rem; margin-top: 4px; }

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.btn:hover { transform: scale(1.03); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 0 25px rgba(255, 165, 0, 0.4);
}

/* Shine effect on primary buttons */
.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: none;
    animation: btn-shine 3s ease-in-out infinite;
}

@keyframes btn-shine {
    0%, 100% { left: -100%; }
    50% { left: 150%; }
}

.btn-secondary {
    background: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #444;
    transition: background 0.3s, border-color 0.3s, transform 0.2s;
}

.btn-secondary:hover {
    background: #333;
    border-color: #555;
}

.btn-lg { padding: 18px 40px; font-size: 1.1rem; }
.btn-full { width: 100%; }

.actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.actions .btn { flex: 1; }

/* ===== ERROR ===== */
.error-section {
    background: #3a1515;
    border: 1px solid #ff4444;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    text-align: center;
    animation: fade-in-up 0.3s ease-out;
}

.error-section p { color: #ff6b6b; font-size: 1rem; font-weight: 600; }

/* ===== PROGRESS ===== */
.progress-section {
    text-align: center;
    padding: 32px 0 24px;
    animation: fade-in-up 0.4s ease-out;
}

.progress-bar-wrap {
    width: 100%;
    max-width: 540px;
    height: 14px;
    margin: 0 auto 16px;
    background: #222;
    border: 1px solid #333;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ffa500, #ff6b00);
    border-radius: 999px;
    box-shadow: 0 0 16px rgba(255, 165, 0, 0.4);
    transition: width 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.25) 50%,
        transparent 100%
    );
    animation: progress-shine 1.4s linear infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-section p {
    color: #ccc;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    gap: 12px;
    align-items: baseline;
}

#progressPercent {
    color: #ffa500;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ===== RESULT ===== */
.result-section {
    text-align: center;
    padding: 20px 0;
    animation: fade-in-up 0.5s ease-out;
}

.result-section h2 {
    margin-bottom: 20px;
    color: #ffa500;
    font-size: 1.3rem;
}

.result-section video {
    width: 100%;
    max-height: 500px;
    border-radius: 12px;
    background: #000;
    margin-bottom: 20px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.result-section .btn { max-width: 300px; margin: 0 auto; }

/* ===== BILLING TOGGLE ===== */
.billing-toggle {
    display: inline-flex;
    background: #1a1a1a;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 30px;
    gap: 4px;
}

.billing-opt {
    background: transparent;
    color: #888;
    border: none;
    padding: 10px 22px;
    border-radius: 9px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.billing-opt:hover { color: #ddd; }

.billing-opt.active {
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    color: white;
}

.save-badge {
    background: rgba(76, 175, 80, 0.25);
    color: #4CAF50;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
}

.billing-opt.active .save-badge {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.price-note {
    font-size: 0.85rem;
    color: #888;
    margin-top: -8px;
    margin-bottom: 12px;
}

.upgrade-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upgrade-form { margin: 0; }

.save-inline {
    background: rgba(255, 255, 255, 0.25);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    margin-left: 6px;
}

/* ===== HISTORY ===== */
.history-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #222;
}

.history-section h2 {
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 20px;
}

.history-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.history-empty {
    color: #666;
    font-style: italic;
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
}

.history-item {
    background: #1a1a1a;
    border: 1px solid #222;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
}

.history-item:hover {
    transform: translateY(-3px);
    border-color: #ffa500;
}

.history-item video {
    width: 100%;
    aspect-ratio: 9/16;
    object-fit: cover;
    background: #0a0a0a;
    display: block;
}

.history-item-body {
    padding: 10px 12px;
}

.history-item-date {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 8px;
}

.history-expires {
    display: inline-block;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
    background: rgba(255, 165, 0, 0.15);
    color: #ffa500;
    font-weight: 600;
}

.history-item-actions {
    display: flex;
    gap: 6px;
}

.history-item-actions a,
.history-item-actions button {
    flex: 1;
    padding: 6px 8px;
    font-size: 0.78rem;
    text-align: center;
    background: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #333;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.history-item-actions a:hover { background: #333; text-decoration: none; }
.history-item-actions button:hover { background: #3a2020; border-color: #ff5252; color: #ff5252; }

.history-unavailable {
    padding: 30px 10px;
    text-align: center;
    color: #666;
    font-size: 0.85rem;
}

/* ===== MUSIC PICKER ===== */
.music-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.music-row select {
    flex: 1;
    min-width: 0;
}

.btn-mini {
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    background-size: 200% 200%;
    animation: gradient-shift 4s ease infinite;
    color: white;
    border: none;
    padding: 0 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s;
}

.btn-mini:hover { transform: translateY(-1px); }
.btn-mini:active { transform: translateY(0); }

/* ===== CUSTOM MUSIC PANEL ===== */
.custom-music-panel {
    position: relative;
    border: 2px dashed #3a3a3a;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.015);
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.custom-music-panel.dragover {
    border-color: #ffa500;
    background: rgba(255, 165, 0, 0.06);
    transform: scale(1.005);
}

/* Empty state */
.cm-empty {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 22px;
}

.cm-empty-icon {
    font-size: 2rem;
    flex-shrink: 0;
    filter: grayscale(0.2);
}

.cm-empty-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cm-empty-text strong {
    color: #e0e0e0;
    font-size: 0.98rem;
    font-weight: 600;
}

.cm-empty-text span {
    color: #777;
    font-size: 0.82rem;
}

.btn-upload-music {
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    background-size: 200% 200%;
    animation: gradient-shift 4s ease infinite;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-upload-music:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(255, 165, 0, 0.3);
}

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

/* Loaded state */
.cm-loaded {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.1), rgba(255, 107, 107, 0.06));
    border: 1px solid rgba(255, 165, 0, 0.35);
    animation: fade-in-up 0.25s ease-out;
}

.cm-loaded-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.cm-loaded-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cm-loaded-name {
    color: #ffd28a;
    font-weight: 600;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cm-loaded-meta {
    color: #888;
    font-size: 0.78rem;
}

.cm-preview-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 8px 14px;
    border-radius: 7px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s;
}

.cm-preview-btn:hover {
    background: rgba(255, 165, 0, 0.15);
    border-color: rgba(255, 165, 0, 0.5);
}

.cm-remove-btn {
    background: transparent;
    border: none;
    color: #777;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 6px;
    transition: color 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.cm-remove-btn:hover {
    color: #ff6b6b;
    transform: scale(1.1);
}

/* Overridden state for preset dropdown when custom is active */
#musicSelect.overridden,
#musicPreviewBtn.overridden {
    opacity: 0.5;
    filter: grayscale(0.4);
}

/* ===== AI TEXT GENERATOR ===== */
.text-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.text-label-row label { margin-bottom: 0; }

.btn-ai {
    background: linear-gradient(135deg, #7b2cbf, #ff6b6b, #ffa500);
    background-size: 200% 200%;
    animation: gradient-shift 4s ease infinite;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
}

.btn-ai:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 18px rgba(123, 44, 191, 0.4);
}

.ai-panel {
    margin-top: 12px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(123, 44, 191, 0.08), rgba(255, 165, 0, 0.05));
    border: 1px solid rgba(123, 44, 191, 0.35);
    border-radius: 12px;
    animation: fade-in-up 0.3s ease-out;
}

.ai-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.ai-panel input[type="text"],
.ai-panel input[type="number"] {
    width: 100%;
    padding: 12px 14px;
    background: #111;
    border: 1px solid #333;
    border-radius: 10px;
    color: #e0e0e0;
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 10px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.ai-panel input[type="number"]:focus,
.ai-panel input[type="text"]:focus {
    outline: none;
    border-color: #ffa500;
    box-shadow: 0 0 12px rgba(255, 165, 0, 0.15);
}

/* ===== SLIDESHOW COUNT BADGE ===== */
.slideshow-count {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.75);
    color: #ffa500;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid rgba(255, 165, 0, 0.4);
    pointer-events: none;
}

/* ===== SLIDESHOW THUMBNAIL STRIP ===== */
.slideshow-thumbs {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid #333;
    flex-shrink: 0;
}

.ss-thumb {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid #444;
    cursor: default;
    transition: border-color 0.2s;
}

.ss-thumb:hover {
    border-color: #ffa500;
}

.ss-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ss-thumb-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: rgba(0, 0, 0, 0.75);
    color: #ff5252;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
    padding: 0;
}

.ss-thumb:hover .ss-thumb-remove {
    opacity: 1;
}

.ss-thumb-add {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #555;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
}

.ss-thumb-add:hover {
    border-color: #ffa500;
    background: rgba(255, 165, 0, 0.08);
}

.ss-thumb-add span {
    font-size: 24px;
    color: #888;
    font-weight: 300;
}

.ss-thumb-add:hover span {
    color: #ffa500;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .steps { grid-template-columns: 1fr; }
    .pricing-cards { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .settings-grid { grid-template-columns: 1fr; }
    .provider-section { grid-template-columns: 1fr; }
    .actions { flex-direction: column; }
    .nav-links { gap: 14px; }
}
