/* Speech to Text Page Styles - Following MasterGo Design */

/* CSS Variables (tokens) from design system */
:root {
    /* Colors from MasterGo design */
    --color-gray-50: #F9FAFB;
    --color-white: #FFFFFF;
    --color-black: #000000;
    --color-green-500: #22C55E;
    --color-gray-500: #6B7280;
    --color-gray-300: #E5E7EB;
    --color-gray-400: #9CA3AF;
    --color-gray-700: #374151;
    --color-gray-200: #D1D5DB;
    --color-green-50: #DCFCE7;
    --color-blue-50: #DBEAFE;
    --color-blue-600: #2563EB;
    
    /* Typography tokens */
    --font-roboto: 'Roboto', sans-serif;
    --font-size-24: 24px;
    --font-size-16: 16px;
    --font-size-14: 14px;
    --font-weight-semibold: 600;
    --font-weight-regular: 400;
    --line-height-32: 32px;
    --line-height-24: 24px;
    --line-height-20: 20px;
    
    /* Gradients */
    --gradient-green: linear-gradient(90deg, #22C55E 0%, #86EFAC 100%);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-roboto);
    background-color: var(--color-gray-50);
    color: var(--color-black);
    line-height: 1.5;
}

/* Loading state styles */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    min-height: 120px;
}

.loading-state svg {
    margin-bottom: 16px;
}

.loading-state p {
    color: var(--color-gray-500);
    font-size: var(--font-size-16);
    margin: 0;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Main content container */
.main-content {
    padding-top: 72px; /* Account for fixed navbar */
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header Section */
.header-section {
    padding: 24px 0;
}

.page-title {
    font-family: var(--font-roboto);
    font-size: var(--font-size-24);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-32);
    color: var(--color-black);
    margin-bottom: 8px;
}

/* Status info */
.status-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-14);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-20);
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-gray-500);
}

.status-dot {
    width: 14px;
    height: 14px;
    background-color: var(--color-green-500);
    border-radius: 50%;
}

.divider {
    color: var(--color-gray-500);
}

.last-updated {
    color: var(--color-gray-500);
}

/* Model Selection */
.model-selection {
    position: relative;
    margin-bottom: 32px;
    display: flex;
    justify-content: center;
}

.model-selector {
    width: 400px;
    height: 48px;
    background-color: var(--color-white);
    border: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08), 
                0 1px 3px rgba(0, 0, 0, 0.12);
}

.model-selector:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 
                0 2px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.model-selector .model-icon {
    display: flex;
    align-items: center;
}

.selected-model {
    font-family: var(--font-roboto);
    font-size: var(--font-size-16);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-24);
    color: var(--color-black);
    flex: 1;
    margin-left: 8px;
    text-align: center;
}

.dropdown-arrow {
    display: flex;
    align-items: center;
}

/* Model Dropdown */
.model-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background-color: var(--color-white);
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15), 
                0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.model-dropdown.show {
    display: block;
}

.model-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--color-gray-200);
}

.model-option:last-child {
    border-bottom: none;
}

.model-option:hover {
    background-color: var(--color-gray-50);
}

.model-option.selected {
    background-color: var(--color-green-50);
    border-left: 3px solid var(--color-green-500);
}

.model-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.model-name {
    font-family: var(--font-roboto);
    font-size: var(--font-size-14);
    font-weight: var(--font-weight-semibold);
    color: var(--color-black);
    line-height: var(--line-height-20);
}

.model-description {
    font-family: var(--font-roboto);
    font-size: 12px;
    font-weight: var(--font-weight-regular);
    color: var(--color-gray-500);
    line-height: 16px;
}


/* Recording Area */
.recording-area {
    background-color: var(--color-white);
    border: none;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 
                0 1px 3px rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.3s ease;
}

.recording-area:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 
                0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Recording Controls */
.recording-controls {
    display: flex;
    justify-content: center;
    align-items: center;
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Record Button */
.record-button {
    background-color: var(--color-green-500);
    color: var(--color-white);
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-roboto);
    font-size: var(--font-size-16);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-24);
    cursor: pointer;
    transition: all 0.2s ease;
    height: 48px;
    min-width: 160px;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.2);
}

.record-button:hover {
    background-color: #16a34a;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(34, 197, 94, 0.3);
}

.record-button.recording {
    background-color: #dc2626;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.record-button.recording:hover {
    background-color: #b91c1c;
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
}

/* Upload Button */
.upload-button {
    background-color: var(--color-white);
    color: var(--color-gray-700);
    border: 1px solid var(--color-gray-300);
    border-radius: 8px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-roboto);
    font-size: var(--font-size-16);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-24);
    cursor: pointer;
    transition: all 0.2s ease;
    height: 48px;
    min-width: 160px;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.upload-button:hover {
    background-color: var(--color-gray-50);
    border-color: var(--color-gray-400);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Timer */
.timer {
    font-family: var(--font-roboto);
    font-size: var(--font-size-14);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-20);
    color: var(--color-gray-500);
}

/* Audio Visualizer */
.audio-visualizer {
    background-color: #f8fafc;
    border: none;
    border-radius: 12px;
    height: 120px;
    overflow: hidden;
}

/* Transcription Results */
.transcription-results {
    background-color: var(--color-white);
    border: none;
    border-radius: 16px;
    padding: 24px;
    min-height: 240px;
    max-height: 600px;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 
                0 1px 3px rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.3s ease;
}

.transcription-results:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 
                0 2px 6px rgba(0, 0, 0, 0.15);
}

/* No results state */
.no-results {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 160px;
}

.no-results p {
    color: var(--color-gray-500);
    font-size: var(--font-size-16);
    text-align: center;
    margin: 0;
}

/* Transcription chat bubbles */
.transcription-bubble {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 8px;
}

.transcription-bubble:last-child {
    margin-bottom: 0;
}

.bubble-content {
    background-color: var(--color-green-50);
    border-radius: 16px 16px 16px 4px;
    padding: 12px 16px;
    max-width: 80%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.bubble-text {
    font-family: var(--font-roboto);
    font-size: var(--font-size-16);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-24);
    color: var(--color-gray-800);
    margin: 0 0 6px 0;
}

.bubble-time {
    font-family: var(--font-roboto);
    font-size: 12px;
    font-weight: var(--font-weight-regular);
    color: var(--color-gray-500);
    display: block;
}

.delete-bubble {
    background: none;
    border: none;
    color: var(--color-gray-300);
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 8px;
}

.delete-bubble:hover {
    background-color: #fee2e2;
    color: #dc2626;
}


/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 0 16px;
    }
    
    .model-selector {
        width: 100%;
        max-width: 400px;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding-top: 80px;
    }
    
    .header-section {
        padding: 16px 0;
    }
    
    .page-title {
        font-size: 20px;
        line-height: 28px;
    }
    
    .recording-area {
        padding: 16px;
    }
    
    .recording-controls {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .control-buttons {
        justify-content: center;
    }
    
    .timer {
        text-align: center;
    }
    
    .model-selector {
        width: 100%;
    }
    
    .transcription-results {
        padding: 12px;
    }
    
    .speaker-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .control-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .record-button,
    .upload-button {
        width: 100%;
        justify-content: center;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --color-gray-50: #1f2937;
        --color-white: #374151;
        --color-black: #f9fafb;
        --color-gray-500: #9ca3af;
        --color-gray-300: #4b5563;
        --color-gray-400: #6b7280;
        --color-gray-700: #d1d5db;
        --color-gray-200: #6b7280;
    }
    
    body {
        background-color: #111827;
        color: #f9fafb;
    }
    
    .transcription-results {
        background-color: #1f2937;
        border-color: #374151;
    }
    
    .audio-visualizer {
        background-color: #1f2937;
        border-color: #374151;
    }
    
    .model-selector {
        background-color: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .upload-button {
        background-color: #1f2937;
        border-color: #374151;
        color: #d1d5db;
    }
}