@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #f97316;
    --primary-hover: #ea580c;
    --primary-light: #ffedd5;
    --bg-app: #f8fafc;
    --bg-surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-inverse: #ffffff;
    --border: #e2e8f0;
    --danger: #ef4444;
    --success: #22c55e;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius-sm: 6px;
    --radius: 12px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-app);
    color: var(--text-main);
    height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.hidden {
    display: none !important;
}

.sidepanel-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 800px;
    margin: 0 auto;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

h1 {
    font-size: 1.125rem;
    font-weight: 700;
}

.badge {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-transform: uppercase;
}

.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--bg-surface);
    color: var(--text-main);
}

/* Cards */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    margin-bottom: 16px;
}

/* Recording Controls */
.recording-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 10px;
}

.record-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
}

.record-btn.idle {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

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

.record-btn.recording {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    animation: pulse-recording 1.5s infinite;
}

@keyframes pulse-recording {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    50% { box-shadow: 0 0 0 15px rgba(239, 68, 68, 0); }
}

.recording-timer {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: 2px;
}

.recording-status {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.recording-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-surface);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
}

.action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.record-main-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-surface);
    border: 2px solid var(--primary-light);
    border-radius: 50px;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.upload-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.upload-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Recording List */
.subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 4px 0 12px;
    font-weight: 600;
}

.recording-list-container {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.recording-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recording-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    padding: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
    align-items: center;
}

.recording-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.recording-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.recording-item-info {
    min-width: 0;
}

.recording-item-title {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.recording-item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
    align-items: center;
}

.transcription-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-transform: uppercase;
}

.transcription-badge.pending { background: #e5e7eb; color: #6b7280; }
.transcription-badge.processing { background: #dbeafe; color: #2563eb; }
.transcription-badge.completed { background: #dcfce7; color: #16a34a; }
.transcription-badge.failed { background: #fee2e2; color: #dc2626; }

.recording-item-actions {
    display: flex;
    gap: 4px;
}

.delete-btn {
    opacity: 0;
    transition: opacity 0.2s;
}

.recording-item:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    color: var(--danger);
    background: #fee2e2;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}
