body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-image: linear-gradient(135deg, rgba(246, 211, 101, 0.8) 0%, rgba(253, 160, 133, 0.8) 100%), url('/background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-color: #f6d365; /* Fallback */
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column; 
    align-items: center; 
    min-height: 100vh;
    text-align: center;
    box-sizing: border-box;
    overflow-y: auto;
    transition: background 0.3s, color 0.3s;
}

/* Dark Mode Styles */
body[data-theme="dark"] {
    background-image: linear-gradient(135deg, rgba(44, 62, 80, 0.85) 0%, rgba(76, 161, 175, 0.85) 100%), url('/background.png');
    background-color: #2c3e50; /* Fallback */
    color: #f0f0f0;
}

body[data-theme="dark"] .container {
    background-color: rgba(45, 55, 65, 0.95); 
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] h1 {
    color: #e67e22; 
}

body[data-theme="dark"] h2 {
    color: #2ecc71; 
}

body[data-theme="dark"] .sign-card {
    background-color: #3a4a5a;
    border-color: #566573;
    color: #e0e0e0;
}
body[data-theme="dark"] .sign-card:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.25);
}

body[data-theme="dark"] button#revealGuidanceBtn, 
body[data-theme="dark"] button#revealReadingBtn {
    background-color: #d35400; 
    color: #ffffff;
}
body[data-theme="dark"] button#revealGuidanceBtn:hover, 
body[data-theme="dark"] button#revealReadingBtn:hover {
    background-color: #e67e22;
}
body[data-theme="dark"] button#revealGuidanceBtn:disabled, 
body[data-theme="dark"] button#revealReadingBtn:disabled {
    background-color: #7f8c8d;
    opacity: 0.6;
}

body[data-theme="dark"] .section {
    background-color: #34495e; 
    border-color: #4a6175;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

body[data-theme="dark"] .oracle-text, 
body[data-theme="dark"] .reading-text p,
body[data-theme="dark"] #readingText.oracle-text {
    color: #bdc3c7; 
}

body[data-theme="dark"] #readingResult {
    background-color: #2c3e50; 
}

body[data-theme="dark"] .angel-card {
    background-color: #3a4a5a;
    border-color: #566573;
}
body[data-theme="dark"] .angel-card img {
    border-color: #4f6070;
}
body[data-theme="dark"] .angel-card h3 {
    color: #3498db; 
}
body[data-theme="dark"] .angel-card p {
    color: #bdc3c7;
}

body[data-theme="dark"] .back-link {
    color: #3498db;
}
body[data-theme="dark"] .back-link:hover {
    color: #2980b9;
}

body[data-theme="dark"] .sign-info-section {
    background-color: #283747; 
    border-color: #3c5064;
}
body[data-theme="dark"] .sign-info-section h2 {
    color: #e67e22; 
}
body[data-theme="dark"] .sign-info-section h3 {
    color: #d35400;
    border-bottom-color: #3c5064;
}
body[data-theme="dark"] .sign-info-section p,
body[data-theme="dark"] .sign-info-section ul li {
    color: #becdd8;
}
body[data-theme="dark"] .sign-info-section strong {
    color: #d0e0f0;
}
body[data-theme="dark"] .sign-info-section .meta-info {
    color: #a0b0c0;
}

/* Toolbar for theme/language controls */
.toolbar {
    position: fixed; 
    align-items: center; 
    display: flex;
    gap: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000; 
}

body[data-theme="dark"] .toolbar {
    background-color: rgba(40, 55, 71, 0.85); 
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.toolbar button, .toolbar select {
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #800020;
    background-color: #fff;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
}
.toolbar button img.button-icon, #readAloudBtn img.button-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}


body[data-theme="dark"] .toolbar button, 
body[data-theme="dark"] .toolbar select {
    background-color: #4a6175;
    border-color: #566573;
    color: #f0f0f0;
}
body[data-theme="dark"] .toolbar button:hover, 
body[data-theme="dark"] .toolbar select:hover {
    background-color: #5e768c;
}

.container {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    max-width: 700px;
    width: 100%;
    margin-top: 80px; 
    margin-bottom: 20px;
}

/* Styles for sign pages */
.container.sign-page {
    margin-top: 20px;
    max-width: 600px; 
}

#spiritualBanner {
    width: 100%;
    max-width:250px;
    height: auto;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    object-fit: cover;
}

h1 {
    color: #800020; 
    margin-bottom: 25px;
    font-size: 2.5em;
}

h2 {
    color: #800020; 
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.8em;
}

/* Sign Selection Grid */
#signSelectionSection {
    margin-bottom: 30px;
}

.sign-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    justify-content: center;
}

.sign-card {
    background-color: #fff;
    border: 1px solid #800020;
    border-radius: 10px;
    padding: 15px;
    text-decoration: none;
    color: #800020;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 120px;
}

.sign-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.sign-icon {
    width: 75px;
    height: 75px;
    margin-bottom: 10px;
    object-fit: contain;
}

.sign-card span {
    font-weight: bold;
    font-size: 0.9em;
}

button#revealGuidanceBtn, button#revealReadingBtn {
    background-color: #800020; 
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, opacity 0.3s ease;
    margin-bottom: 20px; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

button#revealGuidanceBtn:hover, button#revealReadingBtn:hover {
    background-color: #ec971f;
    transform: translateY(-2px);
}

button#revealGuidanceBtn:active, button#revealReadingBtn:active {
    transform: translateY(1px);
}

button#revealGuidanceBtn:disabled, button#revealReadingBtn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
}

#resultsContainer { 
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.6s ease-in-out, max-height 0.8s ease-in-out, margin-top 0.8s ease-in-out;
}

#resultsContainer.visible {
    opacity: 1;
    max-height: 1000px; 
    margin-top: 20px;
}

.section {
    background-color: #ffffff;
    border: 1px solid #800020;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.oracle-text, .reading-text p { 
    font-size: 1.1em;
    line-height: 1.6;
    color: #555;
    min-height: 50px; 
}
#readingText.oracle-text { 
    font-size: 1.1em;
    line-height: 1.6;
    color: #555;
    min-height: 50px; 
}

/* Styles for sign pages - reading text display */
#readingResult {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.6s ease-in-out, max-height 0.8s ease-in-out, margin-top 0.8s ease-in-out;
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 0 20px; 
    margin-top: 0;
}
#readingResult.visible {
    opacity: 1;
    max-height: 500px; 
    margin-top: 20px;
    padding: 20px;
}

.angel-card {
    background-color: #fff;
    border: 1px solid #800020;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-width: 300px; 
    margin: 0 auto; 
}

.angel-card img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    border: 3px solid white; 
}

.angel-card h3 {
    color: #0275d8; 
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.angel-card p {
    font-size: 1em;
    line-height: 1.5;
    color: #555;
    margin-bottom: 0;
}

/* Back link for sign pages */
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #0275d8;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}
.back-link:hover {
    color: #025aa5;
    text-decoration: underline;
}

.sign-symbol-page {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px auto;
    display: block;
    object-fit: contain;
}

/* New styles for Sign Information Section */
.sign-info-section {
    background-color: #fdf6e3; 
    border: 1px solid #f0e0c0;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    text-align: left; 
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.sign-info-section h2 { 
    color: #c07030; 
    text-align: center; 
    font-size: 1.6em;
    margin-top: 0;
    margin-bottom: 20px;
}

.sign-info-section h3 { 
    color: #d9534f; 
    font-size: 1.25em;
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid #f0e0c0;
    padding-bottom: 5px;
}
.sign-info-section h3:first-of-type {
    margin-top: 0;
}

.sign-info-section p {
    font-size: 1em;
    line-height: 1.7;
    color: #5c4d3c; 
    margin-bottom: 12px;
}

.sign-info-section ul {
    list-style-type: '✨'; 
    padding-left: 20px; 
    margin-bottom: 15px;
}

.sign-info-section ul li {
    margin-bottom: 8px;
    padding-left: 8px; 
    color: #5c4d3c;
}

.sign-info-section strong {
    color: #4a3c2c; 
    font-weight: 600;
}

.sign-info-section .meta-info {
    font-size: 0.9em;
    color: #7a6d5c;
    margin-bottom: 15px;
    font-style: italic;
}

/* Add button for read aloud */
#readAloudBtn {
    background-color: #5bc0de; 
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1em;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 10px; 
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#readAloudBtn:hover {
    background-color: #31b0d5;
    transform: translateY(-1px);
}
#readAloudBtn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

body[data-theme="dark"] #readAloudBtn {
    background-color: #46b8da;
}
body[data-theme="dark"] #readAloudBtn:hover {
    background-color: #25a6c5;
}
body[data-theme="dark"] #readAloudBtn:disabled {
    background-color: #7f8c8d;
}

/* Responsive adjustments */
@media (max-width: 750px) {
    .toolbar {
        flex-direction: column; 
        align-items: flex-end;
        top: 5px;
        right: 5px;
        padding: 5px;
    }
    .toolbar button, .toolbar select {
        width: 100%; 
        justify-content: center;
    }
    .container {
        margin-top: 100px; 
    }
    .sign-selection-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }
    .sign-card {
        padding: 10px;
        min-height: 100px;
    }
    .sign-icon {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
        margin-top: 120px; 
    }
    h1 {
        font-size: 2em;
    }
    h2 {
        font-size: 1.5em;
    }
    button#revealGuidanceBtn, button#revealReadingBtn {
        padding: 12px 24px;
        font-size: 1em;
    }
    .section {
        padding: 20px;
    }
    #resultsContainer.visible {
        max-height: 1200px; 
    }
    #readingResult.visible {
        max-height: 600px;
    }
    .sign-info-section {
        padding: 20px;
    }
    .sign-info-section h2 {
        font-size: 1.4em;
    }
    .sign-info-section h3 {
        font-size: 1.15em;
    }
}