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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 100%;
    width: 100%;
    padding: 10px;
    padding-bottom: 80px;
    overflow-y: auto;
}


.controls-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.prompt-select {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    color: #333;
    font-weight: 500;
    height: 42px;
}


h1 {
    display: none;
}

h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
}

button {
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background: #fff;
    color: #333;
}

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.record-btn {
    background: #ffcdd2;
    color: #c62828;
    border-color: #ef9a9a;
    font-weight: 600;
    height: 42px;
    white-space: nowrap;
}

.record-btn.recording {
    background: #f44336;
    color: white;
    border-color: #f44336;
}

.download-btn {
    padding: 6px 12px;
    font-size: 13px;
    margin-left: 8px;
}

.copy-btn {
    padding: 6px 12px;
    font-size: 13px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    color: #666;
}

.settings-section {
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.settings-section h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
}

.setting-group {
    margin-bottom: 10px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    color: #666;
    font-weight: 400;
    margin-bottom: 4px;
    font-size: 13px;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

input[type="range"] {
    width: 100%;
}

.range-value {
    margin-left: 8px;
    color: #666;
    font-size: 13px;
}

.visualizer {
    height: 200px;
    background: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
    border: 1px solid #ddd;
}

canvas {
    width: 100%;
    height: 100%;
}

.live-stats {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
}

.hidden {
    display: none;
}

/* Prompts Section */
.prompts-tabs {
    background: white;
}

.tabs-header {
    display: flex;
    align-items: center;
    padding: 4px;
    gap: 4px;
    border-bottom: 1px solid #ddd;
    overflow-x: auto;
}

.tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}

.tab.active {
    background: white;
    font-weight: 600;
}

.tab-name {
    flex: 1;
}

.delete-tab-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
}

.add-tab-btn {
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

.tab-content {
    padding: 10px;
}

.prompt-editor {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prompt-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.prompt-name-input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.prompt-text-container {
    position: relative;
}

.prompt-textarea {
    width: 100%;
    min-height: 80px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
}

.voice-input-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: #fff;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.voice-btn-icon {
    font-size: 16px;
}

.voice-btn-text {
    font-size: 11px;
    font-weight: 500;
}

.voice-input-btn.recording {
    background: #f44336;
    color: white;
    border-color: #f44336;
    animation: pulse 1.5s ease-in-out infinite;
}

.voice-input-btn.processing {
    background: #ff9800;
    color: white;
    border-color: #ff9800;
    cursor: not-allowed;
}

.loader-small {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Saved Transcriptions */
.transcriptions-header-simple {
    display: flex;
    justify-content: flex-end;
    padding: 0 0 10px 0;
}

.clear-all-btn {
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 3px;
    font-size: 13px;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 20px;
    font-size: 13px;
}

.transcriptions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
}

.transcription-item {
    background: white;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.transcription-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.transcription-date {
    font-size: 12px;
    color: #666;
}

.transcription-method {
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    background: #f0f0f0;
    color: #666;
}

.transcription-preview {
    color: #333;
    line-height: 1.4;
    margin-bottom: 8px;
    font-size: 13px;
}

.transcription-preview strong {
    color: #666;
    font-size: 11px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

.transcription-actions {
    display: flex;
    gap: 6px;
}

.transcription-actions button {
    padding: 6px 10px;
    font-size: 12px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 4px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
}

.modal-body {
    padding: 10px;
    overflow-y: auto;
    flex: 1;
}

.detail-section {
    margin-bottom: 10px;
}

.detail-section h4 {
    margin-bottom: 6px;
    font-size: 14px;
    color: #333;
}

.transcription-content {
    background: #f9f9f9;
    padding: 10px;
    border-radius: 3px;
    line-height: 1.4;
    font-size: 13px;
    border: 1px solid #ddd;
}

.transcription-content.processed {
    background: #fff9e6;
}

.segment-line {
    margin-bottom: 6px;
}

.segment-timestamp {
    font-weight: 600;
    color: #666;
    margin-right: 6px;
    font-size: 11px;
}

.segment-text {
    color: #333;
    font-size: 13px;
}

.modal-footer {
    padding: 10px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.btn-primary,
.btn-secondary {
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    background: white;
    color: #333;
}

.help-text {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
}

/* Overlay Styles */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    background: white;
    width: 100%;
    max-height: 90vh;
    border-radius: 12px 12px 0 0;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #ddd;
    background: #f9f9f9;
}

.overlay-header h3 {
    margin: 0;
    font-size: 16px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 32px;
    height: 32px;
}


.overlay-body {
    padding: 12px;
    padding-bottom: 80px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(90vh - 120px);
}

.status {
    text-align: center;
    padding: 8px;
    border-radius: 3px;
    margin-bottom: 10px;
    font-size: 13px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    color: #666;
}

.audio-players {
    margin-bottom: 10px;
}

.audio-player-group {
    margin-bottom: 8px;
}

.audio-player-group:last-child {
    margin-bottom: 0;
}

.audio-player-group audio {
    width: 100%;
    height: 32px;
}

.transcription {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.transcription-text {
    color: #666;
    line-height: 1.4;
    font-size: 13px;
}

.transcription-line {
    margin-bottom: 8px;
    padding: 6px;
    background: white;
    border-radius: 3px;
    border-left: 2px solid #999;
}

.timestamp {
    font-weight: 600;
    color: #666;
    font-size: 11px;
    margin-right: 6px;
}

.transcript-text {
    color: #333;
    font-size: 13px;
}

.interim-text {
    color: #999;
    font-style: italic;
}

.live-indicator {
    color: #f44336;
}

.offline-indicator {
    color: #f44336;
}

.loader {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #999;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 6px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #666;
}

.nav-item:active {
    background: #f9f9f9;
}

.nav-icon {
    font-size: 20px;
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
}
