/*
 * SqueezeVid Premium Theme CSS
 * All color tokens inherited from base.html :root
 */

/* Card Components */
.card {
    background-color: var(--bg-surface);
    border-radius: 16px;
    box-shadow: 0 2px 12px var(--shadow-sm), 0 0 0 1px var(--border-subtle);
    overflow: hidden;
    margin-bottom: 2.5rem;
    margin-top: 2rem;
    animation: fadeSlideUp 0.4s ease-out;
}

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

.card-header {
    background-color: var(--bg-surface);
    padding: 2rem 2rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.card-header h1,
.card-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.card-header hr {
    border: none;
    height: 2px;
    background: linear-gradient(to right, var(--lemon-primary), var(--lemon-green), transparent);
    margin: 0.75rem 0;
    opacity: 0.6;
}

.intro-text {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.65;
}

.card-body {
    padding: 2rem;
}

/* Form Controls */
#videoInput {
    display: none;
}

.form-group {
    margin-bottom: 1.75rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.625rem;
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0.01em;
    color: var(--text-secondary);
}

.range-container {
    display: flex;
    align-items: center;
}

.range-value {
    background-color: var(--lemon-primary-light);
    border: 1px solid var(--border-default);
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 60px;
    text-align: center;
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-default);
    border-radius: 10px;
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9375rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: var(--lemon-green);
    outline: none;
    box-shadow: 0 0 0 3px var(--lemon-green-light);
}

/* Range Slider Styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: var(--lemon-primary-light);
    border-radius: 6px;
    height: 8px;
    cursor: pointer;
    margin-right: 1rem;
    width: 100%;
    padding: 0;
    border: 1px solid var(--border-default);
    flex-grow: 1;
    outline: none;
}

/* Webkit Slider Thumb */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background-color: var(--lemon-green);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--bg-surface);
    box-shadow: 0 1px 4px var(--shadow-md);
}

/* Mozilla Slider Thumb */
input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    background: var(--lemon-green);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--bg-surface);
    box-shadow: 0 1px 4px var(--shadow-md);
}

/* Slider with colored track */
input[type="range"] {
    background: linear-gradient(to right, var(--lemon-green) 0%, var(--lemon-green) calc((var(--value) - var(--min)) / (var(--max) - var(--min)) * 100%), var(--lemon-primary-light) calc((var(--value) - var(--min)) / (var(--max) - var(--min)) * 100%), var(--lemon-primary-light) 100%);
    --value: 26;
    --min: 18;
    --max: 32;
}

/* Estimation Info Box */
.estimation-info {
    background-color: var(--bg-surface);
    border-radius: 10px;
    padding: 1.125rem;
    border: 1px solid var(--border-subtle);
}

.estimation-status {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.estimation-status i {
    margin-right: 0.5rem;
    color: var(--lemon-primary-dark);
}

.estimation-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.estimation-note {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    font-style: italic;
    margin-top: 0.5rem;
}

/* Settings Toggle & Panel */
.settings-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1.125rem;
    background-color: var(--lemon-primary-light);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    cursor: pointer;
    margin: 1.25rem 0;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.settings-toggle:hover {
    background-color: var(--lemon-primary);
    border-color: var(--lemon-primary);
    color: var(--text-primary);
}

.settings-toggle i {
    transition: transform 0.25s ease;
    color: var(--text-tertiary);
}

.settings-panel {
    background-color: var(--bg-surface);
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 0.75rem;
    border: 1px solid var(--border-subtle);
}

.settings-panel.collapsed {
    display: none;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9375rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-icon {
    margin-right: 0.5rem;
}

.btn-primary {
    background-color: var(--lemon-green);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(91, 140, 90, 0.2);
}

.btn-primary:hover {
    background-color: var(--lemon-green-dark);
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(91, 140, 90, 0.3);
}

.btn-success {
    background-color: var(--lemon-green);
    color: #FFFFFF;
    flex: 1;
    box-shadow: 0 2px 8px rgba(91, 140, 90, 0.2);
}

.btn-success:hover {
    background-color: var(--lemon-green-dark);
    color: #FFFFFF;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--border-default);
    color: var(--text-secondary);
    flex: 1;
}

.btn-outline:hover {
    border-color: var(--lemon-primary);
    background-color: var(--lemon-primary-light);
    color: var(--text-primary);
}

/* Output Container */
.output-container {
    display: none;
    margin-top: 1.75rem;
}

/* Video Preview */
.video-preview-container {
    margin-bottom: 1rem;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
}

.video-preview {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 1rem;
    background-color: #1A1918;
}

.gif-preview {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-subtle);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Progress Bar */
.progress-container {
    display: none;
    margin: 1.75rem 0;
    background-color: var(--bg-surface);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border-subtle);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.625rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
}

.progress-bar-container {
    height: 8px;
    background-color: var(--lemon-primary-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.625rem;
}

.progress-bar {
    height: 100%;
    background-color: var(--lemon-green);
    border-radius: 4px;
    width: 0;
    transition: width 0.4s ease;
    background-image: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite linear;
}

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

.progress-status {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Comparison Styles */
.comparison {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.comparison-item {
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding: 1rem;
    background-color: var(--lemon-primary-light);
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
}

.comparison-value {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.comparison-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Format Section Styling */
.format-section {
    margin: 2.5rem 0;
    padding: 2rem 2.5rem;
    background-color: var(--bg-surface);
    border-radius: 16px;
    box-shadow: 0 2px 12px var(--shadow-sm), 0 0 0 1px var(--border-subtle);
}

.format-heading {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-subtle);
    display: flex;
    align-items: center;
}

.format-heading i {
    margin-right: 0.5rem;
    color: var(--lemon-primary-dark);
}

.format-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.format-card {
    flex: 1 1 180px;
    max-width: 240px;
    min-width: 160px;
    background-color: var(--bg-page);
    border-radius: 12px;
    padding: 1.5rem 1.25rem;
    text-align: center;
    box-shadow: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.format-card:hover {
    transform: translateY(-3px);
    border-color: var(--lemon-primary);
    background-color: var(--lemon-primary-light);
    box-shadow: 0 6px 16px var(--shadow-md);
}

.format-icon {
    width: 52px;
    height: 52px;
    background-color: var(--lemon-primary-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.875rem;
    transition: background-color 0.2s ease;
}

.format-card:hover .format-icon {
    background-color: var(--lemon-primary);
}

.format-icon i {
    font-size: 1.25rem;
    color: var(--lemon-primary-dark);
}

.format-card:hover .format-icon i {
    color: var(--text-primary);
}

.format-type {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.375rem;
    color: var(--text-primary);
}

.format-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* FAQ Section Styles */
.faq-section {
    background-color: var(--bg-surface);
    border-radius: 16px;
    padding: 2rem 2.5rem;
    margin: 2.5rem 0;
    box-shadow: 0 2px 12px var(--shadow-sm), 0 0 0 1px var(--border-subtle);
}

.faq-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.faq-item {
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.faq-item:hover {
    border-color: var(--border-default);
}

.faq-question {
    background-color: var(--bg-surface);
    padding: 1.125rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.15s ease;
}

.faq-question:hover {
    background-color: var(--lemon-primary-light);
}

.faq-question i {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    transition: transform 0.25s ease;
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.9375rem;
}

.faq-answer.active {
    padding: 1rem 1.5rem 1.25rem;
    max-height: 500px;
}

/* Responsive design */
@media (max-width: 768px) {
    .card {
        margin: 1rem 0;
    }

    .card-header {
        padding: 1.5rem 1.25rem 1.25rem;
    }

    .card-header h1,
    .card-header h2 {
        font-size: 1.35rem;
    }

    .card-body {
        padding: 1.5rem 1.25rem;
    }

    .comparison {
        flex-direction: column;
    }

    .comparison-item {
        min-width: auto;
    }

    .action-buttons {
        flex-direction: column;
    }

    .format-section,
    .faq-section {
        padding: 1.5rem 1.25rem;
        border-radius: 12px;
    }

    .format-card {
        min-width: 140px;
        padding: 1.25rem 1rem;
    }

    .format-icon {
        width: 44px;
        height: 44px;
    }

    .format-type {
        font-size: 0.9375rem;
    }

    .format-desc {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .format-card {
        min-width: 120px;
        flex: 1 1 120px;
    }

    .range-container {
        flex-direction: column;
        align-items: stretch;
    }

    .range-value {
        align-self: flex-end;
        margin-top: 0.5rem;
        margin-left: 0;
    }
}

/* ── Desired-size chips (compression-trust UX) ─────────────────── */
.size-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.25rem 0 0.5rem;
}
.size-chip {
    border: 1.5px solid var(--border-default);
    background: var(--bg-surface);
    color: var(--text-primary);
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.size-chip:hover:not(:disabled) { border-color: var(--lemon-green); }
.size-chip.active {
    background: var(--lemon-green-light);
    border-color: var(--lemon-green);
}
.size-chip:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.size-chip .chip-quality {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.size-chip.active .chip-quality { color: var(--lemon-green-dark); }

.auto-tune-notice {
    margin-top: 0.5rem;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    font-size: 0.85rem;
    background: var(--lemon-primary-light);
    border-left: 3px solid var(--lemon-primary);
    color: var(--text-primary);
}

.resist-notice {
    background: var(--lemon-primary-light);
    border-left: 3px solid var(--lemon-primary-dark);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.resist-notice h4 { margin: 0 0 0.5rem; font-size: 1rem; }
.resist-notice p { margin: 0 0 0.75rem; font-size: 0.9rem; color: var(--text-secondary); }
#downloadLink.btn-muted {
    background: transparent;
    border: 1.5px solid var(--border-default);
    color: var(--text-secondary);
    box-shadow: none;
}

/* ── Feedback: indeterminate bar, CTA pulse, engine pill ───────── */
.progress-bar.indeterminate {
    width: 30% !important;
    animation: indeterminate-slide 1.2s ease-in-out infinite;
}
@keyframes indeterminate-slide {
    0% { margin-left: 0; }
    50% { margin-left: 70%; }
    100% { margin-left: 0; }
}
@keyframes cta-pulse-kf {
    0%, 100% { box-shadow: 0 2px 8px rgba(91, 140, 90, 0.25); }
    50% { box-shadow: 0 0 0 8px rgba(91, 140, 90, 0.18); }
}
#compressBtn.cta-pulse { animation: cta-pulse-kf 1s ease-in-out 2; }
.engine-status-row { text-align: center; margin-top: 0.5rem; }
.engine-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
}
