/* =============================================================================
   Real-Time LuxASR Styles (stylesrt.css)
   ============================================================================= */

/* Title font */
.fancy-title {
    font-family: 'Audiowide', cursive;
    font-weight: 400;
}

/* Body background */
body {
    background: linear-gradient(to bottom, #ffffff, #dbe4ff);
    overflow-x: hidden;
}

h3 {
    font-weight: bold;
    font-size: 15px;
}

/* Header */
.header-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    text-align: center;
    padding: 10px 20px;
}

.header-container img {
    width: 100px;
    height: auto;
}

.header-container h1 {
    margin: 0;
    font-size: 30px;
    font-weight: bold;
}

/* Production badge */
.prod-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #ffc107;
    color: #333;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 8px;
}

/* =============================================================================
   Status Bar
   ============================================================================= */

.status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 12px 20px;
    background: rgba(0, 87, 183, 0.08);
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    border: 1px solid rgba(0, 87, 183, 0.15);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.status-label {
    color: #666;
}

.status-value {
    font-weight: 600;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.85rem;
    color: #004494;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #aaa;
    transition: all 0.3s ease;
}

.status-indicator.connected {
    background: #28a745;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.5);
}

.status-indicator.recording {
    background: #dc3545;
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.5);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.15); }
}

/* =============================================================================
   Panels & Cards
   ============================================================================= */

.main-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    margin-bottom: 20px;
}

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

.panel {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
}

.panel-title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
    margin: 0;
}

.panel-title-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #0057b7, #0077cc);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
}

.panel-body {
    padding: 20px;
}

/* =============================================================================
   Transcription Panel
   ============================================================================= */

.transcription-panel {
    min-height: 450px;
    display: flex;
    flex-direction: column;
}

.transcription-content {
    flex: 1;
    min-height: 300px;
    max-height: 450px;
    overflow-y: auto;
    padding: 16px;
    background: #fafbfc;
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.7;
    color: #333;
    border: 1px solid #e0e0e0;
}

.transcription-content:empty::before {
    content: 'Transcription will appear here...';
    color: #999;
    font-style: italic;
}

.transcription-segment {
    margin-bottom: 12px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 8px;
    border-left: 4px solid #0057b7;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    animation: fadeSlideIn 0.3s ease;
}

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

.transcription-segment-meta {
    font-size: 0.75rem;
    color: #888;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

/* =============================================================================
   Translation Styles (v2.1.0)
   ============================================================================= */

.segment-translation {
    margin-top: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4ff 100%);
    border-radius: 6px;
    border-left: 3px solid #4a90d9;
    font-style: italic;
    color: #2c5282;
}

.translation-label {
    font-weight: 600;
    font-size: 0.75rem;
    color: #4a90d9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =============================================================================
   Buttons
   ============================================================================= */

.controls {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.btn-record {
    background: linear-gradient(135deg, #0057b7, #0077cc);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
}

.btn-record:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 87, 183, 0.3);
}

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

.btn-record.recording {
    background: linear-gradient(135deg, #dc3545, #ff4d5e);
}

.btn-record.recording:hover {
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.3);
}

.btn-secondary {
    background: rgba(0, 87, 183, 0.08);
    color: #004494;
    border: 1px solid #cce0ff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.btn-secondary:hover {
    background: rgba(0, 87, 183, 0.15);
    border-color: #0057b7;
}

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

/* =============================================================================
   Settings Panel
   ============================================================================= */

.settings-panel .panel-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-label {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.setting-select {
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    color: #333;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.setting-select:hover {
    border-color: #0057b7;
}

.setting-select:focus {
    outline: none;
    border-color: #0057b7;
    box-shadow: 0 0 0 3px rgba(0, 87, 183, 0.2);
}

/* =============================================================================
   Audio Visualizer
   ============================================================================= */

.visualizer-container {
    height: 70px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.visualizer-canvas {
    width: 100%;
    height: 100%;
}

.visualizer-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 0.8rem;
    text-align: center;
}

/* =============================================================================
   Metrics
   ============================================================================= */

.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.metric-card {
    padding: 14px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.metric-value {
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    color: #0057b7;
}

.metric-label {
    font-size: 0.7rem;
    color: #666;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =============================================================================
   WebSocket Endpoint Display
   ============================================================================= */

.ws-info {
    margin-top: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.75rem;
    border: 1px solid #e0e0e0;
}

.ws-info-label {
    color: #666;
    margin-bottom: 4px;
    font-family: inherit;
}

.ws-info-value {
    color: #0057b7;
    word-break: break-all;
}

/* =============================================================================
   Toast Notifications
   ============================================================================= */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.toast-notification {
    padding: 14px 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(120%);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 350px;
}

.toast-notification.visible {
    transform: translateY(0);
    opacity: 1;
}

.toast-notification.success {
    border-left: 4px solid #28a745;
}

.toast-notification.error {
    border-left: 4px solid #dc3545;
}

.toast-notification.info {
    border-left: 4px solid #0057b7;
}

/* =============================================================================
   Back Link
   ============================================================================= */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 16px;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #0057b7;
}

.back-link i {
    font-size: 1.1rem;
}

/* =============================================================================
   Footer
   ============================================================================= */

footer {
    background: #333;
    color: #fff;
    text-align: center;
    padding: 10px;
    margin-top: 20px;
    border-top: #0057b7 3px solid;
    font-size: 14px;
}

footer a {
    color: #77aaff;
}

/* =============================================================================
   Description Section
   ============================================================================= */

.description-section {
    background-color: #f8f9fa;
    padding: 24px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.7;
    color: #333;
}

.description-section h3 {
    margin-top: 20px;
    font-weight: 600;
    color: #222;
    font-size: 1rem;
}

.description-section code {
    background-color: #eee;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* =============================================================================
   Scrollbar Styling
   ============================================================================= */

.transcription-content::-webkit-scrollbar {
    width: 8px;
}

.transcription-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.transcription-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.transcription-content::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* =============================================================================
   Mobile Adjustments
   ============================================================================= */

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        text-align: center;
    }

    .header-container h1 {
        font-size: 22px;
    }

    .status-bar {
        justify-content: center;
        gap: 12px;
    }

    .controls {
        flex-direction: column;
    }

    .btn-record,
    .btn-secondary {
        width: 100%;
    }

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

/* =============================================================================
   Context Management Styles (v2.0)
   ============================================================================= */

.context-status {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
}

.context-status > div {
    padding: 4px 0;
}

.context-reset-badge {
    display: inline-block;
    padding: 1px 6px;
    background: #fff3cd;
    color: #856404;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.context-used-badge {
    display: inline-block;
    padding: 1px 6px;
    background: #d4edda;
    color: #155724;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.form-check-input:checked {
    background-color: #0057b7;
    border-color: #0057b7;
}

.form-check-label {
    font-size: 13px;
    color: #666;
}

#resetContextBtn {
    padding: 2px 8px;
    font-size: 12px;
}

#contextStatusGroup {
    margin-top: 8px;
}

/* =============================================================================
   Processing Indicator (v2.0.3)
   ============================================================================= */

.processing-indicator {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(90deg, #e3f2fd, #bbdefb, #e3f2fd);
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #1565c0;
    border: 2px solid #90caf9;
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.2);
}

.processing-indicator.active {
    display: flex;
}

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

.processing-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #90caf9;
    border-top-color: #1565c0;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.processing-text {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.processing-reason {
    color: #5c6bc0;
    font-size: 13px;
    padding: 2px 8px;
    background: rgba(255,255,255,0.5);
    border-radius: 4px;
}

.send-reason-badge {
    display: inline-block;
    padding: 1px 4px;
    font-size: 11px;
    cursor: help;
}

