/* ================================================
   Study Blocks - Design System
   Mobile-first productivity app styles
   Shadcn-inspired with Lime Green accent
   ================================================ */

/* ------------------------------------------------
   CSS Variables / Design Tokens
   ------------------------------------------------ */
:root {
    /* Colors - Dark Theme (Default) - Shadcn inspired */
    --color-bg-primary: #09090b;
    --color-bg-secondary: #0c0c0e;
    --color-bg-tertiary: #18181b;
    --color-bg-elevated: #27272a;

    --color-text-primary: #fafafa;
    --color-text-secondary: #a1a1aa;
    --color-text-muted: #71717a;

    /* Lime Green Accent - #85EB47 */
    --color-accent: #85EB47;
    --color-accent-hover: #6fd32f;
    --color-accent-light: rgba(133, 235, 71, 0.15);
    --color-accent-dark: #5cb82a;
    --color-primary: #85EB47;
    --color-primary-dark: #6fd32f;

    --color-success: #22c55e;
    --color-success-light: rgba(34, 197, 94, 0.15);
    --color-warning: #f59e0b;
    --color-warning-light: rgba(245, 158, 11, 0.15);
    --color-error: #ef4444;
    --color-error-light: rgba(239, 68, 68, 0.15);

    /* Shadcn-style borders */
    --color-border: rgba(255, 255, 255, 0.1);
    --color-border-light: rgba(255, 255, 255, 0.05);

    /* Ring for focus states */
    --ring-color: rgba(133, 235, 71, 0.4);

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;

    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;

    /* Border Radius - Shadcn uses smaller radii */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-2xl: 1rem;
    --radius-full: 9999px;

    /* Shadows - Softer, more subtle */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 20px rgba(133, 235, 71, 0.25);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
    --transition-slow: 300ms ease;

    /* Layout */
    --nav-height: 64px;
    --header-height: 56px;
    --max-width: 480px;
}

/* Light Theme */
[data-theme="light"] {
    --color-bg-primary: #ffffff;
    --color-bg-secondary: #fafafa;
    --color-bg-tertiary: #f4f4f5;
    --color-bg-elevated: #ffffff;

    --color-text-primary: #09090b;
    --color-text-secondary: #52525b;
    --color-text-muted: #71717a;

    --color-accent: #65c530;
    --color-accent-hover: #52a827;
    --color-accent-light: rgba(101, 197, 48, 0.12);

    --color-border: rgba(0, 0, 0, 0.1);
    --color-border-light: rgba(0, 0, 0, 0.05);
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    font-size: var(--text-base);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ------------------------------------------------
   Typography
   ------------------------------------------------ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--font-semibold);
    line-height: var(--line-height-tight);
    color: var(--color-text-primary);
}

h1 {
    font-size: var(--text-3xl);
}

h2 {
    font-size: var(--text-2xl);
}

h3 {
    font-size: var(--text-xl);
}

h4 {
    font-size: var(--text-lg);
}

p {
    color: var(--color-text-secondary);
}

.text-muted {
    color: var(--color-text-muted);
}

.text-accent {
    color: var(--color-accent);
}

.text-success {
    color: var(--color-success);
}

.text-warning {
    color: var(--color-warning);
}

.text-center {
    text-align: center;
}

.font-mono {
    font-family: var(--font-mono);
}

/* ------------------------------------------------
   App Layout
   ------------------------------------------------ */
#app {
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: var(--nav-height);
}

.view {
    padding: var(--space-4);
    max-width: var(--max-width);
    margin: 0 auto;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
    padding-top: var(--space-4);
}

.view-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
}

/* ------------------------------------------------
   Bottom Navigation
   ------------------------------------------------ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 var(--space-4);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-4);
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    transition: color var(--transition-fast);
    border-radius: var(--radius-lg);
}

.nav-item:hover {
    color: var(--color-text-secondary);
}

.nav-item.active {
    color: var(--color-accent);
}

.nav-icon {
    width: 24px;
    height: 24px;
}

/* ------------------------------------------------
   Cards
   ------------------------------------------------ */
.card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-4);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

.card-title {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-elevated {
    background: var(--color-bg-elevated);
    box-shadow: var(--shadow-lg);
}

.card-accent {
    background: linear-gradient(135deg, var(--color-accent) 0%, #4ade80 100%);
    border: none;
}

.card-accent .card-title,
.card-accent p {
    color: rgba(0, 0, 0, 0.7);
}

.card-accent h2,
.card-accent h3 {
    color: #000000;
}

/* ------------------------------------------------
   Buttons - Shadcn Style
   ------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    font-family: inherit;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    outline: none;
}

.btn:focus-visible {
    box-shadow: 0 0 0 2px var(--color-bg-primary), 0 0 0 4px var(--ring-color);
}

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

.btn-primary {
    background: var(--color-accent);
    color: #000000;
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-accent-hover);
}

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

.btn-secondary:hover:not(:disabled) {
    background: var(--color-bg-elevated);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
}

.btn-danger {
    background: var(--color-error);
    color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-lg {
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-base);
    border-radius: var(--radius-xl);
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
}

.btn-icon {
    padding: var(--space-3);
    border-radius: var(--radius-full);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

.btn-full {
    width: 100%;
}

/* ------------------------------------------------
   Form Elements
   ------------------------------------------------ */
.form-group {
    margin-bottom: var(--space-4);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-2);
}

.form-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    font-family: inherit;
    color: var(--color-text-primary);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-light);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    background-size: 16px;
    padding-right: var(--space-10);
}

/* Duration Picker */
.duration-picker {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.duration-btn {
    flex: 1;
    min-width: 60px;
    padding: var(--space-3);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.duration-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-text-primary);
}

.duration-btn.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #ffffff;
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--color-text-muted);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.toggle input:checked+.toggle-slider {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.toggle input:checked+.toggle-slider::before {
    transform: translateX(20px);
    background: #ffffff;
}

/* ------------------------------------------------
   Session Card
   ------------------------------------------------ */
.session-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.session-card:hover {
    border-color: var(--color-accent);
    transform: translateY(-2px);
}

.session-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-2xl);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-lg);
    flex-shrink: 0;
}

.session-info {
    flex: 1;
    min-width: 0;
}

.session-subject {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-meta {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.session-status {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.session-status.pending {
    background: var(--color-warning);
}

.session-status.active {
    background: var(--color-accent);
    animation: pulse 1.5s infinite;
}

.session-status.completed {
    background: var(--color-success);
}

.session-status.skipped {
    background: var(--color-text-muted);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.session-action {
    flex-shrink: 0;
}

/* ------------------------------------------------
   Progress Components
   ------------------------------------------------ */
.progress-ring {
    position: relative;
    width: 120px;
    height: 120px;
}

.progress-ring svg {
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: var(--color-bg-tertiary);
    stroke-width: 8;
}

.progress-ring-fill {
    fill: none;
    stroke: var(--color-accent);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.3s ease;
}

.progress-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-value {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
    font-family: var(--font-mono);
}

.progress-label {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--color-accent);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.progress-bar-fill.success {
    background: var(--color-success);
}

/* ------------------------------------------------
   Timer Display
   ------------------------------------------------ */
.timer-display {
    text-align: center;
    padding: var(--space-8) 0;
}

.timer-ring {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto var(--space-6);
}

.timer-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-ring-bg {
    fill: none;
    stroke: var(--color-bg-tertiary);
    stroke-width: 12;
}

.timer-ring-fill {
    fill: none;
    stroke: var(--color-accent);
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

.timer-ring-fill.break {
    stroke: var(--color-success);
}

.timer-time {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-mono);
    font-size: var(--text-6xl);
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
}

.timer-subject {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
}

.timer-status {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    margin-top: var(--space-6);
}

.timer-btn {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.timer-btn svg {
    width: 28px;
    height: 28px;
}

.timer-btn-primary {
    background: var(--color-accent);
    color: #ffffff;
}

.timer-btn-primary:hover {
    background: var(--color-accent-hover);
    transform: scale(1.05);
}

.timer-btn-secondary {
    background: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.timer-btn-secondary:hover {
    background: var(--color-bg-elevated);
}

/* ------------------------------------------------
   Stats / Summary
   ------------------------------------------------ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.stat-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-4);
    text-align: center;
}

.stat-value {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
    font-family: var(--font-mono);
}

.stat-label {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-1);
}

.stat-icon {
    font-size: var(--text-xl);
    margin-bottom: var(--space-2);
}

/* Subject Bar */
.subject-bar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border-light);
}

.subject-bar:last-child {
    border-bottom: none;
}

.subject-color {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.subject-name {
    flex: 1;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-text-primary);
}

.subject-time {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    font-family: var(--font-mono);
}

/* Week Chart */
.week-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 120px;
    padding: var(--space-4) 0;
    gap: var(--space-2);
}

.week-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.week-bar-fill {
    width: 100%;
    max-width: 24px;
    background: var(--color-accent);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: height 0.3s ease;
    min-height: 4px;
}

.week-bar-label {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.week-bar.today .week-bar-fill {
    background: var(--color-success);
}

.week-bar.today .week-bar-label {
    color: var(--color-success);
    font-weight: var(--font-semibold);
}

/* ------------------------------------------------
   Modals
   ------------------------------------------------ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    padding: var(--space-4);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 100%;
    max-width: var(--max-width);
    max-height: 90vh;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    padding: var(--space-6);
    transform: translateY(100%);
    transition: transform var(--transition-slow);
    overflow-y: auto;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-handle {
    width: 40px;
    height: 4px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    margin: 0 auto var(--space-4);
}

.modal-title {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-4);
}

.modal-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

.modal-actions .btn {
    flex: 1;
}

/* ------------------------------------------------
   Empty State
   ------------------------------------------------ */
.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-4);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.empty-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
}

.empty-text {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-6);
}

/* ------------------------------------------------
   Settings List
   ------------------------------------------------ */
.settings-group {
    margin-bottom: var(--space-6);
}

.settings-title {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-3);
    padding-left: var(--space-4);
}

.settings-list {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
    border-bottom: 1px solid var(--color-border-light);
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item-info {
    flex: 1;
}

.settings-item-label {
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    color: var(--color-text-primary);
}

.settings-item-desc {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-1);
}

/* ------------------------------------------------
   Loading States
   ------------------------------------------------ */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: var(--space-4);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

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

/* ------------------------------------------------
   Tabs
   ------------------------------------------------ */
.tabs {
    display: flex;
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--space-1);
    margin-bottom: var(--space-4);
}

.tab {
    flex: 1;
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--color-text-secondary);
}

.tab.active {
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------
   Streak Badge
   ------------------------------------------------ */
.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--color-warning-light);
    color: var(--color-warning);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
}

/* ------------------------------------------------
   Confetti Animation
   ------------------------------------------------ */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.confetti {
    position: absolute;
    top: -10px;
    border-radius: 2px;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ------------------------------------------------
   Pomodoro Indicator
   ------------------------------------------------ */
.pomodoro-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
}

.pomodoro-label {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-text-secondary);
}

.pomodoro-dots {
    display: flex;
    gap: var(--space-2);
}

.pomodoro-dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    background: var(--color-bg-elevated);
    border: 2px solid var(--color-border);
}

.pomodoro-dot.completed {
    background: var(--color-success);
    border-color: var(--color-success);
}

/* ------------------------------------------------
   Utilities
   ------------------------------------------------ */
.mt-2 {
    margin-top: var(--space-2);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mt-6 {
    margin-top: var(--space-6);
}

.mb-2 {
    margin-bottom: var(--space-2);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.hidden {
    display: none;
}

.sessions-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* ------------------------------------------------
   Responsive
   ------------------------------------------------ */
@media (min-width: 480px) {
    .modal {
        border-radius: var(--radius-2xl);
        margin-bottom: var(--space-4);
    }

    .modal-overlay {
        align-items: center;
    }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ================================================
   ONBOARDING STYLES
   ================================================ */
.onboarding-view {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.onboarding-container {
    width: 100%;
    max-width: 400px;
}

.onboarding-progress {
    margin-bottom: var(--space-6);
}

.onboarding-progress .progress-bar {
    height: 6px;
    margin-bottom: var(--space-2);
}

.progress-text {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    text-align: center;
}

.onboarding-content {
    margin-bottom: var(--space-6);
}

.onboarding-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    text-align: center;
    margin-bottom: var(--space-2);
}

.onboarding-subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    text-align: center;
    margin-bottom: var(--space-6);
}

.onboarding-nav {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
}

/* Welcome Step */
.welcome-step {
    text-align: center;
}

.welcome-icon {
    font-size: 4rem;
    margin-bottom: var(--space-4);
}

.feature-highlights {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-6);
    text-align: left;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
}

.feature-icon {
    font-size: var(--text-xl);
}

/* Occupation Grid */
.occupation-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.occupation-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4);
    background: var(--color-bg-tertiary);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.occupation-btn:hover {
    border-color: var(--color-accent);
}

.occupation-btn.active {
    background: var(--color-accent-light);
    border-color: var(--color-accent);
}

.occupation-icon {
    font-size: var(--text-2xl);
}

.occupation-label {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

/* Interests Grid */
.interests-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.interest-btn {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--color-bg-secondary);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}

.interest-btn:hover {
    border-color: var(--color-accent);
}

.interest-btn.active {
    background: var(--color-accent-light);
    border-color: var(--color-accent);
}

.interest-btn.active .interest-check {
    opacity: 1;
    color: var(--color-accent);
}

.interest-icon {
    font-size: var(--text-xl);
    flex-shrink: 0;
}

.interest-content {
    flex: 1;
}

.interest-label {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    display: block;
}

.interest-desc {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.interest-check {
    opacity: 0;
    transition: opacity var(--transition-fast);
}

/* Partner Form */
.add-partner-form {
    margin-top: var(--space-4);
}

.form-row {
    display: flex;
    gap: var(--space-2);
}

.form-row .form-input {
    flex: 1;
}

.partner-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-2);
}

.partner-avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent);
    color: white;
    font-weight: var(--font-bold);
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.partner-info {
    flex: 1;
    min-width: 0;
}

.partner-name {
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
}

.partner-contact {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

/* ================================================
   GOALS STYLES
   ================================================ */
.goals-view .view-header {
    margin-bottom: var(--space-4);
}

.goals-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.goal-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-4);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.goal-card:hover {
    border-color: var(--color-accent);
    transform: translateY(-2px);
}

.goal-card.completed {
    opacity: 0.7;
}

.goal-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.goal-category-icon {
    font-size: var(--text-lg);
}

.goal-category-label {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.goal-completed-badge {
    margin-left: auto;
    font-size: var(--text-xs);
    color: var(--color-success);
    font-weight: var(--font-medium);
}

.goal-title {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
}

.goal-description {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-3);
}

.goal-progress {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.goal-progress .progress-bar {
    flex: 1;
}

.goal-progress .progress-text {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--color-text-secondary);
}

.goal-footer {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-bottom: var(--space-3);
}

.goal-actions {
    display: flex;
    gap: var(--space-2);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border);
}

/* Category Picker */
.category-picker {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.category-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
    background: var(--color-bg-tertiary);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.category-btn:hover {
    border-color: var(--color-accent);
}

.category-btn.active {
    background: var(--color-accent-light);
    border-color: var(--color-accent);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-range {
    width: 100%;
    height: 8px;
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-full);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: var(--color-accent);
    border-radius: var(--radius-full);
    cursor: pointer;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    font-size: var(--text-sm);
}

.form-checkbox input {
    width: 20px;
    height: 20px;
    accent-color: var(--color-accent);
}

/* ================================================
   PARTNERS STYLES
   ================================================ */
.partner-detail-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-3);
}

.partner-avatar-large {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-accent) 0%, #8b5cf6 100%);
    color: white;
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.partner-details {
    flex: 1;
    min-width: 0;
}

.partner-details .partner-name {
    font-size: var(--text-base);
    margin-bottom: var(--space-1);
}

.partner-details .partner-contact {
    font-size: var(--text-sm);
}

.partner-added {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-1);
}

.partner-actions {
    display: flex;
    gap: var(--space-1);
}

.participants-select {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.participant-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-lg);
    cursor: pointer;
}

.participant-avatar {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent);
    color: white;
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    border-radius: var(--radius-full);
}

.participant-name {
    flex: 1;
    font-size: var(--text-sm);
}

/* ================================================
   TOOLS STYLES
   ================================================ */
.tools-view .section-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-2);
}

.tools-view .section-subtitle {
    font-size: var(--text-sm);
    margin-bottom: var(--space-4);
}

.quick-tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2);
}

.quick-tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quick-tool-btn:hover {
    border-color: var(--color-accent);
    transform: translateY(-2px);
}

.quick-icon {
    font-size: var(--text-xl);
}

.quick-tool-btn span:last-child {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.tools-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.tool-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tool-card:hover {
    border-color: var(--color-accent);
    transform: translateY(-2px);
}

.tool-card.recommended {
    border-color: var(--color-accent);
    background: var(--color-accent-light);
}

.tool-icon-wrapper {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    flex-shrink: 0;
}

.tool-icon {
    font-size: var(--text-xl);
}

.tool-content {
    flex: 1;
    min-width: 0;
}

.tool-name {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-1);
}

.tool-description {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.tool-arrow {
    color: var(--color-text-muted);
    flex-shrink: 0;
}

/* Tool Modal */
.tool-modal {
    max-height: 85vh;
    overflow-y: auto;
}

.tool-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.tool-interface {
    margin-top: var(--space-4);
}

.upload-area {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    text-align: center;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: var(--space-4);
}

.generate-btn {
    margin-top: var(--space-4);
}

.tool-result {
    padding: var(--space-4);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-lg);
}

.tool-result h4 {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-3);
}

.result-content {
    font-size: var(--text-sm);
    line-height: var(--line-height-relaxed);
}

.slide-preview {
    padding: var(--space-3);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
}

.slide-number {
    font-size: var(--text-xs);
    color: var(--color-accent);
    font-weight: var(--font-medium);
}

.slide-preview h5 {
    font-size: var(--text-sm);
    margin: var(--space-1) 0;
}

/* Lifestyle Tips */
.lifestyle-tips {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
}

.lifestyle-tip-card {
    padding: var(--space-3);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-lg);
    text-align: center;
}

.tip-icon {
    font-size: var(--text-2xl);
    display: block;
    margin-bottom: var(--space-2);
}

.lifestyle-tip-card p {
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
}

.habit-checklist h4 {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-3);
}

.habit-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    font-size: var(--text-sm);
    cursor: pointer;
}

.habit-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--color-success);
}

/* Study Helper */
.study-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
}

.study-option-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4);
    background: var(--color-bg-tertiary);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.study-option-btn:hover {
    border-color: var(--color-accent);
}

.study-option-btn.active {
    background: var(--color-accent-light);
    border-color: var(--color-accent);
}

.option-icon {
    font-size: var(--text-2xl);
}

.option-label {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
}

.option-desc {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.study-content {
    padding: var(--space-4);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-lg);
    min-height: 120px;
}

/* Meditation */
.meditation-options {
    display: flex;
    justify-content: center;
    gap: var(--space-3);
}

.meditation-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-4) var(--space-6);
    background: var(--color-bg-tertiary);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.meditation-btn:hover {
    border-color: var(--color-accent);
    transform: scale(1.05);
}

.meditation-btn .duration {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
}

.meditation-btn .label {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

/* Modal Large */
.modal-large {
    max-width: 500px;
}

/* Gap utilities */
.gap-3 {
    gap: var(--space-3);
}

/* ================================================
   UTILITIES & ANIMATIONS
   ================================================ */

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    border-top-color: #000;
    animation: spin 0.8s linear infinite;
    margin-right: var(--space-2);
}

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

/* Glassmorphism */
.glass-panel {
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.36);
}

/* Animation Utilities */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.4s ease forwards;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Form Styles Enhancement */
.form-input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px var(--color-bg-primary), 0 0 0 4px var(--ring-color);
}

/* Toast Notification (Optional future use) */
.toast {
    position: fixed;
    bottom: var(--space-6);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    box-shadow: var(--shadow-xl);
    z-index: 200;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.gap-4 {
    gap: var(--space-4);
}