/* CSS Design System for Autobot Subtitle & Dubby - SaaS 7 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;500;700&family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --bg-dark: #09090b;
    --bg-card: rgba(20, 20, 25, 0.65);
    --border-color: rgba(249, 115, 22, 0.2);
    --border-glow: rgba(249, 115, 22, 0.1);
    --primary-orange: #f97316;
    --primary-amber: #f59e0b;
    --primary-gold: #fbbf24;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --neon-shadow: 0 0 25px rgba(249, 115, 22, 0.35);
    --neon-shadow-gold: 0 0 25px rgba(245, 158, 11, 0.35);
    --glass-blur: blur(16px);
}

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

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(249, 115, 22, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(245, 158, 11, 0.08) 0%, transparent 40%);
    background-attachment: fixed;
    color: var(--text-light);
    font-family: 'Outfit', 'Noto Sans Thai', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Header & Container */
.app-container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo-section h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    background: linear-gradient(135deg, var(--primary-orange), var(--primary-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 40px rgba(249, 115, 22, 0.2);
}

.logo-section p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-top: 0.25rem;
}

.status-badge {
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid var(--primary-orange);
    border-radius: 99px;
    padding: 0.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    color: var(--primary-amber);
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.15);
}

.status-dot {
    width: 10px;
    height: 10px;
    background-color: var(--primary-orange);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary-orange);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(249, 115, 22, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); }
}

/* Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Glassmorphism Card Style */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), var(--border-glow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 2rem;
}

.glass-card:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 30px rgba(249, 115, 22, 0.15);
}

.card-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-left: 4px solid var(--primary-orange);
    padding-left: 0.8rem;
}

/* Video Player Area */
.video-workspace {
    position: relative;
}

.video-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Custom Subtitle Overlay on Video */
.subtitle-overlay {
    position: absolute;
    bottom: 8%;
    left: 5%;
    right: 5%;
    text-align: center;
    pointer-events: none;
    z-index: 10;
}

.subtitle-text-box {
    display: inline-block;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(249, 115, 22, 0.3);
    color: #fff;
    padding: 0.6rem 1.6rem;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.4;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    letter-spacing: 0.02em;
    animation: fadeIn 0.15s ease-out;
}

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

/* Audio Waveform Section */
.audio-visual-bar {
    margin-top: 1.5rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.wave-animation {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 40px;
    width: 100%;
    padding: 0 1rem;
}

.wave-bar {
    width: 4px;
    height: 5px;
    background: linear-gradient(to top, var(--primary-orange), var(--primary-gold));
    border-radius: 2px;
    transition: height 0.1s ease;
}

/* Wave animating class */
.wave-active .wave-bar {
    animation: waveMotion 1.2s ease-in-out infinite alternate;
}

.wave-active .wave-bar:nth-child(2n) { animation-delay: 0.1s; }
.wave-active .wave-bar:nth-child(3n) { animation-delay: 0.25s; }
.wave-active .wave-bar:nth-child(4n) { animation-delay: 0.4s; }
.wave-active .wave-bar:nth-child(5n) { animation-delay: 0.15s; }

@keyframes waveMotion {
    0% { height: 5px; }
    100% { height: 35px; }
}

/* Big Metrics Row */
.metric-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
    margin-top: 1.5rem;
}

.metric-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.2rem;
    text-align: center;
}

.metric-card span {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
}

.metric-card h3 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-gold);
    margin-top: 0.4rem;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

/* Drag & Drop File Upload Area */
.file-upload-zone {
    border: 2px dashed rgba(249, 115, 22, 0.4);
    border-radius: 14px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: rgba(249, 115, 22, 0.02);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.file-upload-zone:hover {
    border-color: var(--primary-orange);
    background: rgba(249, 115, 22, 0.05);
    box-shadow: var(--neon-shadow);
}

.upload-icon {
    font-size: 2.5rem;
    color: var(--primary-orange);
    margin-bottom: 0.8rem;
}

/* Control Configurations */
.config-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.field-box {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-box label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-light);
}

select, input[type="text"] {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    outline: none;
    font-size: 1rem;
    transition: border 0.3s ease;
    font-family: inherit;
}

select:focus, input[type="text"]:focus {
    border-color: var(--primary-orange);
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.25);
}

/* Custom range inputs styling */
.range-box {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.range-header {
    display: flex;
    justify-content: space-between;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.1);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-orange);
    cursor: pointer;
    box-shadow: 0 0 8px var(--primary-orange);
}

/* Premium Button styles */
.btn {
    background: linear-gradient(135deg, var(--primary-orange), var(--primary-amber));
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 1rem 1.8rem;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    width: 100%;
    box-shadow: var(--neon-shadow);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.5);
    background: linear-gradient(135deg, var(--primary-amber), var(--primary-gold));
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: none;
    margin-top: 0.8rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: none;
    transform: none;
}

/* Subtitle Timeline Container */
.timeline-container {
    max-height: 480px;
    overflow-y: auto;
    padding-right: 0.5rem;
    margin-top: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
    padding: 1rem;
}

/* Scrollbar styles */
.timeline-container::-webkit-scrollbar {
    width: 6px;
}

.timeline-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.timeline-container::-webkit-scrollbar-thumb {
    background: rgba(249, 115, 22, 0.3);
    border-radius: 3px;
}

.timeline-container::-webkit-scrollbar-thumb:hover {
    background: rgba(249, 115, 22, 0.6);
}

/* Subtitle Event Cards */
.sub-event-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.sub-event-card:hover {
    background: rgba(249, 115, 22, 0.05);
    border-color: rgba(249, 115, 22, 0.3);
}

.sub-event-card.active-sub {
    background: rgba(249, 115, 22, 0.12);
    border-color: var(--primary-orange);
    box-shadow: inset 0 0 10px rgba(249, 115, 22, 0.15);
}

.sub-event-card.active-sub::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-orange);
}

.sub-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.sub-time {
    color: var(--primary-gold);
    font-weight: 700;
}

.sub-index {
    color: var(--text-muted);
}

.sub-input {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
    transition: all 0.2s ease;
}

.sub-input:focus {
    border-color: var(--primary-amber);
    outline: none;
    background: rgba(0,0,0,0.5);
}

/* Floating Status Logs (Console look) */
.console-logs {
    background: rgba(5, 5, 8, 0.9);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: 12px;
    padding: 1.2rem;
    font-family: monospace;
    font-size: 0.9rem;
    color: #a7f3d0;
    height: 150px;
    overflow-y: auto;
    margin-top: 1.5rem;
}

.console-line {
    margin-bottom: 0.4rem;
    display: flex;
    gap: 0.8rem;
}

.console-timestamp {
    color: var(--primary-orange);
}

.console-success {
    color: #10b981;
}

.console-info {
    color: #3b82f6;
}

/* Export Buttons Grid */
.export-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(16, 185, 129, 0.9);
    backdrop-filter: blur(8px);
    color: white;
    padding: 1rem 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 999;
    font-weight: 600;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}
