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

:root {
    --primary: #7C3AED;
    --primary-dark: #6D28D9;
    --secondary: #1E1B4B;
    --accent-cyan: #22D3EE;
    --accent-teal: #0D9488;
    --accent-yellow: #FDE047;
    --accent-pink: #EC4899;
    --bg-dark: #0F172A;
    --text-main: #FFFFFF;
    --text-muted: #94A3B8;
    --glass: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

#mobile-wrapper {
    width: 100%;
    max-width: 450px;
    min-height: 100vh;
    background-color: var(--primary);
    position: relative;
    box-shadow: 0 0 100px rgba(0,0,0,0.5);
    overflow-x: hidden;
}

#app-container {
    width: 100%;
    min-height: 100vh;
}

/* Glassmorphism Utilities */
.glass-card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
}

.glass-pill {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
}

/* Gradients & Colors */
.grad-purple { background: linear-gradient(135deg, #A855F7 0%, #7C3AED 100%); }
.grad-cyan { background: linear-gradient(135deg, #22D3EE 0%, #0891B2 100%); }
.grad-teal { background: linear-gradient(135deg, #2DD4BF 0%, #0D9488 100%); }
.bg-pink { background: #E11D48; }
.bg-blue { background: #3B82F6; }
.bg-cyan { background: #06B6D4; }

/* View Containers */
#app-container > div {
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

#app-container .hidden {
    display: none;
    opacity: 0;
    transform: translateY(10px);
}

/* Layout Utilities */
.grid-2 {
    display: flex !important;
    flex-direction: row !important;
    gap: 1rem;
    width: 100%;
}

.grid-2 > div {
    flex: 1;
    min-width: 0;
}

/* Dashboard Specifics */
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1rem;
}

.card-row {
    margin-bottom: 1rem;
}

.greeting-card {
    background: white;
    color: #1E293B;
    padding: 1.5rem;
    border-radius: 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.selection-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 24px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.selection-card select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 0.5rem;
    color: white;
    font-size: 0.8rem;
    outline: none;
}

.upload-card {
    padding: 2rem 1.5rem; /* Reduced height as requested */
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.stats-card {
    padding: 1.25rem;
    border-radius: 20px;
    color: white;
}

/* Settings View */
.settings-container {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-bottom: 5rem;
}

.settings-card {
    padding: 1.5rem;
    border-radius: 28px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.card-title h3 { font-size: 1.25rem; font-weight: 700; }
.card-title p { font-size: 0.85rem; opacity: 0.8; }

.slider-container {
    padding: 1rem 0;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    outline: none;
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.voice-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.voice-item {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.voice-item.active {
    background: rgba(255, 255, 255, 0.25);
    border-color: white;
}

.voice-item h4 { font-size: 0.95rem; font-weight: 600; }
.voice-item p { font-size: 0.75rem; opacity: 0.7; margin-top: 0.25rem; }

.test-voice-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    margin-left: 0.5rem;
}

.test-voice-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.test-voice-btn:active {
    transform: scale(0.9);
}

/* ============================================
   LOADING SCREEN
   ============================================ */
.processing-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    padding: 2rem;
}

.processing-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 32px;
    padding: 3rem 2.5rem;
    text-align: center;
    width: 100%;
    max-width: 340px;
}

.spinner {
    width: 64px;
    height: 64px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
    margin: 0 auto 2rem;
}

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

.progress-track {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 99px;
    height: 8px;
    margin-top: 1.5rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #22D3EE, #0D9488);
    border-radius: 99px;
    transition: width 0.3s ease;
}

/* ============================================
   DICTATION IMMERSIVE VIEW
   ============================================ */
.dictation-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: #0D0D0D;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    overflow: hidden;
    padding-bottom: 7rem; /* space for fixed controls bar */
}

.dictation-close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: background 0.2s;
}

.dictation-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.dictation-full-text {
    width: 100%;
    flex: 1;
    padding: 4rem 1.5rem 1rem;
    font-size: 1.05rem;
    line-height: 1.85;
    color: rgba(255, 255, 255, 0.22);
    overflow-y: auto;
    user-select: none;
}

.dictation-chunk-card {
    /* In-flow flex item: sits below scrollable text, above controls */
    width: calc(100% - 2.5rem);
    margin: 0 1.25rem 1rem;
    flex-shrink: 0;
    background: linear-gradient(135deg, #4C1D95 0%, #2D1B69 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 28px;
    padding: 1.75rem 1.5rem;
    font-size: 1.75rem;
    font-weight: 800;
    color: #FDE047;
    text-align: center;
    line-height: 1.3;
    min-height: 7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.dictation-controls-bar {
    position: fixed;
    bottom: 2.25rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: rgba(18, 18, 18, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 60px;
    padding: 0.75rem 1.75rem;
    z-index: 30;
}

.btn-ctrl {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.btn-ctrl:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.btn-ctrl:active {
    transform: scale(0.95);
}

.btn-play-main {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #9333EA, #7C3AED);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 24px rgba(124, 58, 237, 0.55);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-play-main:hover {
    transform: scale(1.08);
    box-shadow: 0 0 36px rgba(124, 58, 237, 0.75);
}

.btn-play-main:active {
    transform: scale(0.96);
}

.btn-play-main.lock-overlay {
    pointer-events: none;
    opacity: 0.45;
}

.dictation-progress-text {
    position: fixed;
    bottom: 0.8rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    z-index: 30;
}

.cool-down-timer {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-family: monospace;
    font-size: 1.25rem;
    color: var(--accent-yellow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 100;
}

.lock-overlay {
    pointer-events: none;
    opacity: 0.5;
}

/* Modal / Onboarding overrides */
/* Onboarding Enhancements */
.onboarding-container {
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

.welcome-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.4rem 1rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.1rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.input-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#onboarding-view input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem;
    border-radius: 16px;
    color: white;
    font-size: 1.1rem;
    width: 100%;
    outline: none;
    transition: border-color 0.2s;
}

#onboarding-view input:focus {
    border-color: white;
}

#onboarding-view input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.btn-primary {
    width: 100%;
    padding: 1.2rem;
    border-radius: 18px;
    background: white;
    color: var(--primary);
    font-weight: 800;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:active {
    transform: scale(0.98);
}

/* ============================================
   RECENT SESSIONS CARDS
   ============================================ */
.recent-card {
    position: relative;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.6rem;
    cursor: pointer;
    overflow: hidden;
    transition: background 0.2s, transform 0.15s;
}

.recent-card:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}

.recent-card:active {
    transform: translateY(0);
}

.recent-card-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #22D3EE, #7C3AED);
    border-radius: 0 0 0 20px;
    transition: width 0.3s;
}

.recent-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.recent-card-body h4 {
    font-size: 0.88rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-card-body p {
    font-size: 0.72rem;
    opacity: 0.5;
    color: white;
}

.recent-resume-btn {
    font-size: 0.72rem;
    font-weight: 700;
    color: #A78BFA;
    white-space: nowrap;
    flex-shrink: 0;
}
