:root {
    --bg-color: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --card-bg: #ffffff;
    
    --primary-color: #4f46e5; /* Indigo */
    --primary-hover: #4338ca;
    
    --secondary-color: #9333ea; /* Purple */
    --secondary-hover: #7e22ce;
    
    --amber-bg: #fef3c7;
    --amber-text: #d97706;
    
    --indigo-bg: #e0e7ff;
    --indigo-text: #4f46e5;
    
    --rose-bg: #ffe4e6;
    --rose-text: #e11d48;
    
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 1rem;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}

/* --- Layout & Typography --- */
#app {
    width: 100%;
    max-width: 900px;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #2563eb, #9333ea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* --- Views Management --- */
.view {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.view.active {
    display: block;
}

.view.hidden {
    display: none;
}

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

/* --- Cards --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e2e8f0;
}

.menu-card {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.menu-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.content-card {
    max-width: 600px;
    margin: 0 auto;
}

/* --- Icon Boxes --- */
.icon-box {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.amber { background-color: var(--amber-bg); color: var(--amber-text); }
.indigo { background-color: var(--indigo-bg); color: var(--indigo-text); }
.rose { background-color: var(--rose-bg); color: var(--rose-text); }

/* --- Text Styles --- */
h3 { margin-bottom: 0.5rem; color: var(--text-primary); }
p { color: var(--text-secondary); line-height: 1.6; }

.link-text {
    margin-top: auto;
    padding-top: 1rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.text-amber { color: var(--amber-text); }
.text-indigo { color: var(--indigo-text); }
.text-rose { color: var(--rose-text); }
.text-green { color: #16a34a; }

/* --- Inner Page Header --- */
.card-header {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.back-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    margin-right: 1rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s;
}

.back-btn:hover { background: #f1f5f9; }

.header-title { display: flex; align-items: center; gap: 0.75rem; }
.header-title .icon { font-size: 1.5rem; }
.header-title h2 { font-size: 1.5rem; font-weight: 700; }

/* --- Buttons --- */
.btn {
    width: 100%;
    padding: 0.85rem;
    border-radius: 0.5rem;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

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

.btn-primary {
    background: linear-gradient(to right, #2563eb, #4f46e5);
    color: white;
}
.btn-primary:hover { box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); }

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}
.btn-secondary:hover { background-color: var(--secondary-hover); }

.btn-outline {
    background: transparent;
    border: 2px solid #cbd5e1;
    color: var(--text-primary);
}
.btn-outline:hover { border-color: #94a3b8; background: #f8fafc; }

.btn-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    text-decoration: underline;
    cursor: pointer;
    margin-top: 1rem;
    font-size: 0.9rem;
    width: 100%;
}
.btn-link:hover { color: var(--primary-color); }

/* --- Inputs --- */
.input-group { margin-bottom: 1.5rem; }
.input-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; font-size: 0.9rem; }
.input-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    outline: none;
    font-size: 1rem;
    transition: border-color 0.2s;
}
.input-group input:focus { border-color: var(--primary-color); ring: 2px var(--primary-color); }

/* --- Outputs --- */
.output-box {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background-color: #fffbeb; /* amber-50 */
    border: 1px solid #fef3c7;
    border-radius: 0.75rem;
    text-align: center;
    font-style: italic;
    color: #4b5563;
    font-size: 1.1rem;
}

.quiz-box {
    margin-top: 1rem;
    padding: 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid transparent;
}

.question-box { background-color: #e0e7ff; border-color: #c7d2fe; }
.answer-box { background-color: #dcfce7; border-color: #bbf7d0; }

.label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

/* --- Affirmation Special Styling --- */
.centered-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.affirmation-card {
    background: linear-gradient(135deg, #ffe4e6 0%, #ffedd5 100%);
    padding: 2rem;
    border-radius: 1rem;
    position: relative;
    margin-bottom: 1.5rem;
    width: 100%;
}

.quote-mark {
    font-size: 4rem;
    font-family: serif;
    color: #f43f5e;
    opacity: 0.2;
    position: absolute;
    line-height: 1;
}

.quote-mark.top { top: 0; left: 1rem; }
.quote-mark.bottom { bottom: -2rem; right: 1rem; transform: rotate(180deg); }

#affirmation-text {
    font-family: serif;
    font-size: 1.25rem;
    color: #881337;
    font-weight: 500;
}

/* --- Loading States --- */
.loading-text {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    animation: pulse 1.5s infinite;
}

.error-text {
    color: #ef4444;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 0.5rem;
}

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

.hidden { display: none !important; }
