/* ========================================
   Presentation Video Generator Styles
   ======================================== */

/* ========================================
   Introduction Section
   ======================================== */
.intro-section {
    background-color: var(--bg-front);
    border: 1px solid var(--border-weak);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.intro-text {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.steps-list {
    margin-left: 1.5rem;
    color: var(--text-secondary);
}

.steps-list li {
    margin-bottom: 0.5rem;
}

.steps-list strong {
    color: var(--text-primary);
}

/* ========================================
   Step Sections
   ======================================== */
.step-section {
    background-color: var(--bg-front);
    border: 1px solid var(--border-weak);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.step-header {
    font-size: 1.4rem;
    color: var(--text-heading);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.step-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-style: italic;
}

/* ========================================
   Upload Section
   ======================================== */
.upload-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.upload-area {
    display: flex;
    flex-direction: column;
    min-height: 180px;
}

.upload-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--bg-contrast);
}

.upload-dropzone:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-hover);
}

.upload-dropzone:hover .upload-text,
.upload-dropzone:hover .upload-subtext {
    color: var(--text-on-primary);
}

.upload-dropzone.drag-over {
    border-color: var(--primary-color);
    background-color: var(--primary-hover);
    transform: scale(1.02);
}

.upload-dropzone.drag-over .upload-text,
.upload-dropzone.drag-over .upload-subtext {
    color: var(--text-on-primary);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.upload-subtext {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.selected-file {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
    background-color: var(--primary-bg);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    min-height: 180px;
}

/* Dark mode override for selected file */
[data-theme="dark"] .selected-file {
    background-color: rgba(6, 134, 103, 0.2);
}

.file-icon {
    font-size: 1.5rem;
}

.file-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
}

/* Dark mode override for file name in selected state */
[data-theme="dark"] .selected-file .file-name {
    color: var(--primary-color);
}

.btn-remove-file {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-remove-file:hover {
    color: var(--error-text);
    background-color: var(--error-color);
}

.context-area {
    display: flex;
    flex-direction: column;
}

.input-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.context-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 100px;
    background-color: var(--bg-default);
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}

/* ========================================
   Download & Translate Section
   ======================================== */
.download-translate-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

.translate-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.translate-select {
    min-width: 150px;
}

@media (max-width: 768px) {
    .download-translate-row {
        flex-direction: column;
    }
    
    .translate-controls {
        width: 100%;
        justify-content: center;
    }
}


.context-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.context-input::placeholder {
    color: var(--text-disabled);
}

/* ========================================
   Buttons (Extended)
   ======================================== */
.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* ========================================
   Progress Indicator
   ======================================== */
.progress-container {
    margin-top: 1.5rem;
}

.progress-bar {
    height: 8px;
    background-color: var(--bg-contrast);
    border-radius: 4px;
    overflow: hidden;
}

/* Enhanced progress bar animation */
.progress-fill {
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--primary-color) 0%,
        var(--primary-hover) 50%,
        var(--primary-color) 100%
    );
    background-size: 200% 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
    animation: shimmer 2s infinite linear;
}

.progress-fill.completed {
    background: var(--primary-color);
    animation: none;
}

.progress-step {
    margin: 0.5rem 0 0 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}

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

/* ========================================
   Slides Container
   ======================================== */
.slides-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.slide-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-weak);
    border-radius: 8px;
    overflow: hidden;
}

.slide-header {
    background-color: var(--bg-contrast);
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--text-heading);
    border-bottom: 1px solid var(--border-weak);
}

.slide-content {
    display: grid;
    grid-template-columns: 3fr 5fr;
    gap: 1.5rem;
    padding: 1.5rem;
}

@media (max-width: 900px) {
    .slide-content {
        grid-template-columns: 1fr;
    }
}

.slide-image-container {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.slide-image {
    width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid var(--border-weak);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.slide-notes-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.slide-notes-container .input-label {
    padding-bottom: 0rem;
    margin-bottom: 0rem;
    border-bottom: 2px solid var(--primary-color);
}

.notes-textarea {
    width: 100%;
    min-height: 150px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    background-color: var(--bg-default);
    color: var(--text-primary);
    line-height: 1.5;
    transition: border-color 0.2s ease;
    flex: 1;
}

.notes-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.regenerate-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.regenerate-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    background-color: var(--bg-default);
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}

.regenerate-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.regenerate-input::placeholder {
    color: var(--text-disabled);
}

.btn-regenerate {
    padding: 0.75rem 1rem;
    background-color: var(--bg-contrast);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-regenerate:hover {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    border-color: var(--primary-color);
}

.btn-regenerate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   Action Row
   ======================================== */
.action-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-row.centered {
    justify-content: center;
    margin-top: 1rem;
}

.action-row.centered .btn {
    width: 100%;
}

/* ========================================
   Video Generation Section
   ======================================== */
.video-generation-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

@media (max-width: 900px) {
    .video-generation-container {
        grid-template-columns: 1fr;
    }
}

.video-settings {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.select-input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    background-color: var(--bg-default);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.select-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.range-input {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--bg-contrast);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.range-input::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.range-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

.video-output {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.video-output h3 {
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}

.video-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    background-color: var(--bg-contrast);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
}

.output-video {
    width: 100%;
    max-height: 500px;
    border-radius: 8px;
    background-color: #000;
}

/* ========================================
   Tips Section
   ======================================== */
.tips-section {
    margin-top: 2rem;
    margin-bottom: 4rem;
}

.tips-accordion {
    background-color: var(--bg-front);
    border: 1px solid var(--border-weak);
    border-radius: 8px;
}

.tips-header {
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-heading);
    list-style: none;
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease;
}

.tips-header::-webkit-details-marker {
    display: none;
}

.tips-header::after {
    content: '▶';
    margin-left: auto;
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

details[open] .tips-header::after {
    transform: rotate(90deg);
}

.tips-header:hover {
    background-color: var(--bg-contrast);
}

.tips-content {
    padding: 0 1.5rem 1.5rem 1.5rem;
    color: var(--text-secondary);
}

.tips-content h4 {
    color: var(--text-primary);
    margin: 1rem 0 0.5rem 0;
}

.tips-content ul {
    margin-left: 1.5rem;
}

.tips-content li {
    margin-bottom: 0.5rem;
}

/* ========================================
   Loading States
   ======================================== */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Spinning icon for buttons */
.btn.loading {
    color: transparent;
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 600px) {
    .step-section {
        padding: 1rem;
    }
    
    .btn-large {
        width: 100%;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .regenerate-row {
        flex-direction: column;
    }
    
    .btn-regenerate {
        width: 100%;
    }
}
