* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-dark: #0A2647;
    --primary-mid: #144272;
    --primary-light: #205295;
    --accent-gold: #D4AF37;
    --accent-light: #F4E4C1;
    --text-light: #FFFFFF;
    --text-muted: #B8C5D6;
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Noto Serif', serif;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-mid) 100%);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
    animation: fadeIn 0.3s ease-in;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

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

/* Loading Screen */
#loading-screen {
    justify-content: center;
    align-items: center;
}

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

.app-logo {
    width: 350px; /* Even BIGGER! */
    height: 350px;
    margin: 30px auto;
    display: block;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.loading-title-top {
    font-family: 'Noto Sans Devanagari', sans-serif; /* Devanagari now on top */
    font-size: 1.8rem; /* Smaller text */
    color: var(--accent-gold);
    margin-bottom: 10px;
    font-weight: 500;
}

.loading-title-bottom {
    font-family: 'Cinzel', serif; /* IAST now on bottom */
    font-size: 1.8rem; /* Smaller text */
    color: var(--accent-gold);
    margin-top: 10px;
    letter-spacing: 3px;
    font-weight: 500;
    text-transform: uppercase;
    /* Ensure consistent character sizing for IAST */
    font-variant-ligatures: none;
    font-feature-settings: "liga" 0;
}

.app-title {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    color: var(--accent-gold);
    margin-bottom: 10px;
    font-weight: 400;
    letter-spacing: 2px;
}

.screen-title {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    color: var(--accent-gold);
    font-weight: 400;
    letter-spacing: 1px;
}

.subtitle {
    font-family: 'Noto Sans Devanagari', sans-serif;
    font-size: 1.5rem;
    color: var(--text-muted);
}

/* Header */
.header {
    position: relative;
    text-align: center;
    margin-bottom: 30px;
}

.home-logo {
    width: 160px;
    height: 160px;
    margin: 20px auto 5px; /* Minimal gap - 5px */
    display: block;
}

.page-logo {
    width: 100px; /* Larger from 85px */
    height: 100px;
    margin: 0 auto 10px;
    display: block;
}

/* Evening Quote Box */
.evening-quote-box {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--accent-gold);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.evening-quote-box .quote-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-light);
    margin-bottom: 10px;
    font-style: italic;
}

.evening-quote-box .quote-source {
    font-size: 0.9rem;
    color: var(--accent-gold);
    font-weight: 500;
}

/* Teaching/Reframe/Inquiry Pages */
.teaching-content,
.reframe-content,
.inquiry-content {
    max-width: 100%;
    padding: 0 10px;
}

.teaching-box {
    background: transparent;
    border: 2px solid var(--accent-gold);
    border-radius: 25px;
    padding: 30px 25px;
    margin-bottom: 30px;
    text-align: center;
}

/* Sanskrit Text Styling */
.sanskrit-text,
#teaching-sanskrit {
    font-family: 'Noto Sans Devanagari', sans-serif;
    font-size: 1.6rem; /* Bigger! Was 1.2rem */
    color: var(--accent-gold);
    line-height: 1.8;
    margin-bottom: 12px;
    font-weight: 600; /* Bolder! Was 500 */
}

.transliteration,
#teaching-transliteration {
    font-size: 1.1rem; /* Bigger! Was 0.95rem */
    color: var(--accent-light); /* Brighter! Was text-muted */
    font-style: italic;
    margin-bottom: 25px;
    line-height: 1.5;
    font-weight: 400;
}

.teaching-quote,
#teaching-quote {
    font-size: 0.95rem; /* Smaller! Was 1.05rem */
    line-height: 1.6;
    color: var(--text-muted); /* More subtle! Was text-light */
    margin-bottom: 15px;
    font-weight: 300; /* Lighter weight */
}

.teaching-source,
#teaching-source {
    font-size: 0.85rem; /* Slightly smaller */
    color: var(--accent-gold);
    font-style: italic;
    margin-top: 10px;
}

.integration-text {
    margin-bottom: 30px;
    line-height: 1.6;
    /* DEBUG: Temporary border to see if element is there */
    border: 1px dashed rgba(212, 175, 55, 0.3);
    padding: 15px;
    min-height: 50px; /* Make sure it takes up space even if empty */
}

.integration-text p {
    color: var(--text-muted);
    font-size: 1rem;
    text-align: left;
    line-height: 1.7;
}

.reframe-label {
    font-size: 0.85rem;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 15px 0 8px 0;
    font-weight: 500;
    text-align: left;
}

.reframe-old,
.reframe-new {
    text-align: left;
    font-size: 1.05rem;
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.5;
}

.reframe-new {
    font-style: italic;
    color: var(--accent-light);
    font-weight: 500;
}

.inquiry-prompt {
    font-size: 1.25rem;
    font-style: italic;
    color: var(--accent-light);
    line-height: 1.6;
    font-weight: 500;
}

.mandala-decoration {
    width: 100%;
    height: 60px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 100"><circle cx="400" cy="50" r="40" fill="none" stroke="%23D4AF37" stroke-width="0.5" opacity="0.3"/><circle cx="400" cy="50" r="30" fill="none" stroke="%23D4AF37" stroke-width="0.5" opacity="0.3"/><circle cx="400" cy="50" r="20" fill="none" stroke="%23D4AF37" stroke-width="0.5" opacity="0.3"/></svg>') center top no-repeat;
    background-size: contain;
    margin-bottom: 10px;
}

.back-btn {
    position: absolute;
    left: 0;
    top: 0;
    background: none;
    border: none;
    color: var(--accent-gold);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
}

.sanskrit-subtitle {
    font-family: 'Noto Sans Devanagari', sans-serif;
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Content */
.content {
    flex: 1;
    overflow-y: auto;
}

.centered-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Section Cards */
.section-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--accent-gold);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.section-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.card-icon {
    font-size: 2.5rem;
    margin-right: 20px;
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon-img {
    width: 80px; /* Even bigger from 65px */
    height: 80px;
    object-fit: contain;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

/* Keep diya and practice insights at original size */
.section-card[data-screen="morning"] .card-icon-img,
.section-card[data-screen="insights"] .card-icon-img {
    width: 60px; /* Slightly bigger from 50px */
    height: 60px;
}

.section-card:hover .card-icon-img {
    opacity: 1;
}

.card-content h2 {
    font-size: 1.3rem;
    color: var(--accent-gold);
    margin-bottom: 5px;
    font-weight: 400;
}

.card-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

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

/* Buttons */
.primary-btn,
.secondary-btn {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 25px;
    font-size: 1.2rem;
    font-family: 'Cinzel', serif;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    font-weight: 500;
}

.primary-btn {
    background: var(--accent-gold);
    color: var(--primary-dark);
}

.primary-btn:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.koshas-grid {
    grid-template-columns: 1fr;
}

.option-btn {
    padding: 20px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--accent-gold);
    border-radius: 10px;
    color: var(--text-light);
    font-size: 1rem;
    font-family: 'Noto Serif', serif;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.kosha-btn {
    padding: 15px;
    text-align: left;
}

.option-title {
    font-size: 1.1rem;
    color: var(--accent-gold);
    margin-bottom: 5px;
    font-weight: 500;
}

.option-subtitle {
    font-family: 'Noto Sans Devanagari', sans-serif;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.option-description {
    font-size: 0.85rem;
    color: var(--text-light);
    opacity: 0.8;
}

.saksi-option {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--accent-gold);
    border-width: 2px;
    padding: 25px 15px;
}

.saksi-option:hover {
    background: rgba(212, 175, 55, 0.2);
}

.saksi-option .option-title {
    font-size: 1.3rem;
}

/* Kosha Info Box */
.kosha-info-box {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.kosha-name-sanskrit {
    font-family: 'Noto Sans Devanagari', sans-serif;
    font-size: 1.5rem;
    color: var(--accent-gold);
    margin-bottom: 10px;
}

.kosha-description {
    font-size: 1rem;
    color: var(--text-light);
}

/* Text Boxes */
.question-box,
.teaching-box,
.intention-text,
.reframe-box,
.inquiry-box,
.sanskrit-box {
    background: transparent;
    border: 2px solid var(--accent-gold);
    border-radius: 25px;
    padding: 30px 25px;
    margin-bottom: 20px;
    position: relative;
}

.intention-text.with-icon {
    text-align: center;
    padding-top: 60px;
}

/* Icon badges at top center of boxes */
.intention-text.with-icon[data-icon="diya"]::before {
    content: '';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    background: var(--primary-dark);
    border: 2px solid var(--accent-gold);
    border-radius: 50%;
    background-image: url('diya_icon.png');
    background-size: 35px 35px;
    background-position: center;
    background-repeat: no-repeat;
}

.question-text {
    font-size: 1.2rem;
    text-align: center;
    color: var(--accent-light);
}

.large-text {
    font-size: 1.4rem;
    text-align: center;
    font-style: italic;
    color: var(--accent-light);
    margin-bottom: 20px;
}

.sanskrit-text {
    font-family: 'Noto Sans Devanagari', sans-serif;
    font-size: 1.5rem;
    text-align: center;
    color: var(--accent-gold);
    margin: 15px 0;
}

.translation {
    font-size: 0.9rem;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

.teaching-quote {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-light);
    margin-bottom: 15px;
}

.teaching-source {
    font-size: 0.9rem;
    color: var(--accent-gold);
    text-align: right;
    font-style: italic;
}

/* Sanskrit Box */
.devanagari {
    font-family: 'Noto Sans Devanagari', sans-serif;
    font-size: 1.3rem;
    color: var(--accent-gold);
    margin-bottom: 15px;
    line-height: 1.8;
}

.transliteration {
    font-size: 1rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 15px;
}

.source {
    font-size: 0.9rem;
    color: var(--accent-gold);
    margin-top: 15px;
    font-weight: 500;
}

/* Teaching Sections */
.teaching-section {
    margin-bottom: 30px;
}

.section-label {
    font-size: 0.9rem;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    font-weight: 400;
}

.reframe-old,
.reframe-new {
    margin: 10px 0;
    line-height: 1.5;
}

.inquiry-text {
    font-size: 1.2rem;
    font-style: italic;
    color: var(--accent-light);
    text-align: center;
}

/* Reflection */
.reflection-intro {
    text-align: center;
    margin-bottom: 30px;
}

.intro-text {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 15px;
}

.reflection-question {
    margin-bottom: 25px;
}

.reflection-question h3 {
    font-size: 1.1rem;
    color: var(--accent-gold);
    margin-bottom: 10px;
    font-weight: 400;
}

textarea {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    color: var(--text-light);
    font-family: 'Noto Serif', serif;
    font-size: 1rem;
    resize: vertical;
}

textarea::placeholder {
    color: var(--text-muted);
}

.closing-blessing {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 10px;
}

.blessing-text {
    font-size: 1.2rem;
    font-style: italic;
    color: var(--accent-light);
    margin-bottom: 10px;
}

/* Settings */
.settings-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

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

.settings-section h3 {
    color: var(--accent-gold);
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: 400;
}

.setting-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.setting-item {
    margin: 15px 0;
}

.setting-item label {
    display: inline-block;
    color: var(--text-light);
    margin-right: 20px;
    font-size: 1rem;
}

.sound-selection {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.sound-selection > label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
}

.sound-options {
    display: grid;
    gap: 10px;
}

.sound-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    transition: background 0.2s ease;
}

.sound-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.sound-option input[type="radio"] {
    margin: 0;
}

.sound-option label {
    flex: 1;
    margin: 0;
    cursor: pointer;
}

.play-sound-btn {
    background: var(--accent-gold);
    color: var(--primary-dark);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.play-sound-btn:hover {
    background: var(--accent-light);
    transform: scale(1.1);
}

.play-sound-btn:active {
    transform: scale(0.95);
}

input[type="time"],
input[type="number"] {
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 5px;
    color: var(--text-light);
    font-family: 'Noto Serif', serif;
    font-size: 1rem;
}

input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.time-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

#blockout-list {
    margin: 15px 0;
}

.blockout-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    margin-bottom: 10px;
}

.blockout-item button {
    background: none;
    border: none;
    color: var(--accent-gold);
    cursor: pointer;
    font-size: 1.2rem;
}

/* Footer */
.footer-text {
    text-align: center;
    margin-top: 30px;
    padding: 20px 0;
}

.sanskrit-small {
    font-family: 'Noto Sans Devanagari', sans-serif;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 400px) {
    .screen-title {
        font-size: 1.5rem;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .option-btn {
        padding: 15px;
    }
}

/* Loading animations */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading {
    animation: shimmer 2s infinite;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 1000px 100%;
}
