/* Variables */
:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --text: #1e293b;
    --text-light: #64748b;
    --bg: #f8fafc;
    --border: #e2e8f0;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header */
header {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

.btn-logout {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 1rem;
    background: #e0f0ff;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.welcome-message p {
    margin: 0;
    color: var(--text);
    font-size: 1.1rem;
}

/* Mode Selection */
.mode-section {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.mode-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.mode-btn {
    padding: 1rem;
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.mode-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.mode-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Upload Section */
.upload-section {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.upload-box {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.upload-area {
    border: 3px dashed var(--border);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: var(--primary);
    background: var(--bg);
}

.upload-area.dragover {
    border-color: var(--primary);
    background: #eff6ff;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.upload-label p {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.upload-label span {
    color: var(--text-light);
    font-size: 0.9rem;
}

.upload-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-group label {
    font-weight: 500;
    color: var(--text);
}

.option-group select {
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
}

/* Record Section */
.record-section {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.record-box {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.audio-meter-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.audio-meter-container label {
    font-weight: 500;
    color: var(--text);
}

.audio-meter {
    height: 40px;
    background: var(--bg);
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid var(--border);
}

.audio-meter-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), var(--warning), var(--danger));
    width: 0%;
    transition: width 0.1s ease;
}

.btn-test-mic {
    padding: 0.875rem;
    background: white;
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-test-mic:hover {
    background: var(--primary);
    color: white;
}

.btn-test-mic.testing {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

/* Clock Container */
.clock-container {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
    border: 2px solid var(--border);
}

.current-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.clock-label {
    font-weight: 500;
    color: var(--text-light);
    font-size: 1rem;
}

.clock-time {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Courier New', monospace;
    letter-spacing: 0.05em;
}

.recording-times {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.start-time, .end-time {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.time-label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.time-value {
    font-size: 1.25rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.start-time .time-value {
    color: var(--success);
}

.end-time .time-value {
    color: var(--danger);
}

/* Record Visualizer */
.record-visualizer {
    text-align: center;
    padding: 2rem;
    background: var(--bg);
    border-radius: 12px;
}

.record-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    transition: all 0.3s;
}

.record-icon.recording {
    animation: pulse 1.5s infinite;
}

.record-icon.paused {
    opacity: 0.5;
}

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

.record-timer {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.record-status {
    font-size: 1.1rem;
    color: var(--text-light);
    font-weight: 500;
}

.record-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.record-controls {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1rem;
}

.btn-record {
    padding: 1rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-record:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-pause, .btn-stop {
    padding: 1rem;
    background: white;
    border: 2px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-pause:not(:disabled):hover,
.btn-stop:not(:disabled):hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-pause:disabled,
.btn-stop:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Progress Section */
.progress-section {
    background: white;
    padding: 3rem 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.progress-box h2 {
    margin-bottom: 2rem;
    color: var(--primary);
}

.progress-bar {
    width: 100%;
    height: 40px;
    background: var(--bg);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #667eea);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Results Section */
.results-section {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.results-box {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.results-box h2 {
    text-align: center;
    color: var(--success);
}

.results-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.info-value {
    font-size: 1rem;
    color: var(--text);
    font-weight: 600;
}

.transcript-box {
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.transcript-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg);
    border-bottom: 2px solid var(--border);
}

.transcript-header h3 {
    margin: 0;
}

.transcript-content {
    padding: 1.5rem;
    max-height: 500px;
    overflow-y: auto;
    background: white;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.results-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Buttons */
.btn-primary {
    padding: 1rem 2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-primary:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .mode-buttons {
        grid-template-columns: 1fr;
    }
    
    .upload-options,
    .record-options,
    .record-controls,
    .recording-times,
    .results-info,
    .results-actions {
        grid-template-columns: 1fr;
    }
    
    .clock-time {
        font-size: 1.5rem;
    }
}
