/* ===== ALPHAS PWA - MAIN STYLESHEET ===== */
/* Version 3.0 - Final Production Ready */

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

:root {
    /* Core Colors */
    --bg: #000000;
    --bg-card: #0d0d12;
    --bg-elevated: #333;
    --bg-elevated-hover: #333;
    
    /* Lime */
    --lime: #B4FF39;
    --lime-glow: rgba(180, 255, 57, 0.3);
    
    /* Category Colors */
    --nutrition: #22c55e;
    --strength: #6b7280;
    --team-psych: #3b82f6;
    --mental: #a855f7;
    --recovery: #14b8a6;
    --competition: #f97316;
    --stress: #ef4444;
    --leadership: #eab308;
    
    /* Text */
    --text: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;
    
    /* Borders */
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.12);
    
    /* Safe Areas */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    
    /* Layout - Mobile First */
    --content-width: 100%;
    --content-padding: 16px;
    --card-min-height: 420px;
    --card-padding: 24px;
    --card-radius: 20px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

input, textarea {
    -webkit-user-select: text;
    user-select: text;
}

/* ===== SCREENS ===== */
.screen {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

/* ===== AUTH SCREEN ===== */
.auth-screen {
    background: var(--bg);
    align-items: center;
    justify-content: center;
    padding: 24px;
    padding-top: calc(24px + var(--safe-top));
    padding-bottom: calc(24px + var(--safe-bottom));
    overflow-y: auto;
}

.auth-container {
    width: 100%;
    max-width: 380px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.auth-logo-img {
    width: clamp(100px, 25vw, 140px);
    height: clamp(100px, 25vw, 140px);
    object-fit: contain;
    border-radius: 28px;
    box-shadow: 
        0 0 60px rgba(180, 255, 57, 0.2),
        0 20px 50px rgba(0, 0, 0, 0.5);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.auth-logo-img:hover {
    transform: scale(1.03);
    box-shadow: 
        0 0 80px rgba(180, 255, 57, 0.3),
        0 25px 60px rgba(0, 0, 0, 0.6);
}

.auth-title {
    font-size: clamp(26px, 6vw, 32px);
    font-weight: 700;
    text-align: center;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    font-size: clamp(14px, 3vw, 16px);
    color: var(--text-muted);
    text-align: center;
    margin-top: -12px;
    font-weight: 400;
}

.auth-btn {
    margin-top: 8px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 4px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.auth-switch {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--lime);
    text-decoration: none;
    font-weight: 600;
    transition: opacity var(--transition-fast);
}

.auth-switch a:hover {
    opacity: 0.8;
}

/* ===== ONBOARDING SCREEN ===== */
.onboarding-screen {
    background: linear-gradient(180deg, #000000 0%, #0a0a0f 100%);
    padding: calc(50px + var(--safe-top)) 24px calc(30px + var(--safe-bottom));
    justify-content: space-between;
    align-items: center;
}

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

.alpha-symbol {
    font-size: clamp(56px, 12vw, 80px);
    font-weight: 200;
    font-style: italic;
    background: linear-gradient(135deg, var(--lime), #d4ff70);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 8px;
}

.onboard-title {
    font-size: clamp(18px, 4vw, 24px);
    font-weight: 600;
    letter-spacing: 4px;
    margin-bottom: 6px;
}

.onboard-subtitle {
    font-size: clamp(12px, 2.5vw, 14px);
    color: var(--text-muted);
    font-weight: 400;
}

.progress-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 16px 0;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dot.active {
    background: linear-gradient(135deg, var(--lime), #d4ff70); 
    width: 28px;
    border-radius: 4px;
}

.onboard-content {
    width: 100%;
    max-width: 380px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 8px;
}

.onboard-step {
    display: none;
    animation: fadeSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.onboard-step.active {
    display: block;
}

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

.step-title {
    font-size: clamp(22px, 5vw, 28px);
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
    letter-spacing: -0.3px;
}

.step-desc {
    font-size: clamp(13px, 3vw, 15px);
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 28px;
    line-height: 1.5;
}

/* ===== FORM INPUTS ===== */
.input-group {
    margin-bottom: 18px;
}

.input-group label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 16px 18px;
    background: #333;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    font-size: 16px;
    font-weight: 400;
    outline: none;
    transition: all var(--transition-fast);
}

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

.input-group input:focus,
.input-group select:focus {
    border-color: var(--lime);
    box-shadow: 0 0 0 3px var(--lime-glow);
}

.input-group 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='%23B4FF39' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    padding-right: 48px;
    cursor: pointer;
}

.input-group select option {
    background: #1a1a1a;
    color: var(--text);
}

/* ===== CHIPS ===== */
.gender-chips,
.reason-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.chip {
    padding: 14px 22px;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border-light);
    border-radius: 28px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.chip:hover {
    border-color: rgba(180, 255, 57, 0.5);
    background: rgba(180, 255, 57, 0.08);
}

.chip.selected {
    background: linear-gradient(135deg, var(--lime), #9ee622);
    color: #000;
    border-color: transparent;
    font-weight: 600;
    transform: scale(1.02);
}

/* ===== BUTTONS ===== */
.btn-primary {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--lime), #9ee622); 
    border: none;
    border-radius: 30px;
    color: #000;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    letter-spacing: 0.3px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px var(--lime-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    padding: 14px 28px;
    background: var(--lime);
    border-color: var(--lime); 
    border: 1.5px solid var(--lime-glow);
    border-radius: 25px;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--lime-glow);
    border-color: var(--lime);
}

.onboard-nav {
    width: 100%;
    max-width: 380px;
    padding: 0 8px;
}

/* ===== MAIN APP SCREEN ===== */
.main-screen {
    background: var(--bg);
}

/* ===== LAYOUT WRAPPER - Controls max-width for header, card, and nav ===== */
.app-header,
.card-container,
.bottom-nav {
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* ===== APP HEADER ===== */
.app-header {
    padding: calc(12px + var(--safe-top)) var(--content-padding) 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    gap: 10px;
}

.header-right {
    display: flex;
    align-items: center;
}

.header-stat {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px;
    background: var(--bg-elevated);
    border-radius: 22px;
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.stat-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    opacity: 0.8;
}

.stat-value {
    font-variant-numeric: tabular-nums;
}

.settings-btn {
    width: 46px;
    height: 46px;
    background: var(--bg-elevated);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.settings-btn:hover {
    background: var(--bg-elevated-hover);
    color: var(--text);
}

.settings-btn svg {
    width: 22px;
    height: 22px;
}

/* ===== CARD CONTAINER ===== */
.card-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px var(--content-padding);
    position: relative;
    overflow: hidden;
}

/* ===== WISDOM CARD - Index Card Style ===== */
.wisdom-card {
    width: 100%;
    min-height: var(--card-min-height);
    background: var(--bg-card);
    border-radius: var(--card-radius);
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    box-shadow: 
        0 4px 24px rgba(0, 0, 0, 0.4),
        0 12px 48px rgba(0, 0, 0, 0.3);
}

/* Glowing Top Bar 
.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--card-accent, var(--lime));
    border-radius: var(--card-radius) var(--card-radius) 0 0;
    z-index: 10;
    box-shadow: 
        0 0 15px var(--card-accent, var(--lime)),
        0 0 30px var(--card-accent, var(--lime)),
        0 0 45px rgba(249, 115, 22, 0.3),
        0 2px 20px var(--card-accent, var(--lime));
}
*/

/* Outer Border Glow */
.wisdom-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--card-radius);
    border: 2px solid var(--card-accent, var(--lime));
    opacity: 0.45;
    pointer-events: none;
    z-index: 5;
}

/* Left Edge Glow 
.wisdom-card::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 0;
    height: 50%;
    width: 1.5px;
    background: linear-gradient(180deg, var(--card-accent, var(--lime)) 0%, transparent 100%);
    opacity: 0.6;
    z-index: 5;
}
*/

/* Card Inner */
.card-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: var(--card-padding);
    padding-top: 32px;
    padding-bottom: 100px; /* Space for badge */
}

/* Right Edge Glow 
.card-inner::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    height: 50%;
    width: 1px;
    background: linear-gradient(180deg, var(--card-accent, var(--lime)) 0%, transparent 100%);
    opacity: 0.6;
}
*/

/* Card Content - Centered Text */
.card-content {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    max-width: 100%;
}

.card-text {
    font-size: clamp(18px, 4.5vw, 26px);
    line-height: 1.5;
    font-weight: 400;
    color: var(--text);
    letter-spacing: -0.2px;
}

/* Category Badge - Bottom Center */
.card-category-badge {
    position: absolute;
    bottom: var(--card-padding);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.6);
    border: 1.5px solid var(--card-accent, var(--lime));
    border-radius: 30px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 
        0 0 15px rgba(249, 115, 22, 0.15),
        inset 0 0 20px rgba(249, 115, 22, 0.03);
    white-space: nowrap;
}

.category-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--card-accent, var(--lime));
}

.category-icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--card-accent, var(--lime));
    fill: none;
}

.card-recovery .category-icon svg {
    fill: var(--card-accent);
    stroke: var(--card-accent);
}

.category-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--card-accent, var(--lime));
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* ===== CATEGORY COLOR CLASSES ===== */
.card-nutrition { --card-accent: var(--nutrition); }
.card-strength { --card-accent: var(--strength); }
.card-teamPsych { --card-accent: var(--team-psych); }
.card-mental { --card-accent: var(--mental); }
.card-recovery { --card-accent: var(--recovery); }
.card-competition { --card-accent: var(--competition); }
.card-stressResponse { --card-accent: var(--stress); }
.card-leadership { --card-accent: var(--leadership); }
.card-default { --card-accent: var(--lime); }

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-elevated);
    border-radius: 20px;
    padding: 16px 24px;
    margin: 0 var(--content-padding) calc(12px + var(--safe-bottom));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    flex-shrink: 0;
    
}

.nav-stat,
.nav-swipe,
.nav-ranks {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.nav-stat-value {
    font-size: 22px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.nav-stat-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-swipe {
    gap: 2px;
}

.swipe-arrow {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1;
    animation: bounceUp 2s ease-in-out infinite;
}

.swipe-arrow.flip {
    transform: rotate(180deg);
    animation: bounceDown 2s ease-in-out infinite;
}

.swipe-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

@keyframes bounceUp {
    0%, 100% { transform: translateY(2px); opacity: 0.5; }
    50% { transform: translateY(-2px); opacity: 1; }
}

@keyframes bounceDown {
    0%, 100% { transform: rotate(180deg) translateY(2px); opacity: 0.5; }
    50% { transform: rotate(180deg) translateY(-2px); opacity: 1; }
}

.nav-ranks {
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.nav-ranks:hover {
    opacity: 0.7;
}

.nav-ranks svg {
    width: 24px;
    height: 24px;
    fill: var(--text-muted);
}

/* ===== LOADING STATE ===== */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 20px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(249, 115, 22, 0.15);
    border-top-color: var(--lime);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 40px;
    text-align: center;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 16px;
}

/* ===== SETTINGS MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

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

.modal {
    background: #1a1a1f;
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: #1a1a1f;
    z-index: 1;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close-btn {
    width: 36px;
    height: 36px;
    background: var(--bg-elevated);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.modal-close-btn:hover {
    background: var(--bg-elevated-hover);
    color: var(--text);
}

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

.modal-body {
    padding: 24px;
}

.settings-user {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 20px;
    background: var(--bg-elevated);
    border-radius: 16px;
    margin-bottom: 24px;
}

.settings-handle {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.settings-email {
    font-size: 14px;
    color: var(--text-muted);
}

.settings-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-action-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-elevated);
    border: none;
    border-radius: 14px;
    color: var(--text);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}

.settings-action-btn:hover {
    background: var(--bg-elevated-hover);
}

.settings-action-btn svg {
    color: var(--text-muted);
}

.settings-action-btn.danger {
    color: var(--stress);
}

.settings-action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.settings-action-btn.danger svg {
    color: var(--stress);
}

.modal-footer {
    padding: 16px 24px calc(16px + var(--safe-bottom));
    border-top: 1px solid var(--border);
    text-align: center;
}

.settings-version {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: calc(100px + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--lime);
    padding: 14px 28px;
    border-radius: 28px;
    font-size: 14px;
    font-weight: 600;
    color: #000;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    box-shadow: 0 10px 40px var(--lime-glow);
    white-space: nowrap;
}

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

/* ===== RESPONSIVE - TABLET (768px+) ===== */
@media (min-width: 768px) {
    :root {
        --content-padding: 24px;
        --card-min-height: 480px;
        --card-padding: 32px;
        --card-radius: 24px;
    }
    
    /* All main elements get same max-width */
    .app-header,
    .card-container,
    .bottom-nav {
        max-width: 600px;
    }
    
    .app-header {
        padding: calc(16px + var(--safe-top)) 0 16px;
    }
    
    .card-container {
        padding: 16px 0;
    }
    
    .bottom-nav {
        margin-left: auto;
        margin-right: auto;
        padding: 18px 32px;
    }
    
    .header-stat {
        padding: 12px 20px;
        font-size: 15px;
    }
    
    .card-text {
        font-size: clamp(20px, 4vw, 28px);
    }
    
    .card-category-badge {
        padding: 14px 28px;
    }
    
    .category-label {
        font-size: 12px;
    }
    
    .nav-stat-value {
        font-size: 24px;
    }
    
    .modal {
        border-radius: 24px;
        margin: auto;
        max-height: 80vh;
    }
    
    .modal-overlay {
        align-items: center;
        padding: 24px;
    }
}

/* ===== RESPONSIVE - DESKTOP (1024px+) ===== */
@media (min-width: 1024px) {
    :root {
        --content-padding: 32px;
        --card-min-height: 520px;
        --card-padding: 40px;
        --card-radius: 28px;
    }
    
    .app-header,
    .card-container,
    .bottom-nav {
        max-width: 680px;
    }
    
    .app-header {
        padding: calc(20px + var(--safe-top)) 0 20px;
    }
    
    .card-container {
        padding: 24px 0;
    }
    
    .bottom-nav {
        padding: 20px 40px;
    }
    
    .card-text {
        font-size: 28px;
    }
    
    .card-category-badge {
        padding: 16px 32px;
    }
    
    .category-label {
        font-size: 13px;
    }
    
    .nav-stat-value {
        font-size: 26px;
    }
    
    .wisdom-card:hover {
        transform: translateY(-4px);
    }
    
    .auth-container {
        max-width: 420px;
    }
    
    .onboard-content,
    .onboard-nav {
        max-width: 420px;
    }
    
    .onboarding-screen {
        padding: calc(80px + var(--safe-top)) 40px calc(60px + var(--safe-bottom));
    }
}

/* ===== RESPONSIVE - LARGE DESKTOP (1440px+) ===== */
@media (min-width: 1440px) {
    :root {
        --card-min-height: 560px;
    }
    
    .app-header,
    .card-container,
    .bottom-nav {
        max-width: 720px;
    }
    
    .card-text {
        font-size: 30px;
    }
}

/* ===== LANDSCAPE MODE ===== */
@media (max-height: 500px) and (orientation: landscape) {
    :root {
        --card-min-height: 280px;
        --card-padding: 20px;
    }
    
    .auth-screen {
        padding: 16px 24px;
    }
    
    .auth-logo-img {
        width: 60px;
        height: 60px;
        border-radius: 14px;
    }
    
    .auth-title {
        font-size: 22px;
    }
    
    .auth-subtitle {
        font-size: 12px;
    }
    
    .onboarding-screen {
        padding: calc(16px + var(--safe-top)) 24px calc(16px + var(--safe-bottom));
    }
    
    .onboard-header {
        display: none;
    }
    
    .progress-dots {
        padding: 8px 0;
    }
    
    .step-title {
        font-size: 20px;
        margin-bottom: 4px;
    }
    
    .step-desc {
        font-size: 12px;
        margin-bottom: 16px;
    }
    
    .input-group {
        margin-bottom: 12px;
    }
    
    .input-group input,
    .input-group select {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .chip {
        padding: 10px 16px;
        font-size: 12px;
    }
    
    .btn-primary {
        padding: 14px;
        font-size: 14px;
    }
    
    .app-header {
        padding: calc(8px + var(--safe-top)) 12px 8px;
    }
    
    .header-stat {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .settings-btn {
        width: 38px;
        height: 38px;
    }
    
    .card-inner {
        padding: 20px;
        padding-bottom: 70px;
    }
    
    .card-text {
        font-size: 16px;
        line-height: 1.4;
    }
    
    .card-category-badge {
        padding: 10px 18px;
        bottom: 16px;
    }
    
    .category-label {
        font-size: 10px;
    }
    
    .bottom-nav {
        padding: 12px 20px;
        margin-bottom: calc(8px + var(--safe-bottom));
    }
    
    .nav-stat-value {
        font-size: 18px;
    }
    
    .nav-stat-label {
        font-size: 8px;
    }
    
    .toast {
        bottom: calc(70px + var(--safe-bottom));
        padding: 10px 20px;
        font-size: 12px;
    }
}

/* ===== SMALL PHONES (360px and below) ===== */
@media (max-width: 360px) {
    :root {
        --card-padding: 20px;
        --content-padding: 12px;
    }
    
    .auth-screen {
        padding: 16px;
    }
    
    .auth-logo-img {
        width: 80px;
        height: 80px;
        border-radius: 20px;
    }
    
    .auth-title {
        font-size: 24px;
    }
    
    .input-group input,
    .input-group select {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .chip {
        padding: 12px 18px;
        font-size: 13px;
    }
    
    .card-text {
        font-size: 17px;
    }
    
    .card-category-badge {
        padding: 10px 18px;
    }
    
    .category-label {
        font-size: 10px;
    }
    
    .header-stat {
        padding: 8px 12px;
        font-size: 13px;
        gap: 5px;
    }
    
    .bottom-nav {
        padding: 14px 16px;
    }
    
    .nav-stat-value {
        font-size: 20px;
    }
}

/* ===== MOBILE PHONES (max-width: 767px) ===== */
@media (max-width: 767px) {
    :root {
        --content-padding: 16px;
        --safe-bottom: env(safe-area-inset-bottom, 20px);
    }
    
    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 20px));
        border-radius: 20px 20px 0 0;
        z-index: 100;
    }
    
    /* Add padding to body/main content so it doesn't get hidden behind fixed nav */
    body {
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 20px));
    }
}

/* ===== SMALL PHONES (360px and below) ===== */
@media (max-width: 360px) {
    .bottom-nav {
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 16px));
        border-radius: 16px 16px 0 0;
    }
    
    .nav-stat-value {
        font-size: 18px;
    }
    
    /* Reduce nav icon/button sizes if you have them */
    .nav-btn,
    .nav-icon {
        width: 40px;
        height: 40px;
    }
}

/* ===== UTILITY CLASSES ===== */
.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

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

/* ===== FOCUS STATES ===== */
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 2px solid var(--lime);
    outline-offset: 2px;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .swipe-arrow {
        animation: none;
    }
    
    .spinner {
        animation: spin 2s linear infinite;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ===== SELECTION ===== */
::selection {
    background: rgba(249, 115, 22, 0.3);
    color: var(--text);
}

/* ===== PRINT ===== */
@media print {
    .screen {
        display: none !important;
    }
}
