/* Video Transcriber - Main Styles */

:root {
    --primary-color: #4a90d9;
    --primary-hover: #357abd;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --bg-color: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #0f3460;
    --text-color: #e8e8e8;
    --text-muted: #a0a0a0;
    --border-color: #2a2a4a;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--bg-color) 0%, var(--bg-secondary) 100%);
    color: var(--text-color);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    padding: 40px 20px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-color), #e94560);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Upload Section */
.upload-section {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 40px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.upload-zone {
    border: 3px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 60px 40px;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(74, 144, 217, 0.05);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(74, 144, 217, 0.1);
}

.upload-zone svg {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.upload-zone h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.upload-zone p {
    color: var(--text-muted);
}

#file-input {
    display: none;
}

/* Progress Bar */
.progress-container {
    display: none;
    margin-top: 30px;
}

.progress-container.active {
    display: block;
}

.progress-bar {
    background: var(--border-color);
    border-radius: 20px;
    height: 24px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    background: linear-gradient(90deg, var(--primary-color), #e94560);
    height: 100%;
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 20px;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.status-message {
    margin-top: 15px;
    color: var(--text-muted);
    font-size: 1rem;
}

/* Main Content Grid */
.content-grid {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.content-grid.active {
    display: grid;
}

@media (max-width: 900px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.card h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card h2 svg {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

/* Video Player */
.video-container {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

#video-player {
    width: 100%;
    display: block;
    border-radius: 8px;
}

.video-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Transcription */
.transcription-container {
    max-height: 400px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 20px;
}

.transcription-container::-webkit-scrollbar {
    width: 8px;
}

.transcription-container::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 4px;
}

.transcription-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

#transcription-text {
    white-space: pre-wrap;
    line-height: 1.8;
    font-size: 1rem;
}

.segment {
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.segment:hover {
    background: rgba(74, 144, 217, 0.2);
}

.segment.active {
    background: rgba(74, 144, 217, 0.3);
    border-left: 3px solid var(--primary-color);
}

.segment-time {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 5px;
}

.segment-text {
    color: var(--text-color);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 217, 0.4);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--border-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: #3a3a5a;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Actions Panel */
.actions-panel {
    display: none;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.actions-panel.active {
    display: block;
}

.actions-panel h2 {
    margin-bottom: 20px;
}

.actions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle {
    position: relative;
    width: 50px;
    height: 26px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border-color);
    border-radius: 26px;
    transition: var(--transition);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
}

.toggle input:checked + .toggle-slider {
    background: var(--primary-color);
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Info Badge */
.info-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(74, 144, 217, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-right: 10px;
    margin-bottom: 10px;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid var(--error-color);
    color: #ff6b7a;
}

.alert-success {
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid var(--success-color);
    color: #5fd87f;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Header Navigation */
.header-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Auth Notice */
.auth-notice {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid var(--warning-color);
    border-radius: var(--border-radius);
    padding: 20px 25px;
    margin-bottom: 30px;
}

.auth-notice svg {
    width: 40px;
    height: 40px;
    color: var(--warning-color);
    flex-shrink: 0;
}

.auth-notice h3 {
    margin-bottom: 5px;
    color: var(--warning-color);
}

.auth-notice a {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Auth Section (Login/Register) */
.auth-section {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.auth-tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.auth-tab.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: -2px;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.2);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.auth-message {
    margin-top: 20px;
}

/* Gallery Section */
.gallery-section {
    margin-bottom: 30px;
}

.gallery-loading {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
}

.gallery-loading .spinner {
    width: 40px;
    height: 40px;
    margin-bottom: 20px;
}

.gallery-empty {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
}

.gallery-empty svg {
    width: 80px;
    height: 80px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.gallery-empty h3 {
    margin-bottom: 10px;
}

.gallery-empty p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.gallery-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.gallery-card-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.gallery-card-header svg {
    width: 40px;
    height: 40px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.gallery-card-title h4 {
    font-size: 1rem;
    margin-bottom: 5px;
    word-break: break-word;
}

.gallery-card-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.gallery-card-info {
    margin-bottom: 15px;
}

.gallery-card-info .info-badge {
    font-size: 0.8rem;
    padding: 4px 10px;
    margin-right: 8px;
    margin-bottom: 8px;
}

.gallery-card-info .status-completed {
    background: rgba(40, 167, 69, 0.2);
    color: #5fd87f;
}

.gallery-card-info .status-processing {
    background: rgba(255, 193, 7, 0.2);
    color: var(--warning-color);
}

.gallery-card-info .status-error {
    background: rgba(220, 53, 69, 0.2);
    color: #ff6b7a;
}

.gallery-card-preview {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    max-height: 100px;
    overflow: hidden;
}

.gallery-card-preview p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.gallery-card-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 1200px;
    padding: 30px;
    position: relative;
    margin: 20px 0;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.modal-video video {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 15px;
}

.modal-transcription h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.modal-transcription .transcription-container {
    max-height: 400px;
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Danger Button */
.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 900px) {
    .modal-grid {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    header h1 {
        font-size: 1.8rem;
    }

    .upload-zone {
        padding: 40px 20px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .actions-grid {
        flex-direction: column;
    }

    .actions-grid .btn {
        width: 100%;
        justify-content: center;
    }

    .header-nav {
        flex-direction: column;
        align-items: center;
    }

    .auth-card {
        padding: 25px;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .btn {
        width: 100%;
        justify-content: center;
    }
}
