/* Audio to Video Tool Styles */

/* === Background Type Selector (card-style) === */
.atv-bg-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.atv-bg-option {
    position: relative;
}

.atv-bg-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.atv-bg-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0;
    text-align: center;
}

.atv-bg-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.atv-bg-icon .fsvg {
    width: 18px;
    height: 18px;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.atv-bg-label span {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.3s ease;
}

.atv-bg-label:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.atv-bg-label:hover .atv-bg-icon {
    background: #e8edf3;
}

.atv-bg-label:hover .atv-bg-icon .fsvg {
    opacity: 0.8;
}

.atv-bg-input:checked + .atv-bg-label {
    border-color: var(--bs-primary-text-emphasis);
    background: var(--bs-primary-bg-subtle);
    box-shadow: 0 2px 8px rgba(5, 44, 101, 0.15);
}

.atv-bg-input:checked + .atv-bg-label .atv-bg-icon {
    background: var(--bs-primary-text-emphasis);
}

.atv-bg-input:checked + .atv-bg-label .atv-bg-icon .fsvg {
    filter: brightness(0) invert(1);
    opacity: 1;
}

.atv-bg-input:checked + .atv-bg-label span {
    color: var(--bs-primary-text-emphasis);
    font-weight: 700;
}

/* === Resolution Selector (card-style with icons) === */
.atv-size-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.atv-size-option {
    position: relative;
}

.atv-size-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.atv-size-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0;
}

.atv-size-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 8px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.atv-size-icon .fsvg {
    width: 18px;
    height: 18px;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.atv-size-text {
    flex: 1;
    min-width: 0;
}

.atv-size-name {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    transition: color 0.3s ease;
}

.atv-size-desc {
    font-size: 11px;
    color: #9ca3af;
    transition: color 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.atv-size-label:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.atv-size-label:hover .atv-size-icon {
    background: #e8edf3;
}

.atv-size-label:hover .atv-size-icon .fsvg {
    opacity: 0.8;
}

.atv-size-input:checked + .atv-size-label {
    border-color: var(--bs-primary-text-emphasis);
    background: var(--bs-primary-bg-subtle);
    box-shadow: 0 2px 8px rgba(5, 44, 101, 0.15);
    transform: translateY(0);
}

.atv-size-input:checked + .atv-size-label .atv-size-icon {
    background: var(--bs-primary-text-emphasis);
}

.atv-size-input:checked + .atv-size-label .atv-size-icon .fsvg {
    filter: brightness(0) invert(1);
    opacity: 1;
}

.atv-size-input:checked + .atv-size-label .atv-size-name {
    color: var(--bs-primary-text-emphasis);
}

.atv-size-input:checked + .atv-size-label .atv-size-desc {
    color: var(--bs-primary-text-emphasis);
    opacity: 0.8;
}

/* === Color Presets === */
.atv-color-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.atv-color-preset {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 3px;
    background: #ffffff;
}

.atv-color-preset span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 6px;
}

.atv-color-preset:hover {
    transform: scale(1.15);
    border-color: var(--bs-primary-text-emphasis);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

/* === Gradient Presets === */
.atv-gradient-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.atv-gradient-preset {
    width: 52px;
    height: 36px;
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 3px;
    background: #ffffff;
}

.atv-gradient-preset span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 6px;
}

.atv-gradient-preset:hover {
    transform: scale(1.1);
    border-color: var(--bs-primary-text-emphasis);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

/* === Background Image Upload Zone === */
.atv-image-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px;
    background: #f9fafb;
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.atv-image-upload:hover {
    border-color: var(--bs-primary-text-emphasis);
    background: var(--bs-primary-bg-subtle);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 44, 101, 0.08);
}

.atv-image-upload-text {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.atv-image-upload-hint {
    font-size: 11px;
    color: #9ca3af;
}

.atv-bg-image-preview {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    margin-top: 8px;
}

/* === Background Preview Box === */
.atv-bg-preview {
    width: 100%;
    height: 140px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a2e;
    overflow: hidden;
    transition: all 0.3s ease;
}

.atv-bg-preview-label {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === Background Content Animation === */
.atv-bg-content {
    animation: atvFadeIn 0.3s ease;
}

@keyframes atvFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Video Preview === */
.video-preview-wrapper {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.video-preview {
    width: 100%;
    height: auto;
    max-height: 450px;
    display: block;
    background: #000;
}

/* === File Selected Indicator === */
.file-selected-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 6px 12px;
    background: rgba(25, 135, 84, 0.1);
    border-radius: 8px;
}

.selected-file-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--bs-body-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* === Card Styling === */
.card {
    border-radius: 10px;
    border: 1px dotted var(--bs-dark-bg-subtle);
    background: var(--bs-light-border-subtle);
}

.card-header {
    background: var(--bs-secondary-bg-subtle);
    border-bottom: 1px dotted var(--bs-dark-bg-subtle);
}

/* === Progress Bar === */
#progressContainer {
    margin-top: 20px;
}

.progress {
    height: 30px;
    font-size: 14px;
}

/* === Prevent text selection === */
.form-label {
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}

.form-text {
    user-select: none;
    -webkit-user-select: none;
    cursor: default;
}

/* Filter SVG for dark mode */
.filter-svg {
    filter: none;
}

[data-bs-theme="dark"] .filter-svg {
    filter: invert(1) brightness(0.8);
}

/* Button icons */
.btn img {
    display: inline-block;
    vertical-align: middle;
}

/* ============================================
   DARK MODE
   ============================================ */

[data-bs-theme="dark"] .card {
    background-color: rgba(30, 34, 42, 0.6);
    border-color: rgba(168, 85, 247, 0.3);
}

[data-bs-theme="dark"] .card-header {
    background: rgba(30, 34, 42, 0.8);
    border-bottom-color: rgba(168, 85, 247, 0.3);
}

[data-bs-theme="dark"] .video-preview-wrapper {
    background: #000;
}

/* Dark - BG Type Selector */
[data-bs-theme="dark"] .atv-bg-label {
    background: #1a1d23;
    border-color: #343a40;
}

[data-bs-theme="dark"] .atv-bg-label span {
    color: #9ca3af;
}

[data-bs-theme="dark"] .atv-bg-icon {
    background: #2d3239;
}

[data-bs-theme="dark"] .atv-bg-label:hover {
    border-color: #495057;
    background: #2d3239;
}

[data-bs-theme="dark"] .atv-bg-label:hover .atv-bg-icon {
    background: #3a3f47;
}

[data-bs-theme="dark"] .atv-bg-input:checked + .atv-bg-label {
    border-color: var(--bs-primary-text-emphasis);
    background: rgba(5, 44, 101, 0.3);
}

[data-bs-theme="dark"] .atv-bg-input:checked + .atv-bg-label span {
    color: var(--bs-primary-text-emphasis);
}

/* Dark - Size Selector */
[data-bs-theme="dark"] .atv-size-label {
    background: #1a1d23;
    border-color: #343a40;
}

[data-bs-theme="dark"] .atv-size-name {
    color: #e5e7eb;
}

[data-bs-theme="dark"] .atv-size-desc {
    color: #6b7280;
}

[data-bs-theme="dark"] .atv-size-icon {
    background: #2d3239;
}

[data-bs-theme="dark"] .atv-size-label:hover {
    border-color: #495057;
    background: #2d3239;
}

[data-bs-theme="dark"] .atv-size-label:hover .atv-size-icon {
    background: #3a3f47;
}

[data-bs-theme="dark"] .atv-size-input:checked + .atv-size-label {
    border-color: var(--bs-primary-text-emphasis);
    background: rgba(5, 44, 101, 0.3);
}

[data-bs-theme="dark"] .atv-size-input:checked + .atv-size-label .atv-size-name,
[data-bs-theme="dark"] .atv-size-input:checked + .atv-size-label .atv-size-desc {
    color: var(--bs-primary-text-emphasis);
}

/* Dark - Color Presets */
[data-bs-theme="dark"] .atv-color-preset {
    border-color: #343a40;
    background: #1a1d23;
}

[data-bs-theme="dark"] .atv-color-preset:hover {
    border-color: #6ea8fe;
}

/* Dark - Gradient Presets */
[data-bs-theme="dark"] .atv-gradient-preset {
    border-color: #343a40;
    background: #1a1d23;
}

[data-bs-theme="dark"] .atv-gradient-preset:hover {
    border-color: #6ea8fe;
}

/* Dark - Image Upload */
[data-bs-theme="dark"] .atv-image-upload {
    background: #1a1d23;
    border-color: #343a40;
}

[data-bs-theme="dark"] .atv-image-upload:hover {
    background: #2d3239;
    border-color: #6ea8fe;
}

[data-bs-theme="dark"] .atv-image-upload-text {
    color: #e5e7eb;
}

[data-bs-theme="dark"] .atv-bg-image-preview {
    border-color: rgba(255, 255, 255, 0.1);
}

/* Dark - BG Preview */
[data-bs-theme="dark"] .atv-bg-preview {
    border-color: rgba(255, 255, 255, 0.1);
}

/* Dark - File Selected */
[data-bs-theme="dark"] .file-selected-indicator {
    background: rgba(25, 135, 84, 0.15);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .video-preview {
        max-height: 300px;
    }

    .atv-bg-preview {
        height: 100px;
    }

    .atv-size-selector {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .atv-size-label {
        padding: 10px;
    }

    .atv-size-icon {
        width: 30px;
        height: 30px;
    }

    .atv-size-icon .fsvg {
        width: 16px;
        height: 16px;
    }

    .atv-size-name {
        font-size: 12px;
    }

    .atv-size-desc {
        font-size: 10px;
    }

    .atv-bg-selector {
        gap: 8px;
    }

    .atv-bg-label {
        padding: 10px 6px;
    }

    .atv-bg-icon {
        width: 32px;
        height: 32px;
    }

    .atv-color-presets {
        gap: 6px;
    }

    .atv-color-preset {
        width: 32px;
        height: 32px;
    }

    .atv-gradient-preset {
        width: 44px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .atv-size-selector {
        grid-template-columns: 1fr;
    }
}
