/* ============================================
   HeyGen Style - Video Parser Page
   Clean, minimal, professional
   ============================================ */

/* CSS Variables - HeyGen Color Palette */
:root {
    --primary: #8B5CF6;
    --primary-hover: #7C3AED;
    --primary-light: #EDE9FE;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;
    --border-light: #E5E7EB;
    --border-normal: #D1D5DB;
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--text-primary);
    background: var(--bg-secondary);
    min-height: 100vh;
}

/* Remove animated background */
.background {
    display: none;
}

.floating-ball {
    display: none;
}

/* ============================================
   Header - Clean Navigation
   ============================================ */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-8);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.logo:hover {
    opacity: 0.8;
}

.logo-icon {
    font-size: 1.25rem;
}

.nav-menu {
    display: flex;
    gap: var(--space-2);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.5rem 0.875rem;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--primary);
    color: white;
}

.nav-icon {
    font-size: 1rem;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-plan-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.5rem 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.user-plan-btn:hover {
    border-color: var(--border-normal);
}

.plan-badge {
    padding: 0.1875rem 0.625rem;
    background: var(--primary);
    color: white;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.dropdown-arrow {
    font-size: 0.625rem;
    transition: transform 0.2s;
}

.user-plan-btn.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-light);
    min-width: 200px;
    overflow: hidden;
    z-index: 1000;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    background: transparent;
    border: none;
    width: 100%;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--bg-secondary);
}

.dropdown-item .item-icon {
    font-size: 1rem;
}

.main-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

/* ⭐ 补充缺失的主容器样式 */

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem;
}

/* ============================================
   Input Section - Video Input Tabs
   ============================================ */
.input-section {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    padding: 2rem;
    margin-bottom: 2rem;
}

.input-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-icon {
    font-size: 1rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

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

/* URL Input Wrapper */
.url-input-wrapper {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.url-input {
    flex: 1;
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.url-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.url-input::placeholder {
    color: var(--text-tertiary);
}

.btn-fetch {
    padding: 0.875rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-fetch:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

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

.url-hint {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    line-height: 1.5;
}

/* File Info Display */
.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.file-text {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.file-meta {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.btn-remove {
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Upload Progress */
.upload-progress {
    margin-bottom: 1rem;
}

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

/* Upload Buttons */
.btn-primary {
    padding: 0.875rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    padding: 0.875rem 1.5rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-light);
}

.btn-icon {
    font-size: 1rem;
}

/* ============================================
   Page Header
   ============================================ */
.page-header {
    text-align: center;
    padding: 2rem 0;
}

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* ============================================
   Upload Section
   ============================================ */
.upload-section {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-light);
}

.upload-area {
    border: 2px dashed var(--border-normal);
    border-radius: var(--radius-md);
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

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

.upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-tertiary);
}

.upload-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.upload-text {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ⭐ 补充缺失的上传区域样式 */

.upload-subtitle {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    line-height: 1.5;
}

/* ============================================
   Preview Section
   ============================================ */
.preview-section {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    padding: 2rem;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.video-preview-card {
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-secondary);
    margin-bottom: 1.5rem;
}

.video-player {
    width: 100%;
    height: 400px;
    border-radius: var(--radius-md);
    background: #000;
}

.video-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1.5rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-label {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
}

.info-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-parse {
    padding: 0.875rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-parse:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

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

/* ============================================
   Parsing Progress
   ============================================ */
.parsing-progress {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.progress-content {
    max-width: 500px;
    margin: 0 auto;
}

.progress-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 1.5rem;
    border: 4px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.progress-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.progress-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

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

/* ============================================
   Results Section
   ============================================ */
.results-section {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    padding: 2rem;
    margin-bottom: 2rem;
}

.section-main-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: center;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.analysis-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.title-icon {
    font-size: 1.25rem;
}

.btn-copy-script {
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy-script:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.card-content {
    padding: 1.5rem;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.script-content {
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: var(--radius-sm);
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.8125rem;
}

.script-content::-webkit-scrollbar {
    width: 6px;
}

.script-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.script-content::-webkit-scrollbar-thumb {
    background: var(--border-normal);
    border-radius: 3px;
}

.script-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ============================================
   Score Section
   ============================================ */
.score-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 2rem;
}

.score-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.chart-card {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid var(--border-light);
}

.score-summary-card {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid var(--border-light);
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.score-item:last-child {
    border-bottom: none;
}

.score-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.score-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.score-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ============================================
   Result Actions
   ============================================ */
.result-actions {
    display: flex;
    gap: 1rem;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    justify-content: center;
}

/* ============================================
   User Menu Styles
   ============================================ */
.user-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-right: 0.5rem;
}

.btn-logout {
    padding: 0.5rem 1rem;
    background: var(--error);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #DC2626;
    transform: translateY(-1px);
}

/* ============================================
   Toast Notification
   ============================================ */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: bottom 0.3s ease;
    z-index: 1000;
}

.toast.show {
    bottom: 2rem;
}

.toast-message {
    font-size: 0.9375rem;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    .header-content {
        padding: 0 1.5rem;
    }

    .main-container {
        padding: 1.5rem;
    }

    .scenes-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .upload-area {
        padding: 2rem 1rem;
    }

    .input-group {
        flex-direction: column;
    }

    .btn-parse {
        width: 100%;
    }

    .video-meta {
        flex-direction: column;
        gap: 0.75rem;
    }

    .scenes-grid {
        grid-template-columns: 1fr;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    .header-content {
        padding: 0 1rem;
    }

    .logo {
        font-size: 1rem;
    }

    .logo-icon {
        font-size: 1.125rem;
    }

    .main-container {
        padding: 1rem;
    }

    .page-header {
        padding: 1.5rem 0;
    }

    .page-title {
        font-size: 1.375rem;
    }

    .page-subtitle {
        font-size: 0.875rem;
    }

    .upload-section,
    .video-preview-card,
    .transcript-card,
    .scenes-card {
        padding: 1.5rem;
    }

    .upload-icon {
        font-size: 2.5rem;
    }

    .upload-title {
        font-size: 1rem;
    }

    .video-title {
        font-size: 1.125rem;
    }
}
