/* VoiceScribe Pro - CSS Styles */

:root {
    --primary-50: #ecfdf5;
    --primary-100: #d1fae5;
    --primary-400: #34d399;
    --primary-500: #10b981;
    --primary-600: #059669;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --accent-red: #ef4444;
    --success: #10b981;
    --error: #ef4444;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --transition-base: 200ms ease;
    --transition-smooth: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-family);
    color: var(--gray-800);
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.app-container {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: white;
    box-shadow: var(--shadow-xl);
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: white;
    border-bottom: 1px solid var(--gray-100);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo { display: flex; align-items: center; gap: 0.75rem; }

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.logo-icon svg { width: 22px; height: 22px; }
.logo-text { font-size: 1.25rem; font-weight: 700; color: var(--gray-800); }
.logo-accent { color: var(--primary-500); }

.settings-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--gray-50);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-500);
    transition: all var(--transition-base);
}

.settings-btn:hover { background: var(--gray-100); color: var(--gray-700); transform: rotate(45deg); }
.settings-btn svg { width: 24px; height: 24px; }

.main-content { flex: 1; display: flex; flex-direction: column; gap: 1.5rem; padding: 1.5rem; }

.recording-section { padding: 0.5rem; }

.recording-bg {
    background: linear-gradient(135deg, var(--primary-50) 0%, rgba(16, 185, 129, 0.08) 100%);
    border-radius: var(--radius-2xl);
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.recording-circle { position: relative; width: 120px; height: 120px; display: flex; align-items: center; justify-content: center; }

.record-btn {
    width: 100px;
    height: 100px;
    border: none;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all var(--transition-smooth);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
    position: relative;
    z-index: 2;
}

.record-btn:hover { transform: scale(1.05); box-shadow: 0 12px 32px rgba(16, 185, 129, 0.45); }
.record-btn:active { transform: scale(0.98); }

.record-btn.recording {
    background: linear-gradient(135deg, var(--accent-red) 0%, #dc2626 100%);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.35);
    animation: pulse-glow 1.5s ease-in-out infinite;
}

.record-btn svg { width: 40px; height: 40px; }

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    border: 2px solid var(--primary-400);
    opacity: 0;
    z-index: 1;
}

.recording-circle.active .pulse-ring { animation: pulse-ring 1.5s ease-out infinite; }
.pulse-ring.delay-1 { animation-delay: 0.5s; }
.pulse-ring.delay-2 { animation-delay: 1s; }

@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.8); opacity: 0; }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 8px 24px rgba(239, 68, 68, 0.35); }
    50% { box-shadow: 0 8px 32px rgba(239, 68, 68, 0.55); }
}

.recording-status { font-size: 0.875rem; font-weight: 600; letter-spacing: 0.1em; color: var(--primary-600); text-transform: uppercase; }
.recording-status.active { color: var(--accent-red); animation: blink 1s ease-in-out infinite; }

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

.transcript-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

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

.transcript-title { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; color: var(--gray-500); text-transform: uppercase; }
.char-count { font-size: 0.875rem; color: var(--gray-400); }
.transcript-container { flex: 1; padding: 1rem; }

.transcript-textarea {
    width: 100%;
    min-height: 280px;
    height: 100%;
    border: none;
    outline: none;
    font-family: var(--font-family);
    font-size: 1rem;
    line-height: 1.8;
    color: var(--gray-700);
    resize: none;
    background: transparent;
}

.transcript-textarea::placeholder { color: var(--gray-400); }

.transcript-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: var(--radius-lg);
    font-family: var(--font-family);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.action-btn svg { width: 18px; height: 18px; }
.action-btn.primary { background: var(--gray-800); color: white; flex: 1; justify-content: center; }
.action-btn.primary:hover { background: var(--gray-900); transform: translateY(-1px); }
.action-btn.secondary { background: white; color: var(--gray-600); border: 1px solid var(--gray-200); }
.action-btn.secondary:hover { background: var(--gray-50); border-color: var(--gray-300); color: var(--gray-700); }

.processing-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.processing-content { display: flex; flex-direction: column; align-items: center; gap: 1rem; }

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary-500);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.processing-text { font-size: 0.875rem; font-weight: 500; color: var(--gray-600); }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 1rem;
    animation: fadeIn 150ms ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: white;
    border-radius: var(--radius-2xl);
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-2xl);
    animation: slideUp var(--transition-smooth);
    overflow: hidden;
}

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

.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--gray-100); }
.modal-title { font-size: 1.25rem; font-weight: 600; color: var(--gray-800); }

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-50);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-500);
    transition: all var(--transition-base);
}

.modal-close:hover { background: var(--gray-100); color: var(--gray-700); }
.modal-close svg { width: 20px; height: 20px; }

.modal-body { padding: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 500; color: var(--gray-700); }
.form-label svg { width: 18px; height: 18px; color: var(--gray-400); }
.input-wrapper { position: relative; display: flex; align-items: center; }

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-right: 3rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-family: var(--font-family);
    font-size: 1rem;
    color: var(--gray-800);
    background: white;
    transition: all var(--transition-base);
}

.form-input:focus { outline: none; border-color: var(--primary-400); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15); }
.form-input::placeholder { color: var(--gray-400); }

.toggle-visibility {
    position: absolute;
    right: 0.5rem;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-400);
    transition: color var(--transition-base);
}

.toggle-visibility:hover { color: var(--gray-600); }
.toggle-visibility svg { width: 20px; height: 20px; }

.form-hint { font-size: 0.75rem; color: var(--gray-500); margin-top: 0.25rem; }

.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-family: var(--font-family);
    font-size: 1rem;
    color: var(--gray-800);
    background: white;
    cursor: pointer;
    transition: all var(--transition-base);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.form-select:focus { outline: none; border-color: var(--primary-400); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15); }

.checkbox-label { flex-direction: row !important; align-items: center; cursor: pointer; user-select: none; }
.checkbox-label input { position: absolute; opacity: 0; cursor: pointer; }

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.checkbox-label input:checked + .checkbox-custom { background: var(--primary-500); border-color: var(--primary-500); }

.checkbox-label input:checked + .checkbox-custom::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.status-indicator { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1rem; background: var(--gray-50); border-radius: var(--radius-lg); }
.status-dot { width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--gray-400); }
.status-indicator.success .status-dot { background: var(--success); box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }
.status-indicator.error .status-dot { background: var(--error); }
.status-text { font-size: 0.875rem; color: var(--gray-600); }

.modal-footer { display: flex; justify-content: flex-end; gap: 0.75rem; padding: 1.25rem 1.5rem; border-top: 1px solid var(--gray-100); background: var(--gray-50); }

.modal-btn { padding: 0.75rem 1.5rem; border: none; border-radius: var(--radius-lg); font-family: var(--font-family); font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: all var(--transition-base); }
.modal-btn.primary { background: var(--primary-500); color: white; }
.modal-btn.primary:hover { background: var(--primary-600); }
.modal-btn.secondary { background: white; color: var(--gray-600); border: 1px solid var(--gray-200); }
.modal-btn.secondary:hover { background: var(--gray-50); border-color: var(--gray-300); }

.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-800);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 400;
    animation: toastIn var(--transition-smooth);
}

.toast.success { background: var(--success); }
.toast.error { background: var(--error); }

@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

@media (max-width: 640px) {
    .app-container { box-shadow: none; }
    .main-content { padding: 1rem; gap: 1rem; }
    .recording-bg { padding: 2rem 1rem; }
    .record-btn { width: 90px; height: 90px; }
    .record-btn svg { width: 36px; height: 36px; }
    .transcript-actions { flex-direction: column; }
    .action-btn.primary { order: -1; }
    .action-btn.secondary { flex: 1; }
}
