/* ============================================
   One Habit Tracker - Styles
   ============================================ */

/* CSS Variables */
:root {
    /* ============================================
       ZEN PALETTE - Japanese Minimalist Design
       ============================================ */

    /* Primary Colors */
    --bg-milk: #F8F9FB;          /* Soft off-white - reduces eye strain */
    --sun-red: #E86A63;          /* Muted coral - the "Sun" focal point */
    --sun-glow: rgba(232, 106, 99, 0.15);  /* Sun glow effect */
    --text-indigo: #3E4A7A;      /* Deep indigo - soft contrast */
    --glass-white: rgba(255, 255, 255, 0.4);  /* Frosted glass */

    /* Semantic Color Mappings */
    --color-bg: #ffffff;
    --color-bg-secondary: #F8F9FB;
    --color-primary: #E86A63;     /* Sun red */
    --color-primary-dark: #c9564f;
    --color-success: #E86A63;     /* Same as sun - completion */
    --color-text: #3E4A7A;
    --color-text-secondary: rgba(62, 74, 122, 0.5);
    --color-border: rgba(62, 74, 122, 0.1);

    /* Spacing - 8px base unit system */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;

    /* Typography */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;
    --font-size-3xl: 3rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

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

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

/* Base Styles */
body {
    /* Zen Typography */
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    font-weight: 400;

    /* Canvas Setup */
    background-color: var(--bg-milk);
    color: var(--text-indigo);
    line-height: 1.6;

    /* Focused Experience - No scrolling for Zen feel */
    height: 100vh;
    overflow: hidden;

    /* Smooth text rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography Scale */
h1, .title {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

h2, .subtitle {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.3px;
}

.body-text {
    font-size: 16px;
    font-weight: 400;
}

.label-text {
    font-size: 14px;
    font-weight: 500;
}

/* ============================================
   ZEN HOME SCREEN - Phase 2
   ============================================ */

/* Zen Home Container */
.zen-home-container {
    position: relative;
    width: 100%;
    height: 100vh;
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible; /* Changed from hidden for Chrome mobile button compatibility */
    /* iOS Safe Area support */
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Hamburger Menu (Top Right) */
.hamburger-menu-zen {
    position: fixed; /* Changed to fixed for better iOS support */
    top: calc(20px + env(safe-area-inset-top));
    right: 20px;
    width: 44px;
    height: 44px;
    background-color: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-indigo);
    opacity: 1;
    z-index: 1001;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}

.hamburger-menu-zen:hover {
    opacity: 0.7;
}

/* Back Arrow for Progress Screen (Left) - White on Gradient */
.back-arrow-zen {
    position: fixed; /* Changed to fixed for better iOS support */
    top: calc(20px + env(safe-area-inset-top));
    left: 24px;
    width: 44px;
    height: 44px;
    background-color: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-indigo);
    opacity: 1;
    z-index: 1001;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}

.back-arrow-zen:hover {
    opacity: 0.6;
    transform: scale(1.1);
}

/* Consistent Header */
.zen-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(16px + env(safe-area-inset-top)) var(--spacing-lg) var(--spacing-md);
    min-height: calc(60px + env(safe-area-inset-top));
    z-index: 1000;
    border: none;
    /* Ensure header doesn't clip content */
    overflow: visible;
    /* iOS Safari/Chrome fix */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    /* Add background to prevent content showing through */
    background-color: var(--bg-milk);
}

/* Ensure date display is visible in header */
.zen-header .date-display-zen {
    z-index: 101;
    position: relative;
}

/* ============================================
   MOBBIN-STYLE PROGRESS LAYOUT
   ============================================ */

.progress-header-zen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    z-index: 15;
}

/* Duplicate back-arrow removed - using fixed position version above */

.progress-header-date {
    font-size: 13px;
    color: var(--text-indigo);
    opacity: 0.5;
    letter-spacing: 0.5px;
}

.zen-progress-container {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    background-color: var(--bg-milk);
    padding-top: calc(110px + env(safe-area-inset-top));
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.zen-progress-content {
    display: flex;
    flex-direction: column;
    padding: 0 var(--spacing-xl) var(--spacing-xl);
    flex: 1;
    justify-content: flex-start;
    margin-top: calc(60px + env(safe-area-inset-top));
}

/* Top Section: Title */
.progress-section-top {
    padding: 20px 20px 0;
    text-align: center;
}

.progress-title {
    font-size: 28px;
    font-weight: 400;
    color: var(--text-indigo);
    margin: 0;
    letter-spacing: 0.3px;
}

.progress-subtitle {
    font-size: 14px;
    color: var(--text-indigo);
    opacity: 0.5;
    margin: 0;
    letter-spacing: 0.2px;
}

/* Main Visual Area: Stone Garden */
.progress-section-main {
    flex: 1;
    padding: 20px 0 30px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.progress-stone-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.day-indicators {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 14px;
    margin-bottom: 12px;
    padding: 0 2px;
}

.day-letter {
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-indigo);
    opacity: 0.5;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.progress-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 14px;
}

/* Stone Design */
.progress-stone {
    aspect-ratio: 1;
    border-radius: 12px;
    background-color: #E8E9F3;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 2px 4px rgba(62, 74, 122, 0.08);
}

.progress-stone:active {
    transform: scale(0.95);
}

/* Completed Stone - Indigo with Checkmark */
.progress-stone.stone-completed {
    background: linear-gradient(135deg, #3E4A7A 0%, #2D354A 100%);
    box-shadow: 0 4px 12px rgba(62, 74, 122, 0.25);
}

.stone-checkmark {
    width: 60%;
    height: 60%;
    animation: checkmarkAppear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes checkmarkAppear {
    from {
        opacity: 0;
        transform: scale(0) rotate(-45deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

/* Today Stone - Highlighted */
.progress-stone.stone-today {
    background: linear-gradient(135deg, var(--sun-red) 0%, #D95A53 100%);
    box-shadow: 0 0 20px rgba(232, 106, 99, 0.4), 0 4px 12px rgba(232, 106, 99, 0.2);
    animation: todayPulse 2s ease-in-out infinite;
}

@keyframes todayPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(232, 106, 99, 0.4), 0 4px 12px rgba(232, 106, 99, 0.2);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 0 30px rgba(232, 106, 99, 0.6), 0 6px 16px rgba(232, 106, 99, 0.3);
    }
}

/* Future Stone - Outlined */
.progress-stone.stone-future {
    background-color: #F0F1F8;
    border: 2px solid #D8DBE8;
    box-shadow: none;
}

.progress-stone.stone-future:hover {
    border-color: #C8CCE0;
    background-color: #F5F6FA;
}

/* Stats Row */
.progress-stats-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 24px 20px;
    background: linear-gradient(135deg, rgba(62, 74, 122, 0.05) 0%, rgba(62, 74, 122, 0.02) 100%);
    border-radius: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.stat-number {
    font-size: 22px;
    font-weight: 500;
    color: var(--text-indigo);
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-indigo);
    opacity: 0.5;
    letter-spacing: 0.3px;
}

.stat-divider {
    width: 1px;
    height: 44px;
    background-color: rgba(62, 74, 122, 0.2);
}

/* Bottom Section: Continue Button */
.progress-section-bottom {
    padding: 20px;
    padding-bottom: 40px;
}

.continue-streak-btn {
    width: 100%;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--sun-red) 0%, #D95A53 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(232, 106, 99, 0.25);
    letter-spacing: 0.3px;
}

.continue-streak-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 6px rgba(232, 106, 99, 0.15);
}

.continue-streak-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(232, 106, 99, 0.35);
}

.btn-arrow {
    width: 18px;
    height: 18px;
    animation: arrowSlide 1.5s ease-in-out infinite;
}

@keyframes arrowSlide {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(4px);
    }
}

/* Settings Screen Content */
.zen-settings-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 var(--spacing-xl) var(--spacing-xl);
    padding-bottom: 40px;
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    justify-content: flex-start;
    margin-top: calc(60px + env(safe-area-inset-top));
}

/* Settings Actions Container */
.zen-settings-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

/* Settings Header with Back Arrow */
.settings-header-zen {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    height: 60px;
    margin-bottom: 0;
}

.settings-header-zen .back-arrow-zen {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.settings-header-zen .date-display-zen {
    flex: 1;
    text-align: center;
}

.zen-settings-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-indigo);
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    text-align: center;
}

.zen-settings-subtitle {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-indigo);
    opacity: 0.5;
    letter-spacing: 0.02em;
    margin-bottom: 20px;
    text-align: center;
}

.zen-settings-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.zen-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.zen-form-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-indigo);
    opacity: 0.6;
    letter-spacing: 0.02em;
}

.optional-hint {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-indigo);
    opacity: 0.5;
    font-style: italic;
}

.identity-error {
    display: none;
    font-size: 11px;
    color: #E86A63;
    margin-top: 4px;
    font-weight: 400;
}

.zen-form-input {
    width: 100%;
    padding: 12px 0;
    font-size: 18px;
    font-weight: 400;
    font-family: 'Noto Sans JP', sans-serif;
    color: var(--text-indigo);
    background-color: transparent;
    border: none;
    border-bottom: 1px solid var(--text-indigo);
    border-radius: 0;
    transition: all 0.3s ease;
    text-align: center;
    letter-spacing: 0.01em;
}

.zen-form-input:focus {
    outline: none;
    border-bottom-color: var(--text-indigo);
    opacity: 1;
}

.zen-form-input::placeholder {
    color: var(--text-indigo);
    opacity: 0.2;
}

.zen-form-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    margin-top: 16px;
    width: 100%;
}

.zen-btn-secondary {
    background-color: transparent !important;
    color: var(--text-indigo) !important;
    border: 1px solid var(--text-indigo) !important;
    box-shadow: none !important;
}

.zen-btn-secondary:hover {
    background-color: var(--text-indigo) !important;
    color: white !important;
}

/* Indigo Button for Settings Save */
.zen-btn-indigo {
    background-color: var(--text-indigo) !important;
    color: white !important;
}

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

.zen-danger-zone {
    margin-top: 16px;
    padding-bottom: 8px;
    text-align: center;
}

/* Restriction Notice */
.zen-restriction-notice {
    background-color: rgba(62, 74, 122, 0.05);
    border-left: 3px solid var(--text-indigo);
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 8px;
}

.zen-restriction-notice p {
    margin: 0;
    font-size: 14px;
    color: var(--text-indigo);
    line-height: 1.6;
    opacity: 0.8;
}

.zen-streak-hint {
    margin-top: 8px !important;
    font-size: 13px !important;
    opacity: 0.6 !important;
}

.zen-streak-hint strong {
    color: var(--text-indigo);
    font-weight: 500;
}

/* Progress Rules Section */
.progress-rules-section {
    margin-top: 40px;
    padding: 20px;
    background-color: rgba(62, 74, 122, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(62, 74, 122, 0.06);
    width: 100%;
    box-sizing: border-box;
}

.rules-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-indigo);
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.rules-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rule-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.rule-icon {
    color: var(--text-indigo);
    opacity: 0.3;
    font-size: 14px;
    line-height: 1.6;
}

.rule-text {
    font-size: 13px;
    color: var(--text-indigo);
    opacity: 0.5;
    line-height: 1.6;
}

/* Progress Rules Section - Compact for Mobile */
.progress-rules-section-compact {
    margin-top: 24px;
    padding: 12px 16px;
    background-color: rgba(62, 74, 122, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(62, 74, 122, 0.06);
    width: 100%;
    box-sizing: border-box;
}

.progress-rules-section-compact .rules-title {
    font-size: 11px;
    margin-bottom: 8px;
}

.progress-rules-section-compact .rule-text {
    font-size: 12px;
    line-height: 1.4;
}

/* Date Display (Top Center) */
.date-display-zen {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-indigo);
    opacity: 0.5;
    letter-spacing: 0.02em;
    text-align: center;
}

/* When date is in header, center it */
.zen-header .date-display-zen {
    flex: 1;
    text-align: center;
}

/* Habit Name (Below Date, in Quotes) */
.habit-name-zen {
    position: absolute;
    top: calc(22vh + env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    font-size: 28px;
    font-weight: 400;
    letter-spacing: 0.01em;
    color: var(--text-indigo);
    opacity: 0.9;
    text-align: center;
    max-width: 90%;
    z-index: 20;
}

/* Sun Center (The Red Sun) */
.sun-center {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Status Circle - The Sun */
.status-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: none;
    background-color: var(--sun-red);
    display: flex;
    align-items: center;
    justify-content: center;

    /* Glow Effect */
    box-shadow: 0 0 60px var(--sun-glow);

    /* Smooth Transitions */
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.status-circle.completed {
    /* Gentle pulse/glow on completion - KEEP CORAL RED */
    background-color: var(--sun-red) !important;
    box-shadow:
        0 0 100px rgba(232, 106, 99, 0.6),
        inset 0 0 60px rgba(232, 106, 99, 0.3);
    transform: scale(1.05);
    animation: gentlePulse 2s ease-in-out infinite;
}

.status-text {
    font-size: var(--font-size-2xl);
    font-weight: 300;
    color: var(--text-indigo);
    letter-spacing: 0.05em;
}

.status-circle.completed .status-text {
    color: white;
}

/* Gentle pulse animation for completed state */
@keyframes gentlePulse {
    0%, 100% {
        transform: scale(1.05);
        box-shadow:
            0 0 100px rgba(232, 106, 99, 0.6),
            inset 0 0 60px rgba(232, 106, 99, 0.3);
    }
    50% {
        transform: scale(1.08);
        box-shadow:
            0 0 140px rgba(232, 106, 99, 0.7),
            inset 0 0 80px rgba(232, 106, 99, 0.4);
    }
}

/* Navigation Arrow (Right Edge) */
.nav-arrow {
    position: absolute;
    top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    opacity: 0.4;
    transition: all 0.3s ease;
    z-index: 10;
}

.nav-arrow:hover {
    opacity: 0.8;
}

.nav-arrow-right {
    right: 20px;
}

.nav-arrow-left {
    left: 20px;
}

.nav-label {
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    color: var(--text-indigo);
    font-weight: 300;
}

/* Frosted Glass Bottom Bar */
.glass-bottom-bar {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(82vh - 77.5px); /* slight nudge further toward bottom */
    height: 155px;
    max-width: 100%;
    margin: 0 auto;
    background: rgba(248, 249, 251, 0.75); /* Semi-transparent milk */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 16px; /* add space between button and streak */
    padding-top: 8px;
    padding-bottom: 8px;
    z-index: 100;
}

/* Zen Complete Button */
.zen-complete-btn {
    background-color: var(--sun-red);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 10px 36px;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(232, 106, 99, 0.25);
    min-width: 130px;
    text-align: center;
}

/* Mobile button hint */
.zen-button-hint {
    font-size: 0.7rem;
    color: var(--text-indigo);
    opacity: 0.4;
    letter-spacing: 0.05em;
    text-align: center;
    margin-top: 8px;
}

.zen-complete-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(232, 106, 99, 0.35);
}

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

.zen-complete-btn.completed {
    background-color: var(--sun-red);
    opacity: 0.9;
}

/* Indigo state for completed button */
.zen-complete-btn.btn-indigo {
    background-color: var(--text-indigo) !important;
    opacity: 1 !important;
    box-shadow: none !important;
    transform: none !important;
}

.zen-complete-btn.btn-indigo:disabled {
    cursor: not-allowed;
    opacity: 1 !important;
}

/* Disable hover effects for indigo buttons */
.zen-complete-btn.btn-indigo:hover {
    transform: none !important;
    box-shadow: none !important;
}

.zen-complete-btn.btn-indigo:active {
    transform: none !important;
}

/* Delete Habit Button - Coral Red Pill */
.zen-delete-link {
    background-color: var(--sun-red) !important;
    color: white !important;
    border: none;
    border-radius: 50px;
    padding: 10px 36px;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(232, 106, 99, 0.25);
    display: inline-block;
    min-width: 130px;
    text-align: center;
}

.zen-delete-link:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(232, 106, 99, 0.35);
}

.zen-delete-link:active {
    transform: scale(0.98);
}

.zen-delete-link:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.zen-delete-link:disabled:hover {
    transform: none;
    box-shadow: none;
}

.zen-delete-hint {
    font-size: 12px;
    color: var(--text-indigo);
    opacity: 0.5;
    margin-top: 12px;
    line-height: 1.5;
    text-align: center;
}

/* Legal Links (Mobile Settings) */
.zen-legal-links {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(62, 74, 122, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-bottom: 16px;
}

/* Compact Legal Links (Top of settings screen) */
.zen-legal-links-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    margin-bottom: 20px;
}

.zen-legal-links-compact a {
    font-size: 11px;
    color: var(--text-indigo);
    opacity: 0.4;
    text-decoration: none;
    transition: opacity 0.3s;
    letter-spacing: 0.02em;
}

.zen-legal-links-compact a:hover {
    opacity: 0.7;
}

.zen-legal-links-compact .legal-separator {
    font-size: 11px;
    color: var(--text-indigo);
    opacity: 0.3;
}

.zen-legal-links a {
    font-size: 12px;
    color: var(--text-indigo);
    opacity: 0.4;
    text-decoration: none;
    transition: opacity 0.3s;
    letter-spacing: 0.02em;
}

.zen-legal-links a:hover {
    opacity: 0.7;
}

.legal-separator {
    font-size: 12px;
    color: var(--text-indigo);
    opacity: 0.3;
}

/* Legal Modals (Mobile) */
.legal-modal-mobile {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(62, 74, 122, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.legal-modal-mobile.show {
    display: flex;
    opacity: 1;
}

.legal-modal-content-mobile {
    background-color: var(--bg-milk);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 -10px 40px rgba(62, 74, 122, 0.15);
    position: relative;
    animation: modalSlideUpMobile 0.3s ease-out;
}

@keyframes modalSlideUpMobile {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.legal-modal-content-mobile .legal-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-indigo);
    opacity: 0.5;
    transition: opacity 0.3s;
    z-index: 10;
    padding: 8px;
}

.legal-modal-content-mobile .legal-modal-body {
    padding: 48px 24px 32px;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.legal-modal-content-mobile .legal-modal-body h2 {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-indigo);
    margin-bottom: 8px;
    letter-spacing: 0.05em;
    padding-right: 32px;
}

.legal-modal-content-mobile .legal-modal-body h3 {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-indigo);
    margin-top: 20px;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.legal-modal-content-mobile .legal-modal-body p {
    font-size: 13px;
    color: var(--text-indigo);
    opacity: 0.8;
    line-height: 1.7;
    margin-bottom: 12px;
}

.legal-modal-content-mobile .legal-modal-body ul {
    margin-left: 20px;
    margin-bottom: 16px;
}

.legal-modal-content-mobile .legal-modal-body li {
    font-size: 13px;
    color: var(--text-indigo);
    opacity: 0.8;
    line-height: 1.6;
    margin-bottom: 6px;
}

.legal-modal-content-mobile .legal-modal-body a {
    color: var(--sun-red);
    text-decoration: none;
    font-weight: 500;
}

/* Habit Edit/Create Modal (Mobile) */
.habit-modal-mobile {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(62, 74, 122, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.habit-modal-mobile.show {
    display: flex;
    opacity: 1;
}

.habit-modal-content-mobile {
    background-color: var(--bg-milk);
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 -10px 40px rgba(62, 74, 122, 0.15);
    position: relative;
    animation: modalSlideUpMobile 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

.habit-modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 20px 10px;
    border-bottom: 1px solid rgba(62, 74, 122, 0.1);
}

.habit-modal-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-indigo);
    letter-spacing: 0.05em;
}

.habit-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-indigo);
    opacity: 0.5;
    transition: opacity 0.3s;
    z-index: 10;
    padding: 8px;
    line-height: 1;
}

.habit-modal-close:hover {
    opacity: 0.8;
}

.habit-modal-body {
    padding: 24px 20px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

/* Settings Form in Modal */
.zen-settings-form-modal {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.zen-form-actions-modal {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

/* Modal Button Styles */
.zen-form-actions-modal .zen-btn-secondary,
.zen-form-actions-modal .zen-complete-btn {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 500;
    font-family: 'Noto Sans JP', sans-serif;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    letter-spacing: 0.02em;
}

.zen-btn-secondary {
    background-color: transparent !important;
    color: var(--text-indigo) !important;
    border: 2px solid var(--text-indigo) !important;
    box-shadow: none !important;
}

.zen-btn-secondary:hover {
    background-color: var(--text-indigo) !important;
    color: white !important;
}

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

/* Identity Label (Under Complete Button) */
.identity-label {
    font-size: 11px;
    font-weight: 400;
    color: #E86A63; /* Coral red color */
    text-align: center;
    font-style: italic;
    opacity: 0.6;
    letter-spacing: 0.3px;
    margin-top: 6px;
    margin-bottom: 6px;
    max-width: 280px;
    line-height: 1.4;
}

/* Zen Streak Display */
.zen-streak-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px; /* add space between streak number and label */
}

/* Progress Navigation Button */
.zen-progress-nav-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(62, 74, 122, 0.1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-indigo);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.zen-progress-nav-btn:hover {
    opacity: 1;
    background-color: rgba(62, 74, 122, 0.2);
    transform: scale(1.05);
}

.zen-progress-nav-btn:active {
    transform: scale(0.95);
}

.streak-number-zen {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-indigo);
    letter-spacing: -0.5px;
    line-height: 0.95;
}

.streak-label-zen {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-indigo);
    opacity: 0.5;
    letter-spacing: 0.02em;
    text-transform: lowercase;
    line-height: 1;
}

/* ============================================
   ZEN EMPTY STATE
   ============================================ */

.empty-state-zen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--spacing-xl);
    max-width: 320px;
    margin: 0 auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
}

.empty-state-icon-zen {
    font-size: 3rem;
    font-weight: 200;
    color: var(--text-indigo);
    opacity: 0.3;
    margin-bottom: var(--spacing-xl);
    letter-spacing: 0.3em;
}

.empty-state-title-zen {
    font-size: var(--font-size-xl);
    font-weight: 300;
    color: var(--text-indigo);
    margin-bottom: var(--spacing-lg);
    letter-spacing: 0.15em;
}

.empty-state-description-zen {
    font-size: var(--font-size-base);
    color: var(--text-indigo);
    opacity: 0.6;
    line-height: 1.8;
    margin-bottom: var(--spacing-xl);
    letter-spacing: 0.05em;
}

/* Empty state button - ensure single line */
.empty-state-zen .zen-complete-btn {
    white-space: nowrap;
}

/* ============================================
   ZEN SETTINGS SCREEN
   ============================================ */

.zen-settings-container {
    position: relative;
    width: 100%;
    height: 100vh;
    max-width: 430px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
    padding-top: calc(110px + env(safe-area-inset-top));
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: border-box;
}

.zen-settings-container .zen-settings-content {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl) var(--spacing-xl);
    padding-bottom: 60px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.settings-form-zen {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.welcome-message-zen {
    text-align: center;
    margin-bottom: 60px; /* More breathing room */
}

.welcome-text-zen {
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--text-indigo);
    opacity: 0.8;
    line-height: 2; /* More air */
    letter-spacing: 0.15em;
}

/* Zen Form Styles */
.form-group-zen {
    margin-bottom: 80px; /* More space */
}

.form-label-zen {
    display: block;
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--text-indigo);
    margin-bottom: 20px;
    letter-spacing: 0.2em;
    opacity: 0.6;
    text-transform: uppercase;
}

.form-input-zen {
    width: 100%;
    padding: 16px 0;
    font-size: 1.5rem;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
    color: var(--text-indigo);
    background-color: transparent;
    border: none;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
    transition: all var(--transition-base);
    text-align: center;
}

.form-input-zen:focus {
    outline: none;
    border-bottom-color: var(--text-indigo);
    border-bottom-width: 2px;
}

.form-input-zen::placeholder {
    color: var(--text-indigo);
    opacity: 0.2;
    font-weight: 300;
}

.form-hint-zen {
    display: block;
    font-size: 0.75rem;
    color: var(--text-indigo);
    opacity: 0.3;
    margin-top: 16px;
    letter-spacing: 0.15em;
    text-align: center;
}

.form-actions-zen {
    display: flex;
    justify-content: center;
    margin-top: 80px; /* more space below text input */
}

/* Zen Buttons */
.button-secondary-zen {
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: var(--font-size-base);
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
    background-color: transparent;
    color: var(--text-indigo);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    letter-spacing: 0.1em;
}

.button-secondary-zen:hover {
    background-color: var(--color-bg-secondary);
    border-color: var(--text-indigo);
}

.button-primary-zen {
    padding: 16px 64px; /* Larger pill button */
    font-size: 1rem;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
    background-color: var(--sun-red);
    color: white;
    border: none;
    border-radius: 50px; /* Fully pill-shaped */
    cursor: pointer;
    transition: all var(--transition-base);
    letter-spacing: 0.15em;
    box-shadow: 0 4px 15px var(--sun-glow);
}

.button-primary-zen:hover {
    background-color: var(--color-primary-dark);
    transform: scale(1.02);
    box-shadow: 0 6px 20px var(--sun-glow);
}

.button-primary-zen:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    box-shadow: none;
}

/* Zen Danger Zone */
.danger-zone-zen {
    margin-top: 120px; /* further from form for calm spacing */
    padding: var(--spacing-xl) 0;
    text-align: center;
}

.delete-link-zen {
    font-size: 1rem;
    background-color: var(--sun-red) !important; /* coral fill */
    color: white !important;
    border: none;
    border-radius: 50px;
    padding: 16px 64px; /* match save pill size */
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
    letter-spacing: 0.15em;
    transition: all var(--transition-base);
    box-shadow: 0 4px 15px var(--sun-glow);
    opacity: 1;
}

.delete-link-zen:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px var(--sun-glow);
}

.danger-zone-hint-zen {
    font-size: 0.7rem;
    color: var(--text-indigo);
    opacity: 0.3;
    margin-top: 12px;
    line-height: 1.8;
    letter-spacing: 0.1em;
    max-width: 250px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   ZEN PROGRESS SCREEN
   ============================================ */

/* Note: .zen-progress-container is defined above */

/* Note: .zen-progress-content is defined above */

.progress-stats-zen {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.stat-card-zen {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-lg) var(--spacing-md);
    background-color: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    text-align: center;
}

.stat-number-zen {
    font-size: var(--font-size-2xl);
    font-weight: 200;
    color: var(--text-indigo);
    line-height: 1;
    margin-bottom: var(--spacing-xs);
    letter-spacing: 0.1em;
}

.stat-label-zen {
    font-size: var(--font-size-xs);
    color: var(--text-indigo);
    opacity: 0.5;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: lowercase;
}

/* ============================================
   SLIDE TRANSITIONS - Phase 3.3
   ============================================ */

.screen-transition {
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.screen-transition-back {
    animation: slideInLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   STONE GARDEN (KARESANSUI) - Phase 4
   ============================================ */

/* Stone Garden Container */
/* ============================================
   CORAL SUNSET GARDEN - Flat Stone Design
   ============================================ */

.garden-path {
  background: linear-gradient(180deg, #E86A63 0%, #C1534D 100%);
  min-height: 100vh;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  gap: 20px;
  padding: 120px 20px 180px;
  width: 100%;
}

/* Flat Stone Base Styles */
.stone-flat {
  width: 32px;
  height: 28px;
  border-radius: 45%;
  margin: 8px;
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Completed Stone - Deep Indigo */
.stone-completed {
  background-color: #3E4A7A;
}

/* Today's Stone - Pure White with Glow */
.stone-today {
  background-color: #FFFFFF;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
  animation: stonePulse 3s ease-in-out infinite;
}

/* Future Stone - Transparent with White Border */
.stone-future {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
}

/* Stone Pulse Animation for Today */
@keyframes stonePulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.7);
  }
}

/* Stats at Bottom */
.zen-stats {
  text-align: center;
  padding: 32px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  position: fixed;
  bottom: 40px;
  left: 0;
  right: 0;
}

.zen-stat-number {
  font-size: 2.2rem;
  font-weight: 300;
  color: var(--text-indigo);
  letter-spacing: 0.05em;
  line-height: 1;
}

.zen-stat-label {
  font-size: 14px;
  color: var(--text-indigo);
  opacity: 0.6;
  letter-spacing: 0.05em;
  font-weight: 400;
}

.zen-stat-streak {
  font-size: 1rem;
  color: #FFFFFF;
  opacity: 0.95;
  letter-spacing: 0.15em;
  font-weight: 300;
  font-family: 'Noto Sans JP', sans-serif;
}
}
}

.zen-stat-sub-stone {
    font-size: 0.65rem;
    color: var(--text-indigo);
    opacity: 0.4;
    letter-spacing: 0.2em;
    text-transform: lowercase;
}

/* ============================================
   LEGACY MOBILE CONTAINER (Preserved for other screens)
   ============================================ */
.mobile-container {
    max-width: 430px;
    min-height: 100vh;
    margin: 0 auto;
    background-color: var(--color-bg);
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}

/* Header */
.header {
    text-align: center;
    padding: var(--spacing-lg) var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}

.header h1 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-xs);
}

.header .date {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    font-weight: 400;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) var(--spacing-md);
    gap: var(--spacing-xl);
    padding-bottom: 100px; /* Space for navigation bar */
}

/* Status Circle - OLD STYLES (DISABLED FOR ZEN UI) */
/* .status-circle {
    width: 200px;
    height: 200px;
    border-radius: var(--radius-full);
    border: 8px solid var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg-secondary);
    transition: all var(--transition-base);
}

.status-circle.completed {
    background-color: var(--easy-green);
    border-color: var(--easy-green);
} */

.status-text {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-text);
}

/* Habit Card */
.habit-card {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
}

.habit-name {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-text);
    text-align: center;
}

/* Check-in Button */
.checkin-button {
    width: 100%;
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: var(--font-size-lg);
    font-weight: 600;
    background-color: var(--moderate-orange);
    color: white;
    border: none;
    cursor: pointer;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
    box-shadow: 0 4px 6px rgba(255, 149, 0, 0.2);
}

.checkin-button:hover {
    transform: scale(1.02);
}

.checkin-button:active {
    transform: scale(0.98);
}

.checkin-button.completed {
    background-color: var(--easy-green);
    opacity: 0.9;
    cursor: pointer;
}

.checkin-button.completed:hover {
    opacity: 1;
    transform: scale(1.02);
}

/* Streak Counter */
.streak-counter {
    text-align: center;
    padding: var(--spacing-md);
}

.streak-number {
    display: block;
    font-size: var(--font-size-3xl);
    font-weight: 800;
    color: var(--moderate-orange);
    line-height: 1;
}

.streak-label {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-top: var(--spacing-xs);
}

/* Navigation Bar */
.navigation-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background-color: var(--color-bg);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 var(--spacing-md);
}

@media (min-width: 431px) {
    .navigation-bar {
        max-width: 430px;
        left: 50%;
        transform: translateX(-50%);
    }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
}

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

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

.nav-item span {
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.nav-item:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Empty State */
.empty-state {
    text-align: center;
    max-width: 320px;
    margin: 0 auto;
}

.empty-state-icon {
    font-size: 1rem;
    background-color: var(--sun-red); /* coral red */
    margin-bottom: var(--spacing-lg);
}

.empty-state-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
}

.empty-state-description {
    font-size: var(--font-size-base);
.delete-link-zen:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px var(--sun-glow);
}
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-xl);
}

/* ============================================
   ANIMATIONS & POLISH
   ============================================ */

/* Confetti Animation */
@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti {
    position: fixed;
    top: 0;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 9999;
    animation: confetti-fall 3s ease-out forwards;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: var(--spacing-md) var(--spacing-lg);
    background-color: var(--color-text);
    color: var(--color-bg);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: all var(--transition-base);
    z-index: 1000;
    pointer-events: none;
    max-width: 300px;
    text-align: center;
}

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

.toast-success {
    background-color: var(--easy-green);
}

.toast-warning {
    background-color: var(--text-indigo);
    color: white;
}

.toast-warning.show {
    animation: toastWarning 2s ease-in-out forwards;
}

@keyframes toastWarning {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    10%, 90% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

/* Status Circle Animation - OLD (DISABLED FOR ZEN UI) */
/* .status-circle {
    transition: all var(--transition-slow);
}

.status-circle.completed {
    animation: success-pulse 0.6s ease-out;
}

@keyframes success-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
} */

/* Button Ripple Effect */
.checkin-button {
    position: relative;
    overflow: hidden;
}

.checkin-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.checkin-button:active::after {
    width: 300px;
    height: 300px;
}

/* Streak Counter Animation */
.streak-number {
    transition: all var(--transition-base);
}

.streak-number.animate {
    animation: count-up 0.5s ease-out;
}

@keyframes count-up {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Loading State */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ============================================
   SETTINGS FORM STYLES
   ============================================ */

.settings-form {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.welcome-message {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.welcome-text {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-top: var(--spacing-md);
}

/* Form Styles */
.form-group {
    margin-bottom: var(--spacing-xl);
}

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

.form-input {
    width: 100%;
    padding: var(--spacing-md);
    font-size: var(--font-size-base);
    font-family: inherit;
    color: var(--color-text);
    background-color: var(--color-bg-secondary);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--moderate-orange);
    background-color: var(--color-bg);
    box-shadow: 0 0 0 3px rgba(255, 149, 0, 0.1);
}

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

.form-hint {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    margin-top: var(--spacing-xs);
}

.form-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
}

/* Button Styles */
.button {
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: var(--font-size-base);
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

.button-primary {
    background-color: var(--moderate-orange);
    color: white;
}

.button-primary:hover:not(:disabled) {
    background-color: #e68600;
    transform: scale(1.02);
}

.button-primary:active:not(:disabled) {
    transform: scale(0.98);
}

.button-secondary {
    background-color: var(--color-bg-secondary);
    color: var(--color-text);
    border: 2px solid var(--color-border);
}

.button-secondary:hover:not(:disabled) {
    background-color: var(--color-border);
}

.button-danger {
    background-color: #ef4444;
    color: white;
    width: 100%;
}

.button-danger:hover {
    background-color: #dc2626;
}

/* Danger Zone */
.danger-zone {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg);
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
}

.danger-zone-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: #dc2626;
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.danger-zone-hint {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    margin-top: var(--spacing-sm);
    line-height: 1.5;
}

/* ============================================
   PROGRESS SCREEN STYLES
   ============================================ */

.progress-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    width: 100%;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-lg) var(--spacing-md);
    background-color: var(--bg-light);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-md);
    text-align: center;
}

.stat-number {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: var(--primary-blue);
    line-height: 1;
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    font-weight: 500;
}

.progress-list {
    width: 100%;
}

.progress-list-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
}

.progress-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background-color: var(--bg-light);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-sm);
}

.progress-date {
    font-size: var(--font-size-sm);
    color: var(--color-text);
}

.progress-check {
    font-size: var(--font-size-lg);
    color: var(--color-success);
    font-weight: 700;
}

.progress-hint {
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-top: var(--spacing-xl);
    padding: var(--spacing-md);
    background-color: var(--bg-light);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-md);
}

/* ============================================
   AUTH STYLES
   ============================================ */

.toast-info {
    background-color: #3b82f6;
}

/* Auth Button */
.auth-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    width: 100%;
    padding: var(--spacing-md);
    background-color: white;
    color: var(--color-text);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.auth-button:hover {
    background-color: var(--color-bg-secondary);
    border-color: var(--color-text-secondary);
}

.auth-button:active {
    transform: scale(0.98);
}

.auth-button svg {
    width: 20px;
    height: 20px;
}

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background-color: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-lg);
    font-weight: 700;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-text);
}

.user-email {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.user-actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* Auth Screen */
.auth-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    text-align: center;
}

.auth-screen h2 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
}

.auth-screen p {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-xl);
    line-height: 1.6;
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    text-align: left;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-sm);
    color: var(--color-text);
}

.auth-feature svg {
    color: var(--color-success);
    flex-shrink: 0;
}

/* Loading State */
.auth-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
}

/* ============================================
   DESKTOP LAYOUT (Responsive)
   ============================================ */

/* ============================================
   DESKTOP - Triptych Layout (Phase 6-9)
   Japanese Minimalist Desktop Experience
   ============================================ */

@media (min-width: 768px) {
    /* Full-width Canvas - No cards, no borders */
    body {
        background-color: var(--bg-milk);
    }

    /* Desktop Home Container */
    .zen-home-container {
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 100vh;
        padding: 0;
    }

    /* Habit Name Above Circle on Desktop */
    .habit-name-vertical {
        position: absolute;
        top: 25%;
        left: 50%;
        transform: translateX(-50%);
        writing-mode: horizontal-tb;
        font-size: 1.5rem; /* Larger on desktop */
        font-weight: 300;
        letter-spacing: 0.3em;
        color: var(--text-indigo);
        opacity: 0.8;
        text-align: center;
    }

    /* Center Panel: The Sun (Hero) */
    .sun-center {
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
    }

    /* Larger sun on desktop */
    .status-circle {
        width: 280px;
        height: 280px;
        border: none;
        background-color: var(--sun-red);
    }

    .status-circle.completed {
        background-color: var(--sun-red) !important;
        box-shadow:
            0 0 140px rgba(232, 106, 99, 0.5),
            inset 0 0 80px rgba(232, 106, 99, 0.3) !important;
    }

    .status-text {
        font-size: 2rem !important;
    }

    /* Right Panel: Navigation & Settings */
    .nav-arrow-right {
        position: absolute;
        right: 60px;
        top: 50%;
        transform: translateY(-50%);
        opacity: 0.3;
        transition: opacity 0.3s ease;
    }

    .nav-arrow-right:hover {
        opacity: 0.6;
    }

    /* Desktop Frosted Glass Bar - Full Width */
    .glass-bottom-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 160px;
        background: var(--glass-white);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 150px;
        border-top: 1px solid rgba(255, 255, 255, 0.3);
        padding-top: 20px;
        padding-bottom: 40px;
        z-index: 100;
    }

    /* Larger button on desktop */
    .zen-complete-btn {
        padding: 20px 80px !important;
        font-size: 1.2rem !important;
        letter-spacing: 0.2em !important;
    }

    /* Streak Display on Desktop */
    .zen-streak-display {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        min-width: 200px;
    }

    .streak-number-zen {
        font-size: 3rem;
        font-weight: 300;
        color: var(--text-indigo);
        line-height: 1;
    }

    .streak-label-zen {
        font-size: 0.85rem;
        letter-spacing: 0.15em;
        color: var(--color-text-secondary);
        text-transform: uppercase;
    }

    /* Hide mobile navigation on desktop */
    .navigation-bar {
        display: none;
    }

    /* Hide mobile container on desktop */
    .mobile-container {
        display: none;
    }

    /* ============================================
       DESKTOP PROGRESS OVERLAY (Phase 8)
       ============================================ */

    .zen-progress-container {
        max-width: 100%;
    }

    /* Progress content - Desktop layout */
    .zen-progress-content {
        padding: 120px 80px;
        max-width: 1400px;
        margin: 0 auto;
    }

    /* Stats on Desktop - More spread out */
    .progress-stats-zen {
        gap: var(--spacing-xl);
        margin-bottom: 80px;
    }

    .stat-card-zen {
        padding: var(--spacing-xl) var(--spacing-lg);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-lg);
    }

    .stat-number-zen {
        font-size: 3.5rem;
        margin-bottom: var(--spacing-sm);
    }

    .stat-label-zen {
        font-size: 0.9rem;
    }

    /* Stone Garden on Desktop */
    .stone-garden {
        max-width: 600px;
        padding: 60px 40px;
    }

    .stone {
        width: 14px;
        height: 14px;
    }

    .stone.today {
        width: 20px;
        height: 20px;
    }

    /* Meditation Stone on Desktop */
    .meditation-stone {
        width: 160px;
        height: 160px;
        margin: 80px auto 60px;
    }

    .stone-text {
        font-size: 2.5rem;
    }

    /* Desktop Progress Navigation */
    .nav-arrow-left {
        position: absolute;
        left: 60px;
        top: 50%;
        transform: translateY(-50%);
        opacity: 0.3;
        transition: opacity 0.3s ease;
    }

    .nav-arrow-left:hover {
        opacity: 0.6;
    }

    /* ============================================
       DESKTOP SETTINGS (Phase 9)
       ============================================ */

    .zen-settings-container {
        max-width: 100%;
        height: 100vh;
    }

    .zen-settings-content {
        padding: 120px 80px;
        max-width: 800px;
        margin: 0 auto;
    }

    .settings-form-zen {
        max-width: 600px;
        margin: 0 auto;
    }

    .form-input-zen {
        font-size: 2rem;
        padding: 20px 0;
    }

    .button-primary-zen {
        padding: 20px 80px;
        font-size: 1.1rem;
    }
}

/* ============================================
   SETTINGS MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

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

.modal-content {
    background-color: var(--color-bg);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform var(--transition-base);
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

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

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-text);
}

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

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

.modal-body {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.modal-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    margin-top: var(--spacing-lg);
}

/* Desktop-specific modal styles */
@media (min-width: 768px) {
    .modal-content {
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    }
}

/* ============================================
   WEEKLY VIEW STYLES
   ============================================ */

.weekly-view {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* Week Navigation */
.week-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--bg-light);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-md);
}

.week-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background-color: var(--color-bg);
    border: 2px solid var(--color-border);
    color: var(--color-text);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.week-nav-btn:hover {
    background-color: var(--moderate-orange);
    border-color: var(--moderate-orange);
    color: white;
    transform: scale(1.05);
}

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

.week-info {
    flex: 1;
    text-align: center;
}

.week-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-xs);
}

.week-stats {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}

.back-to-today {
    text-align: center;
}

/* Week Grid */
.week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background-color: var(--bg-light);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-md);
}

.day-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-xs);
    background-color: var(--color-bg);
    border-radius: var(--radius-sm);
    cursor: default;
    transition: all var(--transition-fast);
    position: relative;
    min-height: 70px;
}

.day-cell.today {
    cursor: pointer;
    border: 2px solid var(--moderate-orange);
}

.day-cell.today:hover {
    background-color: rgba(255, 149, 0, 0.1);
    transform: scale(1.05);
}

.day-cell.today:active {
    transform: scale(0.95);
}

.day-cell.future {
    opacity: 0.4;
}

.day-cell.checked {
    background-color: var(--easy-green);
    color: white;
}

.day-cell.checked .day-name,
.day-cell.checked .day-number {
    color: white;
}

.day-name {
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-xs);
}

.day-cell.checked .day-name {
    font-weight: 600;
}

.day-number {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text);
}

.day-cell.checked .day-number {
    font-weight: 800;
}

.day-check {
    position: absolute;
    top: var(--spacing-xs);
    right: var(--spacing-xs);
    font-size: var(--font-size-base);
    color: white;
    font-weight: 700;
}

.day-today-dot {
    position: absolute;
    bottom: var(--spacing-xs);
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--moderate-orange);
}

/* Weekly Summary */
.weekly-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--bg-light);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-md);
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

.summary-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    font-weight: 500;
}

.summary-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--moderate-orange);
}
