/**
 * Wequity Prototype Styles
 * iOS-focused design following ui-styling-guide.md
 * Therapeutic Minimalism with Platform-Native Design
 */

/* ===== ROOT VARIABLES ===== */
:root {
    /* Primary Brand Colors - Wequity Theme */
    --wequity-indigo: #6366F1;
    --wequity-green: #059669;
    --wequity-navy: #0A0E1A;
    
    /* iOS Dark Theme Colors (Primary) */
    --deep-charcoal: #0A0E1A;        /* Deep navy background */
    --off-charcoal: #1A1F2E;         /* Raised surfaces/cards */
    --soft-white: #F3F4F6;           /* Primary text in dark mode */
    --warm-gray: #A0AEC0;            /* Secondary text */
    
    /* iOS System Colors */
    --primary-blue: #0A84FF;         /* iOS system blue for selections */
    --green-accent: #34C759;         /* iOS system green for success */
    --selection-highlight: #2A3142;  /* Selection background */
    
    /* Gradients - Decorative Only (Non-Interactive) */
    --gradient-dark: linear-gradient(to right, #6366F1, #34D399);
    --gradient-light: linear-gradient(to right, #6366F1, #059669);
    
    /* Spacing - 8px Base Grid */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    
    /* Border Radius - iOS Style */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 9999px;
    
    /* Shadows - Subtle iOS-style */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
    
    /* Animation Durations */
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 350ms;
}

/* ===== GLOBAL STYLES ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", sans-serif;
    background-color: var(--deep-charcoal);
    color: var(--soft-white);
    line-height: 1.5;
    min-height: 100vh;
    overscroll-behavior: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

h1 {
    font-size: 2rem;      /* 32px */
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.5rem;    /* 24px */
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.25rem;   /* 20px */
}

h4 {
    font-size: 1.125rem;  /* 18px */
}

p {
    margin: 0;
    line-height: 1.6;
}

.text-sm {
    font-size: 0.875rem;  /* 14px */
}

.text-xs {
    font-size: 0.75rem;   /* 12px */
}

/* ===== LAYOUT CONTAINERS ===== */
.screen-container {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: var(--spacing-lg);
}

.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
}

/* ===== HEADER / NAVIGATION BAR ===== */
.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) 0;
    margin-bottom: var(--spacing-lg);
}

.back-button {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--primary-blue);
    font-size: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-sm);
    margin-left: calc(-1 * var(--spacing-sm));
    min-width: 44px;
    min-height: 44px;
}

.back-button:active {
    opacity: 0.6;
}

.progress-indicator {
    color: var(--warm-gray);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ===== BUTTONS ===== */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    padding: 14px 24px;
    min-height: 48px;
    min-width: 44px;
    border: none;
    cursor: pointer;
    transition: all var(--duration-fast) ease;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--wequity-indigo);
    color: white;
}

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

.btn-secondary {
    background-color: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-secondary:active {
    background-color: rgba(10, 132, 255, 0.1);
}

.btn-ghost {
    background-color: transparent;
    color: var(--soft-white);
}

.btn-ghost:active {
    background-color: rgba(255, 255, 255, 0.1);
}

.btn-success {
    background-color: var(--green-accent);
    color: white;
}

/* ===== INLINE LINKS ===== */
.inline-link {
    background: none;
    border: none;
    color: var(--primary-blue);
    font-size: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    display: inline;
    transition: opacity var(--duration-fast) ease;
}

.inline-link:hover,
.inline-link:focus {
    text-decoration: underline;
}

.inline-link:active {
    opacity: 0.6;
}

/* ===== CARDS ===== */
.card {
    background-color: var(--off-charcoal);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.card-description {
    color: var(--warm-gray);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* ===== SELECTION OPTIONS ===== */
.option-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.selectable-option {
    background-color: var(--off-charcoal);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    cursor: pointer;
    transition: all var(--duration-normal) ease;
    position: relative;
}

.selectable-option:active {
    transform: scale(0.98);
}

.selectable-option.selected {
    border-color: var(--primary-blue);
    background-color: var(--selection-highlight);
}

.selectable-option .checkmark {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--primary-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all var(--duration-normal) ease;
}

.selectable-option.selected .checkmark {
    opacity: 1;
    transform: scale(1);
}

.option-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.option-description {
    color: var(--warm-gray);
    font-size: 0.875rem;
}

/* ===== BADGES & LABELS ===== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-recommended {
    background-color: var(--green-accent);
    color: white;
}

.badge-info {
    background-color: var(--primary-blue);
    color: white;
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-pill);
    overflow: hidden;
    margin-bottom: var(--spacing-lg);
}

.progress-fill {
    height: 100%;
    background: var(--gradient-dark);
    transition: width var(--duration-slow) ease;
}

/* ===== MODALS & BOTTOM SHEETS ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration-slow) ease, visibility 0s var(--duration-slow);
    z-index: 1000;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
    transition: opacity var(--duration-slow) ease;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--off-charcoal);
    border-top-left-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-xl);
    padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-2xl);
    transform: translateY(100%);
    transition: transform var(--duration-slow) cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.modal-overlay.visible .bottom-sheet {
    transform: translateY(0);
}

.bottom-sheet-handle {
    width: 36px;
    height: 5px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-pill);
    margin: 0 auto var(--spacing-lg);
}

.bottom-sheet-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    text-align: center;
}

/* ===== FORM INPUTS ===== */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--soft-white);
}

.form-input,
.form-textarea {
    width: 100%;
    background-color: var(--off-charcoal);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-size: 1rem;
    color: var(--soft-white);
    font-family: inherit;
    transition: border-color var(--duration-normal) ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
}

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

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--warm-gray);
}

/* ===== CHECKBOXES ===== */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--off-charcoal);
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--duration-normal) ease;
}

.checkbox-option:active {
    transform: scale(0.98);
}

.checkbox-option.checked {
    border-color: var(--primary-blue);
    background-color: var(--selection-highlight);
}

.checkbox-icon {
    width: 24px;
    height: 24px;
    border: 2px solid var(--warm-gray);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-normal) ease;
    flex-shrink: 0;
}

.checkbox-option.checked .checkbox-icon {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.checkbox-label {
    flex: 1;
    font-size: 1rem;
}

/* ===== LISTS ===== */
.list-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
}

.list-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green-accent);
}

/* ===== UTILITY CLASSES ===== */
.text-center {
    text-align: center;
}

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.text-primary { color: var(--primary-blue); }
.text-secondary { color: var(--warm-gray); }
.text-success { color: var(--green-accent); }

/* ===== LUCIDE ICON STYLES (Cupertino-inspired) ===== */
/* Base icon styles following iOS SF Symbols principles */
.lucide-icon,
i[data-lucide] {
    stroke-width: 1.5;
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
    color: currentColor;
}

/* Icon size variants */
.lucide-icon-sm {
    width: 16px;
    height: 16px;
}

.lucide-icon-lg {
    width: 24px;
    height: 24px;
}

.lucide-icon-xl {
    width: 32px;
    height: 32px;
}

.lucide-icon-2xl {
    width: 48px;
    height: 48px;
}

.lucide-icon-3xl {
    width: 64px;
    height: 64px;
}

/* Interactive icon wrapper - meets iOS 44px minimum touch target */
.lucide-icon-interactive {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--duration-fast);
}

.lucide-icon-interactive:active {
    background: var(--selection-highlight);
}

/* Icon color variants */
.lucide-icon-primary {
    color: var(--wequity-indigo);
}

.lucide-icon-success {
    color: var(--green-accent);
}

.lucide-icon-secondary {
    color: var(--warm-gray);
}

/* Tab bar icon styles (iOS-native) */
.tab-icon i[data-lucide] {
    stroke-width: 1.5;
    width: 24px;
    height: 24px;
}

.tab-item.active .tab-icon {
    background: rgba(99, 102, 241, 0.12);
    border-radius: 12px;
    padding: 8px 12px;
}

/* Menu item icons */
.menu-item-icon i[data-lucide] {
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
}

/* Navigation bar icons */
.nav-button i[data-lucide] {
    width: 20px;
    height: 20px;
    stroke-width: 1.5;
}

/* FAB menu icons */
.fab-menu-item-icon i[data-lucide] {
    width: 20px;
    height: 20px;
    stroke-width: 1.5;
    margin-right: 8px;
}

/* Badge icons (small inline icons) */
.task-badge i[data-lucide],
.badge-icon i[data-lucide] {
    width: 16px;
    height: 16px;
    stroke-width: 1.5;
}

/* ===== ACCESSIBILITY ===== */
.focus-indicator:focus {
    outline: 2px solid var(--wequity-indigo);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (min-width: 768px) {
    .screen-container {
        padding: var(--spacing-2xl);
    }
    
    .content-wrapper {
        max-width: 600px;
    }
}
