/* =============================================================================
   LINGOBRIDGE LIVE AUDIO TRANSLATOR CSS
   ============================================================================= */

.translator-main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 80px;
    z-index: 10;
    position: relative;
}

.workspace-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

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

.glass-panel {
    background: var(--card-bg, rgba(30, 41, 59, 0.45));
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-xl, 24px);
    padding: 35px;
    backdrop-filter: blur(16px) saturate(180%);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    transition: var(--transition, all 0.3s ease);
}

[data-theme="light"] .glass-panel {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.05);
}

.panel-header {
    margin-bottom: 25px;
}

.panel-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}

.step-num {
    background: var(--primary, #6366f1);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
}

.panel-subtitle {
    color: var(--text-secondary, #94a3b8);
    font-size: 0.95rem;
    margin-top: 5px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.form-group label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

textarea {
    width: 100%;
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-lg, 16px);
    padding: 15px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    transition: var(--transition, all 0.3s ease);
}

[data-theme="light"] textarea {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(15, 23, 42, 0.12);
}

textarea:focus {
    outline: none;
    border-color: var(--primary, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: var(--transition, all 0.3s ease);
}

.secondary-btn {
    background: var(--primary, #6366f1);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.secondary-btn:hover {
    background: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.tertiary-btn {
    background: var(--accent-teal, #14b8a6);
    color: white;
    box-shadow: 0 4px 15px rgba(20, 184, 166, 0.3);
}

.tertiary-btn:hover {
    background: #0d9488;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.4);
}

.clear-btn {
    background: transparent;
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.08));
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.clear-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}

/* Audio Visualizer & Waveform styling */
.recorder-container {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-lg, 16px);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

[data-theme="light"] .recorder-container {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(15, 23, 42, 0.08);
}

.visualizer-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

#waveform-canvas {
    width: 100%;
    height: 80px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.2);
}

.recording-status {
    font-size: 0.88rem;
    color: var(--text-secondary, #94a3b8);
    font-weight: 500;
}

.recording-status.live {
    color: var(--accent-pink, #ec4899);
    animation: flash 1.5s infinite;
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.record-controls {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
}

.record-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #ef4444;
    border: none;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.4);
    transition: var(--transition);
}

.record-icon {
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
}

.record-btn.recording .record-icon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
}

.record-btn:hover {
    transform: scale(1.05);
}

.pulse-ring {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 3px solid rgba(239, 68, 68, 0.5);
    opacity: 0;
}

.record-btn.recording .pulse-ring {
    animation: pulse-ring-animation 1.5s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes pulse-ring-animation {
    0% { transform: scale(0.95); opacity: 0.8; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* Transcript Feed Timeline */
.transcript-feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.transcript-feed {
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-lg, 16px);
    background: rgba(15, 23, 42, 0.2);
    min-height: 250px;
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

[data-theme="light"] .transcript-feed {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(15, 23, 42, 0.08);
}

.empty-feed-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: var(--text-secondary);
    text-align: center;
    margin: auto;
    max-width: 320px;
    font-size: 0.9rem;
}

.empty-feed-placeholder svg {
    color: var(--text-secondary);
    opacity: 0.5;
}

.transcript-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
    animation: slideUp 0.3s ease-out;
}

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

[data-theme="light"] .transcript-item {
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

.transcript-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.transcript-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.lang-tag {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.lang-malayalam {
    background: rgba(20, 184, 166, 0.15);
    color: var(--accent-teal, #14b8a6);
    border: 1px solid rgba(20, 184, 166, 0.3);
}

.lang-hindi {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.lang-english {
    background: var(--primary-glow, rgba(99, 102, 241, 0.15));
    color: var(--primary, #6366f1);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.lang-unknown {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.time-stamp {
    font-size: 0.75rem;
    color: var(--text-secondary, #94a3b8);
}

.transcript-text {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Loading processing block */
.processing .lang-tag {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-secondary);
    animation: blink-bg 1.2s infinite;
}

.processing .transcript-text {
    color: var(--text-secondary);
    font-style: italic;
}

@keyframes blink-bg {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.error-block .lang-tag {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.error-block .transcript-text {
    color: #ef4444;
}

/* Markdown preview outputs */
.prep-output-container {
    margin-top: 25px;
    border-top: 1px solid var(--card-border, rgba(255, 255, 255, 0.08));
    padding-top: 20px;
}

[data-theme="light"] .prep-output-container {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.prep-output-container h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.markdown-preview {
    background: rgba(15, 23, 42, 0.2);
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-lg, 16px);
    padding: 25px;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.7;
    overflow-x: auto;
}

[data-theme="light"] .markdown-preview {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(15, 23, 42, 0.08);
}

/* Render markdown headings/lists nicely */
.markdown-preview h1, .markdown-preview h2, .markdown-preview h3, .markdown-preview h4 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 700;
}

.markdown-preview h1 { font-size: 1.5rem; }
.markdown-preview h2 { font-size: 1.3rem; }
.markdown-preview h3 { font-size: 1.15rem; }
.markdown-preview h4 { font-size: 1.05rem; }

.markdown-preview p {
    margin-bottom: 12px;
}

.markdown-preview ul, .markdown-preview ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.markdown-preview li {
    margin-bottom: 6px;
}

.markdown-preview table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.markdown-preview th, .markdown-preview td {
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.08));
    padding: 10px 12px;
    text-align: left;
}

[data-theme="light"] .markdown-preview th, [data-theme="light"] .markdown-preview td {
    border: 1px solid rgba(15, 23, 42, 0.1);
}

.markdown-preview th {
    background: rgba(15, 23, 42, 0.3);
    font-weight: 600;
}

/* Compiled Notes Output panel */
.compiled-notes-section {
    margin-top: 40px;
    margin-bottom: 40px;
}

.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
}

.notes-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}

.notes-header .action-buttons {
    display: flex;
    gap: 10px;
}

.copy-btn {
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.08));
    color: var(--text-primary);
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .copy-btn {
    background: rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .copy-btn:hover {
    background: rgba(15, 23, 42, 0.1);
}

.download-btn {
    background: var(--primary, #6366f1);
    color: white;
}

.download-btn:hover {
    background: #4f46e5;
}

.hidden {
    display: none !important;
}

.info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap: 30px;
    margin-top: 40px;
    margin-bottom: 40px;
}
