:root {
    --primary-blue: #0062ff;
    --soft-bg: #f8fafc;
    --text-dark: #1e293b;
    --border-radius: 24px;
    --card-bg: #ffffff;
}

[data-theme='dark'] {
    --soft-bg: #0f172a;
    --text-dark: #f1f5f9;
    --card-bg: #1e293b;
}

body { 
    font-family: 'Plus Jakarta Sans', sans-serif; 
    background-color: var(--soft-bg); 
    color: var(--text-dark);
    padding-top: 90px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme='dark'] .navbar,
[data-theme='dark'] .u-card,
[data-theme='dark'] .footer-main,
[data-theme='dark'] .product-row,
[data-theme='dark'] .stat-box,
[data-theme='dark'] .bg-light,
[data-theme='dark'] .bg-white,
[data-theme='dark'] .border {
    background: var(--card-bg) !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

[data-theme='dark'] h1, 
[data-theme='dark'] h2, 
[data-theme='dark'] h3, 
[data-theme='dark'] h4, 
[data-theme='dark'] h5, 
[data-theme='dark'] h6,
[data-theme='dark'] .text-dark,
[data-theme='dark'] .navbar-brand {
    color: #ffffff !important;
}

[data-theme='dark'] .label-custom { color: #94a3b8 !important; }
[data-theme='dark'] .border-blue-soft { border-color: rgba(0, 98, 255, 0.3) !important; }

[data-theme='dark'] .form-control {
    background: #0f172a !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

[data-theme='dark'] .bg-light-soft,
[data-theme='dark'] .bg-light {
    background: #111827 !important;
    color: #f1f5f9 !important;
}

[data-theme='dark'] .text-muted {
    color: #94a3b8 !important;
}

[data-theme='dark'] .bg-white {
    background: var(--card-bg) !important;
}

[data-theme='dark'] .border-bottom,
[data-theme='dark'] .border-top {
    border-color: #334155 !important;
}

[data-theme='dark'] .accordion-button {
    background-color: var(--card-bg) !important;
    color: #ffffff !important;
}

[data-theme='dark'] .accordion-item {
    background-color: transparent !important;
    border-color: #334155 !important;
}

#themeToggle {
    padding: 0.6rem 1.2rem !important;
    font-size: 0.95rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#langSelect {
    padding: 0.6rem 2.2rem 0.6rem 1.2rem !important;
    font-size: 0.95rem !important;
    min-height: 45px;
}

#themeToggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1) !important;
}

main {
    flex: 1 0 auto;
    padding-bottom: 40px;
}

.stat-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: var(--primary-blue);
}

.stat-box i {
    opacity: 0.9;
}

.feature-card {
    border-top: 4px solid var(--primary-blue) !important;
    text-align: center;
    padding: 3rem 2rem !important;
    transition: all 0.3s ease;
    border-radius: 24px !important;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 98, 255, 0.1) !important;
}

.feature-card i {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 5px 10px rgba(0, 98, 255, 0.2));
}

.feature-card h6 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.feature-card p {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.6;
    font-weight: 500;
}

.step-num {
    width: 40px;
    height: 40px;
    background: var(--primary-blue);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    margin: 0 auto;
    box-shadow: 0 4px 10px rgba(0, 98, 255, 0.2);
}

.how-it-works .u-card {
    border: 1px solid #f1f5f9;
    padding: 2.5rem 1.5rem !important;
}

[data-theme='dark'] .how-it-works .u-card {
    border-color: #334155;
}

.faq-container { padding-bottom: 50px; }

.accordion-item {
    background: transparent !important;
    border-color: #f1f5f9 !important;
}

[data-theme='dark'] .accordion-item {
    border-color: #334155 !important;
}

.accordion-button {
    background: transparent !important;
    padding: 1.8rem 1.5rem !important;
    box-shadow: none !important;
    font-size: 1.35rem !important;
    font-weight: 800 !important;
    color: var(--text-dark) !important;
}

.accordion-button:not(.collapsed) {
    color: var(--primary-blue) !important;
    background: rgba(0, 98, 255, 0.03) !important;
}

[data-theme='dark'] .accordion-button {
    color: #f1f5f9 !important;
}

[data-theme='dark'] .accordion-button:not(.collapsed) {
    background: rgba(0, 98, 255, 0.1) !important;
}

.accordion-button::after {
    filter: grayscale(1) invert(0.5);
    transform: scale(1.2);
}

.accordion-body {
    padding-top: 0 !important;
    padding-bottom: 2rem !important;
    font-size: 0.95rem !important;
    color: #64748b !important;
    line-height: 1.8 !important;
    font-weight: 500 !important;
}

/* Scroll to Top Arrow */
.btn-scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 98, 255, 0.3);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.btn-scroll-top.show {
    display: flex;
    opacity: 1;
}

.btn-scroll-top:hover {
    transform: translateY(-5px);
    background: #004ecc;
}

/* Footer & Nav Fixes */
footer {
    margin-top: auto;
    width: 100%;
}

.fw-800 { font-weight: 800; }

.bg-light-soft {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    transition: all 0.2s;
}

.bg-light-soft:hover {
    background: #ffffff !important;
    border-color: var(--primary-blue) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 98, 255, 0.05);
}

[data-theme='dark'] .bg-light-soft {
    background: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
}

[data-theme='dark'] .bg-light-soft:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--primary-blue) !important;
}

#resultLoader {
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

[data-theme='dark'] #resultLoader {
    background: rgba(15, 23, 42, 0.8) !important;
}

.bg-light-soft .fw-bold {
    font-size: 1rem !important;
    margin-bottom: 4px;
}

.tiny { font-size: 0.85rem; line-height: 1.5; color: #64748b; }
[data-theme='dark'] .tiny { color: #94a3b8; }



.u-card {
    background: #ffffff;
    padding: 35px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 98, 255, 0.05);
    border: 1px solid rgba(0, 98, 255, 0.05);
}

.border-blue-soft {
    border: 2px solid rgba(0, 98, 255, 0.15) !important;
}

.navbar-brand { font-weight: 800; letter-spacing: 1px; color: var(--text-dark) !important; }
.text-blue { color: var(--primary-blue); }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

.section-header h5 {
    display: flex;
    align-items: center;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text-dark);
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
}

.section-header h5 i {
    color: var(--primary-blue);
    margin-right: 12px;
}

.btn-paste {
    z-index: 5;
    background: #e2e8f0;
    border: none;
    border-radius: 0 12px 12px 0;
    padding: 12px 18px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dark);
    transition: all 0.2s;
    border-left: 1px solid rgba(0, 0, 0, 0.05);
}

.form-control {
    background: #f1f5f9;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 12px 18px;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.input-group .form-control {
    border-radius: 0 !important;
}

.input-group .input-group-text {
    border-radius: 12px 0 0 12px !important;
}

[data-theme='dark'] .btn-paste {
    background: #334155;
    color: #f1f5f9;
}

.btn-paste:hover {
    background: #cbd5e1;
}

[data-theme='dark'] .btn-paste:hover {
    background: #475569;
}

::placeholder {
    color: #94a3b8 !important;
    opacity: 0.7;
}

[data-theme='dark'] .form-control::placeholder {
    color: #64748b !important;
    opacity: 1;
}

.btn-paste:hover {
    background: var(--primary-blue);
    color: #ffffff;
}

[data-theme='dark'] .btn-paste:hover {
    background: var(--primary-blue);
    color: #ffffff;
}

.product-row {
    background: #fdfdfe;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid #f1f5f9;
}

.btn-main {
    background: var(--primary-blue);
    color: white !important;
    padding: 12px 25px;
    border-radius: 15px;
    font-weight: 700;
    border: none;
    transition: 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-main:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0, 98, 255, 0.2); }

/* ── Download MP3 button — theme-matched outlined blue ─────────────── */
.btn-mp3 {
    background: rgba(0, 98, 255, 0.07);
    color: var(--primary-blue) !important;
    border: 2px solid rgba(0, 98, 255, 0.3);
    border-radius: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-mp3:hover {
    background: var(--primary-blue);
    color: #ffffff !important;
    border-color: var(--primary-blue);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 98, 255, 0.2);
}

.btn-mp3:hover .btn-mp3-sub {
    color: rgba(255,255,255,0.75) !important;
}

[data-theme='dark'] .btn-mp3 {
    background: rgba(0, 98, 255, 0.12);
    border-color: rgba(0, 98, 255, 0.4);
    color: #60a5fa !important;
}

[data-theme='dark'] .btn-mp3:hover {
    background: var(--primary-blue);
    color: #ffffff !important;
    border-color: var(--primary-blue);
}

/* Subtitle text under both download buttons */
.btn-mp3-sub {
    font-size: 0.68rem;
    font-weight: 600;
    opacity: 0.65;
    letter-spacing: 0.03em;
}

.btn-main .btn-mp3-sub {
    color: rgba(255,255,255,0.8);
    opacity: 1;
}


.history-item { 
    transition: all 0.2s; 
    border-bottom: 1px solid #f8fafc;
    background: #ffffff;
    cursor: pointer;
}

[data-theme='dark'] .history-item {
    border-color: #334155;
    background: #1e293b;
}

.history-item:hover { 
    transform: scale(1.005); 
    background: #f0f7ff !important; 
}

.history-item .h-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-dark);
}

.history-item .h-author {
    font-size: 0.9rem;
    color: var(--primary-blue);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pill { font-size: 0.7rem; padding: 4px 12px; border-radius: 50px; font-weight: 800; }
.st-finished { background: #d4edda; color: #155724; }

.label-custom { font-weight: 700; font-size: 0.75rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; }
.tiny { font-size: 0.65rem; }
.tracking-01 { letter-spacing: 0.1em; }

.object-fit-cover {
    object-fit: cover;
}

.config-select {
    border: 2px solid rgba(0, 98, 255, 0.1) !important;
    background-color: #f0f7ff !important;
    color: var(--primary-blue) !important;
    border-radius: 12px !important;
    padding: 10px 35px 10px 15px !important;
    font-size: 0.85rem !important;
    cursor: pointer;
    transition: all 0.2s ease;
    width: auto;
    min-width: 130px;
}

.config-select:hover {
    border-color: var(--primary-blue) !important;
    background-color: #e6f1fe !important;
}

.config-select:focus {
    box-shadow: 0 0 0 4px rgba(0, 98, 255, 0.1) !important;
}

.truncate-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Footer Section */
.footer-main {
    background: #ffffff;
    border-top: 1px solid #eef2f6;
    margin-top: 80px;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #64748b;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.footer-links a:hover {
    color: var(--primary-blue);
    padding-left: 5px;
}

.footer-main h6.label-custom {
    color: var(--text-dark);
    margin-bottom: 25px;
}

.footer-main .text-muted {
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════
   VIDEO STUDIO — Theme-Aware Styles
   ═══════════════════════════════════════════════════ */

/* Studio CSS Variables — Light Mode defaults */
:root {
    --studio-bg:            #f8faff;
    --studio-panel-bg:      #eef4ff;
    --studio-panel-border:  rgba(0, 98, 255, 0.1);
    --studio-title:         var(--text-dark);
    --studio-muted:         #64748b;
    --studio-badge-bg:      rgba(0, 98, 255, 0.07);
    --studio-range-track:   rgba(0, 98, 255, 0.15);
    --studio-loader-bg:     #f8faff;
    --studio-progress-bg:   rgba(0, 98, 255, 0.1);
}

/* Dark Mode overrides */
[data-theme='dark'] {
    --studio-bg:            #0f172a;
    --studio-panel-bg:      rgba(0, 98, 255, 0.08);
    --studio-panel-border:  rgba(0, 98, 255, 0.2);
    --studio-title:         #e2e8f0;
    --studio-muted:         #94a3b8;
    --studio-badge-bg:      rgba(0, 98, 255, 0.12);
    --studio-range-track:   rgba(0, 98, 255, 0.25);
    --studio-loader-bg:     #0f172a;
    --studio-progress-bg:   rgba(0, 98, 255, 0.15);
}

/* Modal Content Shell */
.studio-modal-content {
    background: var(--studio-bg);
}

/* Modal Header — Blue Gradient always */
.studio-modal-header {
    background: linear-gradient(135deg, #0062ff 0%, #004bd4 100%);
}

/* Loader area */
.studio-loader {
    background: var(--studio-loader-bg);
}
.studio-progress-msg {
    color: var(--studio-title);
}
.studio-progress-track {
    background: var(--studio-progress-bg);
    height: 6px;
    border-radius: 10px;
    overflow: hidden;
}
.studio-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0062ff, #00d2ff);
    border-radius: 10px;
    transition: width 0.4s ease;
}

/* Body */
.studio-modal-body {
    background: var(--studio-bg);
}

/* Controls Panel */
.studio-panel {
    background: var(--studio-panel-bg);
    border: 1px solid var(--studio-panel-border);
}
.studio-panel-title {
    color: var(--studio-title);
}

/* Duration Badge */
.studio-duration-badge {
    background: var(--studio-badge-bg);
    border: 1px solid var(--studio-panel-border);
}

/* Custom Range Slider */
.studio-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--studio-range-track);
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    transition: background 0.2s;
}
.studio-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0062ff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 98, 255, 0.4);
    border: 3px solid #fff;
    transition: transform 0.15s, box-shadow 0.15s;
}
.studio-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 16px rgba(0, 98, 255, 0.5);
}
.studio-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0062ff;
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 98, 255, 0.4);
}
[data-theme='dark'] .studio-range::-webkit-slider-thumb {
    border-color: #1e293b;
}
[data-theme='dark'] .studio-range::-moz-range-thumb {
    border-color: #1e293b;
}

/* Video Preview Wrap */
.video-preview-wrap {
    width: 100%;
    min-height: 220px;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.video-preview-wrap video {
    width: 100%;
    max-height: 360px;
    object-fit: contain;
    display: block;
    background: #000;
}

/* Video Studio "Open" Button */
.btn-studio {
    display: flex;
    align-items: center;
    cursor: pointer;
    border: none;
    outline: none;
    background: linear-gradient(135deg, #0062ff 0%, #3a86ff 60%, #0047cc 100%);
    color: #fff !important;
    font-family: inherit;
    box-shadow: 0 4px 20px rgba(0, 98, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.btn-studio::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
    pointer-events: none;
}
.btn-studio:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 98, 255, 0.4);
    filter: brightness(1.08);
}
.btn-studio:active {
    transform: translateY(-1px);
}
[data-theme='dark'] .btn-studio {
    background: linear-gradient(135deg, #0062ff 0%, #1d4ed8 100%);
    box-shadow: 0 4px 20px rgba(0, 98, 255, 0.4), 0 0 0 1px rgba(0, 98, 255, 0.3);
}


/* Loading Ring Spinner */
.loading-ring {
    display: inline-block;
    position: relative;
    width: 64px;
    height: 64px;
}
.loading-ring div {
    box-sizing: border-box;
    display: block;
    position: absolute;
    width: 51px;
    height: 51px;
    margin: 6px;
    border: 6px solid #0062ff;
    border-radius: 50%;
    animation: loading-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    border-color: #0062ff transparent transparent transparent;
}
.loading-ring div:nth-child(1) { animation-delay: -0.45s; }
.loading-ring div:nth-child(2) { animation-delay: -0.3s;  }
.loading-ring div:nth-child(3) { animation-delay: -0.15s; }
@keyframes loading-ring {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

