/* Base Variables & Reset */
:root {
    --font-base: 16px;
    --font-scale: 1;

    /* Theme 1: Dark Mode Sky Blue (Default) */
    --bg-color: #111827; /* gray-900 */
    --text-color: #f3f4f6; /* gray-100 */
    --header-bg: #1e40af; /* blue-800 */
    --header-text: #ffffff;
    --section-bg: #1f2937; /* gray-800 */
    --heading-color: #93c5fd; /* blue-300 */
    --subheading-color: #bfdbfe; /* blue-200 */
    --btn-bg: #2563eb; /* blue-600 */
    --btn-hover: #1d4ed8; /* blue-700 */
    --footer-bg: #1f2937; /* gray-800 */
    --footer-text: #d1d5db; /* gray-300 */
}

/* Theme 2: Night (High Contrast Dark) */
html[data-theme="theme-dark-2"] {
    --bg-color: #000000;
    --text-color: #ffffff;
    --header-bg: #1a1a1a;
    --header-text: #ffd700;
    --section-bg: #111111;
    --heading-color: #ffd700;
    --subheading-color: #e0e0e0;
    --btn-bg: #333333;
    --btn-hover: #555555;
    --footer-bg: #111111;
    --footer-text: #cccccc;
}

/* Theme 3: Midnight Purple */
html[data-theme="theme-dark-3"] {
    --bg-color: #1a0b2e;
    --text-color: #e0d0f0;
    --header-bg: #2d1b4e;
    --header-text: #ffffff;
    --section-bg: #241240;
    --heading-color: #d8b4fe;
    --subheading-color: #c0a0e0;
    --btn-bg: #5b21b6;
    --btn-hover: #4c1d95;
    --footer-bg: #2d1b4e;
    --footer-text: #a090b0;
}

/* Theme 4: Deep Forest */
html[data-theme="theme-dark-4"] {
    --bg-color: #052e16;
    --text-color: #dcfce7;
    --header-bg: #064e3b;
    --header-text: #ffffff;
    --section-bg: #064e3b;
    --heading-color: #86efac;
    --subheading-color: #bbf7d0;
    --btn-bg: #059669;
    --btn-hover: #047857;
    --footer-bg: #064e3b;
    --footer-text: #a7f3d0;
}

/* Theme 5: Light Mode Clean White */
html[data-theme="theme-light-1"] {
    --bg-color: #f9fafb; /* gray-50 */
    --text-color: #111827; /* gray-900 */
    --header-bg: #2563eb; /* blue-600 */
    --header-text: #ffffff;
    --section-bg: #ffffff;
    --heading-color: #1e40af; /* blue-800 */
    --subheading-color: #1e3a8a; /* blue-900 */
    --btn-bg: #3b82f6; /* blue-500 */
    --btn-hover: #2563eb; /* blue-600 */
    --footer-bg: #f3f4f6; /* gray-100 */
    --footer-text: #4b5563; /* gray-600 */
}

/* Theme 6: Warm Sepia (Paper) */
html[data-theme="theme-light-2"] {
    --bg-color: #f5f5dc;
    --text-color: #3e2723;
    --header-bg: #5d4037;
    --header-text: #fff8e1;
    --section-bg: #fff8e1;
    --heading-color: #5d4037;
    --subheading-color: #795548;
    --btn-bg: #8d6e63;
    --btn-hover: #6d4c41;
    --footer-bg: #efebe9;
    --footer-text: #5d4037;
}

/* Theme 7: Cool Gray */
html[data-theme="theme-light-3"] {
    --bg-color: #e5e7eb;
    --text-color: #1f2937;
    --header-bg: #4b5563;
    --header-text: #ffffff;
    --section-bg: #f3f4f6;
    --heading-color: #111827;
    --subheading-color: #374151;
    --btn-bg: #6b7280;
    --btn-hover: #4b5563;
    --footer-bg: #d1d5db;
    --footer-text: #374151;
}

/* Theme 8: Soft Rose */
html[data-theme="theme-light-4"] {
    --bg-color: #fff1f2;
    --text-color: #881337;
    --header-bg: #be123c;
    --header-text: #ffffff;
    --section-bg: #ffe4e6;
    --heading-color: #9f1239;
    --subheading-color: #881337;
    --btn-bg: #e11d48;
    --btn-hover: #be123c;
    --footer-bg: #ffe4e6;
    --footer-text: #881337;
}

/* Global Styles */
html {
    font-size: calc(var(--font-base) * var(--font-scale));
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Aptos', Helvetica, sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3 {
    font-family: 'Gabriela', serif;
    margin-top: 0;
}

h1 {
    font-size: 2.5rem; /* ~40px base */
    line-height: 1.2;
}

h2 {
    color: var(--heading-color);
    font-size: 1.8rem; /* ~28px base */
    margin-bottom: 1rem;
}

h3 {
    color: var(--subheading-color);
    font-size: 1.25rem; /* ~20px base */
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

p, li {
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* Header */
header {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 1.5rem 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.top-link {
    font-size: 1.1rem;
    color: var(--text-color);
    background-color: var(--section-bg); 
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    text-decoration: none;
    margin-bottom: 0.5rem;
    border: 1px solid var(--heading-color);
    display: inline-block;
    transition: transform 0.2s;
}
.top-link:hover {
    transform: scale(1.05);
}

.title-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
}

.action-btn {
    background: var(--section-bg);
    border: 1px solid var(--heading-color);
    color: var(--heading-color);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.5rem 0.8rem;
    border-radius: 9999px;
    transition: all 0.2s;
    user-select: none;
    line-height: 1;
}

.action-btn:hover {
    background: var(--heading-color);
    color: var(--bg-color);
}

/* Main Content */
main {
    flex: 1;
    width: 100%;
    max-width: 56rem; /* max-w-4xl */
    margin: 0 auto;
    padding: 2rem 1rem;
    box-sizing: border-box;
}

/* Sections */
section {
    margin-bottom: 3rem;
}

.prayer-card {
    background-color: var(--section-bg);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Lists */
ol {
    padding-left: 1.5rem;
}
ol li {
    margin-bottom: 0.75rem;
}

/* Collapsible */
.collapsible {
    background-color: transparent;
    color: var(--heading-color);
    cursor: pointer;
    padding: 0;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-family: inherit;
    font-size: 1.5rem; /* Matches h2 roughly or larger */
    font-weight: 600;
}

.collapsible:after {
    content: '+';
    float: right;
    font-weight: bold;
    margin-left: 5px;
}

.collapsible.active:after {
    content: "-";
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.collapsible-content p, 
.collapsible-content ol {
    margin-top: 1rem;
}

/* Scroll to Top */
#scrollToTop {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background-color: var(--btn-bg);
    color: white;
    padding: 0.75rem;
    border-radius: 9999px;
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: background-color 0.3s;
    display: none; /* Hidden by default code logic usually, or kept visible */
    z-index: 50;
}
#scrollToTop:hover {
    background-color: var(--btn-hover);
}
#scrollToTop svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* Footer */
footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 1.5rem;
    text-align: center;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.8s ease-in-out;
}
@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 640px) {
    h1 { font-size: 1.8rem; }
    h2, .collapsible { font-size: 1.4rem; }
    .title-container { flex-direction: column; }
    .action-btn { margin-top: 0.5rem; }
}
