

/* Zen Aesthetic Styles for FindSoul - Mobile First Optimization */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@300;500;700&display=swap');

:root {
    --zen-ink: #1A1A1A;
    --zen-paper: #F5F5F5;
    --zen-gold: #B4A078;
    --zen-border: rgba(26, 26, 26, 0.1);
    --zen-accent-glow: rgba(180, 160, 120, 0.4);
    --zen-pos: #6A8E6A;
    --zen-neg: #A56565;
    --safe-area-bottom: env(safe-area-inset-bottom, 20px);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: 'Noto Serif SC', serif;
    background-color: var(--zen-paper);
    color: var(--zen-ink);
    height: 100%;
    width: 100%;
    overflow: hidden;
    position: fixed;
}

#root {
    height: 100%;
    width: 100%;
}

.findsoul-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.mobile-center {
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.parchment-bg {
    background-color: var(--zen-paper);
    background-image: url('https://www.transparenttextures.com/patterns/paper-fibers.png');
}

.initialization-card {
    position: relative;
    z-index: 2; /* Ensure clickability over background */
    width: 100%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 30px 20px;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.06);
    border: 1px solid var(--zen-border);
    animation: fadeIn 0.8s ease-out;
}

.brand-header {
    text-align: center;
    margin-bottom: 25px;
}

.calligraphy-title {
    font-size: 2.4rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.15em;
    color: var(--zen-ink);
}

.subtitle {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: var(--zen-gold);
    margin-top: 6px;
    text-transform: uppercase;
    font-weight: 500;
}

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

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    color: var(--zen-gold);
    font-weight: 700;
}

.zen-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--zen-border);
    padding: 10px 0;
    font-family: inherit;
    font-size: 1rem;
    color: var(--zen-ink);
    outline: none;
    border-radius: 0;
    width: 100%;
}

.gender-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.gender-box {
    background: rgba(255,255,255,0.4);
    border: 1px solid var(--zen-border);
    padding: 15px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.gender-box.active {
    border-color: var(--zen-gold);
    background: white;
    box-shadow: 0 4px 12px var(--zen-accent-glow);
}

.gender-box .cn { font-size: 1rem; font-weight: 600; }
.gender-box .en { font-size: 0.5rem; opacity: 0.5; margin-top: 2px; }

.time-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 8px;
}

.location-cascader {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.zen-select {
    background: rgba(255,255,255,0.4);
    border: 1px solid var(--zen-border);
    padding: 12px;
    font-family: inherit;
    font-size: 0.9rem;
    border-radius: 8px;
    outline: none;
    appearance: none;
}

.location-hint {
    font-size: 0.6rem;
    color: var(--zen-gold);
    opacity: 0.7;
    margin-top: 4px;
}

.awaken-button {
    margin-top: 25px;
    width: 100%;
    height: 52px;
    background: var(--zen-ink);
    color: white;
    border: none;
    border-radius: 26px;
    font-family: inherit;
    font-size: 1rem;
    letter-spacing: 0.1em;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    cursor: pointer;
}

.initialization-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    text-align: center;
    height: 100%;
}

.bagua-spinner {
    color: var(--zen-ink);
    animation: rotate 12s linear infinite;
    width: 80px;
}

.loading-text {
    font-size: 0.95rem;
    color: var(--zen-gold);
    padding: 0 20px;
}

/* Dashboard View Styles */
.dashboard-view {
    padding: 20px;
    background-color: var(--zen-paper);
    min-height: 100vh;
}

.dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 100px; /* Space for sticky nav */
    position: relative;
    z-index: 2; /* Fix: Ensure content is above the absolute background */
}

/* User Profile Card */
.user-profile-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.6);
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--zen-border);
}

.user-avatar {
    width: 56px;
    height: 56px;
    background: var(--zen-ink);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 300;
}

.user-info-text {
    display: flex;
    flex-direction: column;
}

.user-name {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.user-meta {
    margin: 2px 0 0;
    font-size: 0.8rem;
    opacity: 0.6;
}

/* Realm Card */
.realm-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--zen-border);
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.realm-header {
    margin-bottom: 10px;
}

.realm-label {
    font-size: 0.7rem;
    color: var(--zen-gold);
    letter-spacing: 2px;
}

.realm-name {
    font-size: 1.8rem;
    margin: 5px 0 0;
    color: var(--zen-ink);
}

.total-karma-display {
    margin: 15px 0;
}

.karma-big {
    font-size: 3rem;
    font-weight: 300;
    line-height: 1;
}

.karma-unit {
    font-size: 0.8rem;
    opacity: 0.5;
    margin-left: 5px;
}

.realm-desc {
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 0 0 10px;
}

.realm-poem {
    font-size: 0.85rem;
    color: var(--zen-gold);
    font-style: italic;
    margin: 0 0 20px;
}

.realm-progress-wrapper {
    margin-top: 15px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 5px;
    opacity: 0.6;
}

.progress-track.dark {
    background: rgba(0,0,0,0.1);
}

.progress-bar.light {
    background: var(--zen-ink);
}

/* Actions Section */
.section-title {
    font-size: 0.9rem;
    margin: 0 0 10px;
    padding-left: 5px;
    opacity: 0.7;
}

.action-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.action-cat-btn {
    background: rgba(255,255,255,0.8);
    border: 1px solid var(--zen-border);
    border-radius: 16px;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-cat-btn:active {
    transform: scale(0.96);
    background: #fff;
}

.action-cat-btn.active {
    background: var(--zen-ink);
    color: white;
    border-color: var(--zen-ink);
    transform: scale(0.98);
}

.cat-icon {
    font-size: 1.8rem;
}

.cat-name {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Expanded Actions Panel (Inline) */
.expanded-actions-panel {
    margin-top: 15px;
    background: rgba(255,255,255,0.5);
    border: 1px solid var(--zen-border);
    border-radius: 16px;
    padding: 15px;
}

/* History Section */
.history-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tabs-header {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--zen-border);
    padding-bottom: 10px;
}

.tab-btn {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--zen-ink);
    opacity: 0.4;
    padding: 0;
    cursor: pointer;
}

.tab-btn.active {
    opacity: 1;
    font-weight: 600;
}

.history-content {
    flex: 1;
    min-height: 200px;
}

.logs-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-logs {
    text-align: center;
    opacity: 0.4;
    font-size: 0.9rem;
    margin-top: 40px;
}

.log-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255,255,255,0.4);
    border-radius: 8px;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.log-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.log-time {
    font-size: 0.7rem;
    opacity: 0.4;
}

.log-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.log-score {
    font-weight: 700;
    font-size: 0.95rem;
}

.log-score.pos { color: var(--zen-pos); }
.log-score.neg { color: var(--zen-neg); }

/* Calendar */
.calendar-grid {
    background: rgba(255,255,255,0.5);
    border-radius: 12px;
    padding: 10px;
}

.calendar-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.8rem;
    margin-bottom: 8px;
    opacity: 0.6;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    border-radius: 6px;
    position: relative;
    cursor: pointer;
}

.calendar-day:active {
    background: rgba(0,0,0,0.05);
}

.day-indicator {
    font-size: 0.6rem;
    margin-top: 2px;
    padding: 1px 3px;
    border-radius: 4px;
    color: var(--zen-ink);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(2px);
    z-index: 50;
    display: flex;
    justify-content: center;
    align-items: flex-end; /* Bottom sheet by default */
}

.modal-sheet {
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 24px;
    animation: slideUp 0.3s ease-out;
}

.modal-center {
    background: #fff;
    width: 85%;
    max-width: 320px;
    border-radius: 20px;
    padding: 24px;
    margin-bottom: auto;
    margin-top: auto;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-header {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 700;
}

.sub-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sub-action-btn {
    background: var(--zen-paper);
    border: 1px solid var(--zen-border);
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
}

.sub-action-btn.disabled {
    opacity: 0.5;
    background: rgba(0,0,0,0.05);
    /* cursor: not-allowed; We keep it clickable to show the alert as requested */
}

.sub-btn-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sub-name {
    font-size: 0.95rem;
    font-weight: 500;
}

.sub-score {
    font-weight: 700;
    font-size: 0.9rem;
}
.sub-score.p { color: var(--zen-pos); }
.sub-score.n { color: var(--zen-neg); }

/* Confirm Modal */
.confirm-title {
    text-align: center;
    margin: 0 0 10px;
    font-size: 1.2rem;
}

.confirm-desc {
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.7;
    margin: 0 0 20px;
    line-height: 1.5;
}

.confirm-score-display {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1rem;
}

.confirm-score-display span {
    font-size: 1.4rem;
    font-weight: 700;
    margin-left: 8px;
}
.confirm-score-display span.pos { color: var(--zen-pos); }
.confirm-score-display span.neg { color: var(--zen-neg); }

.confirm-actions {
    display: flex;
    gap: 12px;
}

.confirm-btn, .cancel-btn {
    flex: 1;
    height: 44px;
    border-radius: 22px;
    border: none;
    font-size: 0.95rem;
    cursor: pointer;
}

.confirm-btn {
    background: var(--zen-ink);
    color: white;
}

.cancel-btn {
    background: transparent;
    border: 1px solid var(--zen-border);
    color: var(--zen-ink);
}

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

@keyframes popIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

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

/* Common Layout & Navigation */
.result-view, .dashboard-view {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--zen-paper);
}

.result-iframe {
    flex: 1;
    width: 100%;
    border: none;
    background: transparent;
}

.sticky-bottom {
    position: sticky;
    bottom: 0;
    z-index: 20;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--zen-border);
    padding: 12px 15px calc(12px + var(--safe-area-bottom));
    display: flex;
    gap: 12px;
}

.back-button {
    flex: 1;
    height: 48px;
    border: 1px solid var(--zen-ink);
    border-radius: 24px;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

.back-button.primary {
    background: var(--zen-ink);
    color: white;
}

.back-button.secondary {
    background: transparent;
    color: var(--zen-ink);
}

.back-button.full-width {
    width: 100%;
}

/* --- RESULT VIEW NEW STYLES --- */
.result-nav {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    margin-top: 10px;
    z-index: 5;
}

.nav-btn-text {
    background: none;
    border: none;
    font-size: 0.9rem;
    color: var(--zen-ink);
    font-family: inherit;
    cursor: pointer;
    opacity: 0.7;
}

.result-content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 10px 20px 100px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    position: relative;
    z-index: 2; /* Fix: Ensure content is above background */
}


/* Verdict Section */
.verdict-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.big-score-container {
    text-align: center;
    margin-bottom: 10px;
}

.score-label {
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    color: var(--zen-gold);
    display: block;
    margin-bottom: 5px;
}

.big-score {
    font-size: 5rem;
    font-weight: 300;
    margin: 0;
    line-height: 1;
    color: var(--zen-ink);
}

.verdict-card {
    text-align: center;
    padding: 0 10px;
}

.verdict-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 12px;
    letter-spacing: 0.1em;
    color: var(--zen-ink);
}

.verdict-text {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
    opacity: 0.8;
}

.analysis-box {
    margin-top: 10px;
    padding: 16px;
    background: rgba(180, 160, 120, 0.08);
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--zen-ink);
    opacity: 0.85;
}

/* Dimension List */
.dimension-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dimension-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dimension-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--zen-ink);
}

.dimension-value small {
    opacity: 0.5;
    font-size: 0.75em;
}

.dimension-track {
    width: 100%;
    height: 6px;
    background: rgba(0,0,0,0.05);
    border-radius: 3px;
    overflow: hidden;
}

.dimension-fill {
    height: 100%;
    background: var(--zen-ink);
    border-radius: 3px;
    transition: width 1s ease-out;
}

.result-footer {
    display: flex;
    justify-content: center;
    align-items: center;
}

.start-journey-btn {
    width: 100%;
    max-width: 320px;
    height: 56px;
    background: var(--zen-ink);
    color: white;
    border: none;
    border-radius: 28px;
    font-size: 1.1rem;
    letter-spacing: 0.15em;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    transition: transform 0.2s;
}

.start-journey-btn:active {
    transform: scale(0.98);
}


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

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

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

.animate-in {
    animation: fadeIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Mobile Tweak */
@media (max-height: 700px) {
    .calligraphy-title { font-size: 2rem; }
    .initialization-card { padding: 20px 15px; }
    .form-content { gap: 15px; }
    .stage-title { font-size: 1.5rem; }
    .karma-value-main { font-size: 2.2rem; }
    .big-score { font-size: 4rem; }
}
