/* =================================================================
   DECK BUILDER - AUDIO EDITOR STYLES
   Split from deck-builder.css for maintainability
   Contains: Audio recorder, waveform editor, sentence recording modal
   ================================================================= */

/* =================================================================
   AUDIO RECORDER STYLES
   ================================================================= */

/* Record Container */
.record-container {
    padding: 20px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Recording View */
.record-view {
    text-align: center;
    width: 100%;
}

.record-status {
    margin-bottom: 24px;
}

.record-status i {
    font-size: 48px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: block;
}

.record-status p {
    font-size: 16px;
    color: var(--text-secondary);
}

.record-status .recording-pulse {
    color: #ef4444;
    animation: pulse 1s infinite;
}

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

/* Countdown Display */
.countdown-display {
    margin-bottom: 24px;
}

.countdown-number {
    font-size: 72px;
    font-weight: bold;
    color: var(--primary);
    display: block;
    animation: countdownPop 1s ease;
}

@keyframes countdownPop {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* Record/Stop Buttons */
.btn-record {
    background: #ef4444;
    color: white;
    padding: 16px 32px;
    font-size: 18px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-stop {
    background: #6b7280;
    color: white;
    padding: 16px 32px;
    font-size: 18px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-stop:hover {
    background: #4b5563;
}

/* Editor View */
.editor-view {
    width: 100%;
}

/* Waveform Container */
.waveform-container {
    position: relative;
    background: #1e293b;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.waveform-container canvas {
    display: block;
    width: 100%;
    height: 150px;
}

/* Markers */
.marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    cursor: ew-resize;
    z-index: 10;
    padding: 0 15px;
    margin-left: -15px;
    touch-action: none;
}

.marker::before {
    content: '';
    position: absolute;
    top: -10px;
    bottom: -10px;
    left: 0;
    right: 0;
}

.marker::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.marker-start {
    background: #22c55e;
}

.marker-start::after {
    background: #22c55e;
}

.marker-end {
    background: #ef4444;
}

.marker-end::after {
    background: #ef4444;
}

/* Playhead */
.playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: white;
    z-index: 15;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
}

.playhead.active {
    opacity: 1;
}

/* Time Display */
.editor-time-display {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Editor Controls */
.editor-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.editor-controls .btn {
    min-width: 40px;
}

.editor-controls .btn-warning {
    background: #f59e0b;
}

.editor-controls .btn-warning:hover {
    background: #d97706;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .waveform-container canvas {
        height: 100px;
    }

    .countdown-number {
        font-size: 56px;
    }

    .btn-record,
    .btn-stop {
        padding: 12px 24px;
        font-size: 16px;
    }

    .editor-controls {
        gap: 6px;
    }

    .editor-controls .btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* =================================================================
   SENTENCE RECORDING MODAL
   ================================================================= */

.sentence-record-modal .modal-content {
    max-width: 500px;
}

.sentence-to-record {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
}

.sentence-text-display {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.sentence-english-display {
    font-size: 14px;
    color: var(--text-secondary);
    font-style: italic;
}

.sentence-record-view {
    text-align: center;
}

.sentence-record-btn-container {
    margin-bottom: 20px;
}

.sentence-record-start-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: #EF4444;
    color: white;
    font-size: 32px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.sentence-record-start-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.sentence-record-start-btn.recording {
    animation: pulse-red 1s ease-in-out infinite;
}

@keyframes pulse-red {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(239, 68, 68, 0.8);
    }
}

.sentence-visualizer-container {
    height: 80px;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
}

#sentenceVisualizerCanvas {
    width: 100%;
    height: 100%;
}

.sentence-recording-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.sentence-recording-status i {
    color: #EF4444;
}

.sentence-recording-status.recording i {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Sentence Editor View (after recording) */
.sentence-editor-view {
    display: none;
}

.sentence-editor-view.active {
    display: block;
}

.sentence-record-view.hidden {
    display: none;
}

.sentence-waveform-container {
    height: 120px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 16px;
    position: relative;
}

#sentenceWaveformCanvas {
    width: 100%;
    height: 100%;
}

.sentence-playback-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.sentence-playback-controls button {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.sentence-play-btn {
    background: var(--primary);
    color: white;
}

.sentence-play-btn:hover {
    background: var(--primary-dark);
}

.sentence-rerecord-btn {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border) !important;
}

.sentence-rerecord-btn:hover {
    background: var(--bg-secondary);
}

.sentence-save-section {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: 8px;
}

.sentence-save-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.sentence-filename-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: monospace;
    margin-bottom: 12px;
}

.sentence-save-btn {
    width: 100%;
    padding: 12px;
    background: #22C55E;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.sentence-save-btn:hover {
    background: #16A34A;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sentence-text-display {
        font-size: 18px;
    }
}
