/* 
 * Armor of God - Design System Style Sheet
 * Inspired by Hallow - Calm, Sacred, Spiritual Meditation Aesthetic
 */

:root {
    /* Hallow Calm Dark Theme Palette */
    --bg-primary: #08090d;
    --bg-card: #11131a;
    --bg-input: #161821;
    --border-color: rgba(255, 255, 255, 0.04);
    --border-color-focus: rgba(230, 198, 135, 0.35);
    
    /* Text Colors */
    --text-primary: #eae6df; /* Soft warm ivory (calming and high legibility) */
    --text-secondary: #8c93a3; /* Calm blue-gray */
    --text-accent: #e6c687; /* Soft candlelit gold */
    --text-accent-bright: #f2dec0; /* Bright warm gold */
    --color-purple: #8b70cf; /* Gentle spiritual lavender */
    --color-purple-light: #a894df;
    
    /* Transitions & Curves */
    --transition-smooth: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    
    /* Typography Stacks */
    --font-heading: 'EB Garamond', Georgia, serif;
    --font-serif: 'Lora', Georgia, serif;
    --font-body: 'Mulish', system-ui, -apple-system, sans-serif;
    
    /* Glow/Shadow schemes */
    --glow-warm: rgba(230, 198, 135, 0.03);
    --glow-lavender: rgba(139, 112, 207, 0.02);
}

/* Base resets & layout */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Soft ambient glows (representing peaceful candlelight in a sacred space).
   Rendered as radial-gradients rather than blurred solid circles: a 140px
   `filter: blur()` is brutally expensive to repaint on mobile GPUs and was the
   main cause of input lag. A gradient gives the identical soft glow for free. */
.glow {
    position: absolute;
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

.glow-1 {
    width: 900px;
    height: 900px;
    background: radial-gradient(circle, rgba(230, 198, 135, 0.05) 0%, transparent 65%);
    top: -350px;
    left: -300px;
}

.glow-2 {
    width: 1000px;
    height: 1000px;
    background: radial-gradient(circle, rgba(139, 112, 207, 0.045) 0%, transparent 65%);
    bottom: -400px;
    right: -300px;
}

/* Application Layout */
.app-container {
    width: 100%;
    max-width: 740px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem 1.5rem;
    position: relative;
    z-index: 1;
}

/* Header styling */
.app-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 2.5rem;
    letter-spacing: 0.08em;
    text-transform: capitalize;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.subtitle {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* Progress Tracker */
.progress-container {
    width: 100%;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-bar-bg {
    width: 100%;
    height: 2px; /* Super thin, elegant indicator */
    background: rgba(255, 255, 255, 0.04);
    border-radius: 1px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--text-accent);
    border-radius: 1px;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 6px rgba(230, 198, 135, 0.5);
}

.progress-text {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: right;
}

/* Cards Wrapper */
.card-wrapper {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px; /* Warm, highly rounded corners */
    padding: 3rem;
    width: 100%;
    min-height: 440px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 
                inset 0 1px 0 rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.card.in-session {
    height: 480px;
    min-height: 480px;
    max-height: 480px;
}

.card-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Card Entry/Exit Animations */
.slide-in {
    animation: slideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.slide-out-next {
    animation: slideOutNext 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.slide-out-prev {
    animation: slideOutPrev 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

@keyframes slideOutNext {
    to {
        opacity: 0;
        transform: translateY(-15px);
    }
}

@keyframes slideOutPrev {
    to {
        opacity: 0;
        transform: translateY(15px);
    }
}

/* Content Elements Inside Cards */
.card-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    /* Keep the last line clear of the persistent nav buttons below the card. */
    padding-bottom: 0.5rem;
    scrollbar-width: none; /* Firefox */
}

.card-content::-webkit-scrollbar {
    display: none; /* Safari/Chrome */
}

.step-indicator,
.step-indicator-persistent {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-purple-light);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.step-indicator-persistent {
    text-align: center;
    width: 100%;
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
    opacity: 0.35;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.step-indicator-persistent.fade-active {
    opacity: 1;
}

.affirmation-title {
    font-family: var(--font-heading);
    font-size: 1.9rem;
    line-height: 1.3;
    font-weight: 400;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 0.5rem;
}

/* Centered Sacred Quote Layout */
.scripture-block {
    border: none;
    background: transparent;
    padding: 0.5rem 1rem;
    /* Vertically center within available space, but keep a guaranteed gap
       above/below so long passages never crowd the chrome or nav buttons. */
    margin: auto 0;
    padding-block: 1rem;
    text-align: center;
}

.scripture-text {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.55rem;
    line-height: 1.6;
    color: var(--text-primary);
    font-weight: 400;
}

.scripture-ref {
    display: block;
    margin-top: 0.85rem;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-accent);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

/* User reflection section */
.reflection-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.prompt-label {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.5;
    text-align: center;
    font-style: italic;
}

.reflection-input {
    width: 100%;
    min-height: 110px;
    max-height: 160px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    font-family: var(--font-serif);
    font-size: 1.02rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: var(--transition-smooth);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

.reflection-input:focus {
    border-color: var(--border-color-focus);
    box-shadow: 0 0 15px rgba(230, 198, 135, 0.05),
                inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

.reflection-input::placeholder {
    color: #4a505c;
    font-style: italic;
    font-size: 0.92rem;
}

/* Navigation & Button Controls */
.card-actions,
.card-actions-persistent {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    gap: 1.25rem;
}

.card-actions-persistent {
    margin-top: 2.5rem; /* Spacious margin-top when height is auto */
    width: 100%;
}

.card.in-session .card-actions-persistent {
    margin-top: auto; /* Push persistent footer to the bottom only when card height is fixed */
}

.card-actions-persistent .btn {
    flex: 1;
    min-width: 0;
    padding: 0.85rem 0.5rem;
    font-size: 0.88rem;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
    word-break: keep-all;
}

.card-actions-persistent .btn-primary {
    flex: 1.3;
}

.icon-home {
    fill: none !important;
    stroke: currentColor;
    stroke-width: 2px;
}

/* Pill Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 2.2rem;
    border-radius: 999px; /* Hallow Pill style */
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    outline: none;
    text-decoration: none;
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-secondary:hover:not(:disabled) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.25);
}

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

.btn-primary {
    background: var(--text-accent);
    color: var(--bg-primary);
    box-shadow: 0 4px 15px rgba(230, 198, 135, 0.1);
}

.btn-primary:hover:not(:disabled) {
    background: var(--text-accent-bright);
    box-shadow: 0 6px 20px rgba(230, 198, 135, 0.2);
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-primary:disabled {
    background: rgba(230, 198, 135, 0.25);
    color: rgba(255, 255, 255, 0.2);
    box-shadow: none;
    cursor: not-allowed;
}

.btn-exit {
    background: #c2410c !important;
    color: #ffffff !important;
    border: 1px solid #c2410c !important;
    box-shadow: 0 4px 15px rgba(194, 65, 12, 0.15) !important;
}

.btn-exit:hover:not(:disabled) {
    background: #ea580c !important;
    border-color: #ea580c !important;
    box-shadow: 0 6px 20px rgba(234, 88, 12, 0.25) !important;
    transform: translateY(-1px);
}

/* Icon adjustments */
.icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover .icon-forward {
    transform: translateX(4px);
}

.btn-secondary:hover .icon-back {
    transform: translateX(-4px);
}

/* Intro/Welcome Screen */
.welcome-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 0.5rem 0;
    width: 100%;
}

.welcome-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.welcome-desc {
    color: var(--text-secondary);
    font-family: var(--font-serif);
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 540px;
    margin-bottom: 1.5rem;
    font-style: italic;
}

/* Categories Selector Grid */
.categories-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
    text-align: left;
}

.category-card {
    background: #11131a;
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    gap: 1.25rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    align-items: center;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.category-card:hover {
    border-color: rgba(230, 198, 135, 0.25);
    background: #171923;
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 
                0 0 15px rgba(230, 198, 135, 0.04);
}

/* Special Highlight Card: Full Armor mix */
.category-card-highlight {
    grid-column: span 2;
    background: rgba(139, 112, 207, 0.02);
    border-color: rgba(139, 112, 207, 0.15);
}

.category-card-highlight:hover {
    background: rgba(139, 112, 207, 0.06);
    border-color: var(--color-purple);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 
                0 0 15px rgba(139, 112, 207, 0.04);
}

.category-icon-wrapper {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.category-card:hover .category-icon-wrapper {
    background: rgba(230, 198, 135, 0.08);
    color: var(--text-accent);
    transform: scale(1.05);
}

.category-card-highlight:hover .category-icon-wrapper {
    background: rgba(139, 112, 207, 0.12);
    color: var(--color-purple-light);
}

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

.category-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.category-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.category-desc {
    font-family: var(--font-body);
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.category-count {
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.1rem;
}

.category-card-highlight .category-count {
    color: var(--color-purple-light);
}

/* End / Summary Screen */
.summary-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-height: 440px;
    overflow-y: auto;
    padding-right: 0.75rem;
    text-align: left;
}

/* Scrollbar styling */
.summary-container::-webkit-scrollbar {
    width: 4px;
}
.summary-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
    border-radius: 2px;
}
.summary-container::-webkit-scrollbar-thumb {
    background: rgba(230, 198, 135, 0.15);
    border-radius: 2px;
}
.summary-container::-webkit-scrollbar-thumb:hover {
    background: rgba(230, 198, 135, 0.30);
}

.summary-card {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
}

.summary-title {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-purple-light);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.summary-statement {
    font-family: var(--font-heading);
    border-left: 2px solid rgba(230, 198, 135, 0.25);
    padding-left: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--text-primary);
    font-style: italic;
}

.summary-reflection {
    font-family: var(--font-serif);
    font-size: 0.98rem;
    line-height: 1.6;
    color: #dfdcd6;
    background: rgba(0, 0, 0, 0.15);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.summary-empty {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* X Sharing section */
.share-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 1rem;
    background: rgba(230, 198, 135, 0.02);
    border: 1px solid rgba(230, 198, 135, 0.08);
    border-radius: 16px;
    padding: 1.75rem;
    text-align: left;
}

.share-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--text-accent);
    font-weight: 400;
}

.share-input-box {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.share-character-counter {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: right;
}

.share-buttons {
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.btn-x {
    background-color: #ffffff;
    color: #08090d;
}

.btn-x:hover {
    background-color: #f2efe9;
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

/* Footer */
.app-footer {
    text-align: center;
    margin-top: 2.5rem;
}

.app-footer p {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    font-family: var(--font-body);
    text-transform: uppercase;
}

/* Summary reference badge */
.summary-ref-badge {
    display: inline-block;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(230, 198, 135, 0.2);
    color: var(--text-accent);
    background: rgba(230, 198, 135, 0.03);
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: var(--transition-smooth);
}

.summary-ref-badge:hover {
    border-color: var(--text-accent);
    background: rgba(230, 198, 135, 0.08);
    color: var(--text-accent-bright);
    transform: translateY(-1px);
}

/* Card Inner layout wrapper for stable frame transitions */
.card-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

/* Tasteful segmented statusbar */
.session-statusbar {
    width: 100%;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.statusbar-segments-wrapper {
    display: flex;
    gap: 6px;
    width: 100%;
}

.statusbar-segment {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.statusbar-segment-fill {
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.statusbar-segment.completed .statusbar-segment-fill {
    background: var(--text-accent);
}

.statusbar-segment.active .statusbar-segment-fill {
    background: linear-gradient(90deg, var(--text-accent), var(--text-accent-bright));
    box-shadow: 0 0 6px rgba(230, 198, 135, 0.4);
}

.statusbar-active-label {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: center;
}

.active-armor-name {
    color: var(--text-accent-bright);
}

/* Responsive styles */
@media (max-width: 700px) {
    .app-container {
        padding: 1rem 1rem;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .app-header {
        margin-bottom: 0.75rem;
    }
    
    .logo {
        font-size: 1.8rem;
        margin-bottom: 0.2rem;
    }
    
    .subtitle {
        font-size: 0.7rem;
    }
    
    .progress-container {
        margin-bottom: 0.75rem;
    }
    
    .card {
        padding: 1.25rem;
        min-height: 400px;
        border-radius: 20px;
    }

    .card.in-session {
        /* Taller than before so the longest passages have room to breathe
           instead of crowding the reference against the nav buttons. */
        height: 500px;
        min-height: 500px;
        max-height: 500px;
    }
    
    .welcome-container {
        gap: 1.25rem;
    }

    .welcome-title {
        font-size: 1.9rem;
    }

    .welcome-desc {
        font-size: 1rem;
        line-height: 1.6;
        /* Redundant with the container gap on mobile — let one rhythm govern. */
        margin-bottom: 0.25rem;
    }

    .categories-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .category-card {
        padding: 1rem 1.25rem;
        gap: 1rem;
    }
    
    .category-card-highlight {
        grid-column: span 1;
    }
    
    .category-icon-wrapper {
        width: 44px;
        height: 44px;
    }
    
    .category-title {
        font-size: 1.05rem;
    }
    
    .category-desc {
        font-size: 0.75rem;
    }
    
    .affirmation-title {
        font-size: 1.5rem;
    }

    .scripture-text {
        font-size: 1.3rem;
        line-height: 1.5;
    }

    /* Tighten the stacked progress header so it doesn't steal room
       from the scripture on shorter screens. */
    .session-statusbar {
        margin-bottom: 1rem;
    }

    .step-indicator-persistent {
        margin-top: 0;
        margin-bottom: 0.5rem;
    }
    
    .btn {
        padding: 0.8rem 1.6rem;
        font-size: 0.88rem;
        width: 100%; /* Full-width navigation for general buttons on mobile */
    }
    
    .card-actions {
        flex-direction: column-reverse; /* Put primary button on top on mobile for general cards */
        gap: 0.75rem;
    }
    
    .card-actions-persistent {
        flex-direction: row; /* Force side-by-side persistent navigation */
        gap: 0.5rem;
        margin-top: 1.75rem; /* Spaced margin-top on mobile when height is auto */
    }
    
    .card.in-session .card-actions-persistent {
        margin-top: auto;
    }
    
    .card-actions-persistent .btn {
        width: auto;
        flex: 1;
        padding: 0.8rem 0.35rem;
        font-size: 0.8rem;
    }
    
    .card-actions-persistent .btn-primary {
        flex: 1.3;
    }
    
    .glow-1 {
        width: 300px;
        height: 300px;
        top: -100px;
        left: -100px;
    }
    
    .glow-2 {
        width: 350px;
        height: 350px;
        bottom: -150px;
        right: -100px;
    }
}
