body {
    font-family: 'Vazirmatn', sans-serif;
    padding-top: 70px; /* Adjust for fixed navbar */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main.container {
    flex-grow: 1; /* Makes the main content area expand to fill available space */
}

/* --- 1. General Background Styles --- */

/* Base styles for any page with a full-screen background */
.has-background {
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* Keeps the background fixed during scroll */
}

/* Make the main container transparent on all background pages */
.has-background main.container {
    background-color: transparent !important;
    padding-top: 2rem; /* Add some default padding for content */
    padding-bottom: 2rem;
}

/* Style the footer on background pages to be semi-transparent */
.has-background footer {
    background-color: rgba(0, 0, 0, 0.5);
    color: #f8f9fa; /* Light text color for contrast */
}

/* --- 2. Specific Page Backgrounds --- */

body.home-background {
    background-image: url('/assets/img/kernel-home-background.png');
}

body.about-page {
    background-image: url('/assets/img/kernel-about-us-background.png');
}

body.energy-background {
    background-image: url('/assets/img/kernel-protection-square-background.png');
}

body.sunrise-background {
    background-image: url('/assets/img/kernel-sunrise-sunset-zodiac.png');
}

body.login-background {
    background-image: url('/assets/img/kernel-login.png');
}

/* --- 3. Component Styles for Background Pages --- */

/* Home page jumbotron */
.home-background .jumbotron {
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 0.5rem;
    color: white;
}

/* About page card */
/* NEW: Restore the transparent purple background for the card on the about/poems pages. */
.about-page .card {
    background-color: rgba(40, 0, 40, 0.514);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}
/* Energy page components */
.energy-background .card,
.energy-background .alert {
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Sunrise and Login page components */
.sunrise-background h1, .sunrise-background h2,
.login-background h1, .login-background h2 {
    color: #ffffff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.sunrise-background .card,
.login-background .card {
    background-color: rgba(255, 255, 255, 0.2);
    color: #212529;
}

/* --- 4. Default Page Style (No Background) --- */

/* Solid background for standard pages for readability */
body:not(.has-background) main.container {
    background-color: #f8f9fa; /* A light gray, similar to Bootstrap's bg-light */
    padding: 2rem;
    border-radius: 0.5rem;
}

/* --- 5. Component-Specific Styles --- */
.saturn-square {
    width: 400px; /* Increased width for sum column */
    height: 400px; /* Increased height for sum row */
    margin: 20px auto;
    border-collapse: collapse;
    border: 3px solid #333;
    font-family: 'Times New Roman', serif;
}
.saturn-square td {
    width: 33.33%;
    height: 33.33%;
    border: 2px solid #555;
    text-align: center; 
    font-size: 2.2rem; /* Slightly smaller for more space */
    font-weight: bold;
    padding: 0;
    vertical-align: middle;
}
.saturn-square .center-cell {
    background-color: #5D0F1D; /* Bordeaux color */
    color: white;
}
.saturn-square .sum-cell {
    background-color: #e9f5ff; /* Light blue for sums */
    font-weight: normal;
    font-size: 1.8rem;
    color: #005a9c;
    border-style: dashed;
    border-color: #999;
}
.saturn-summary {
    text-align: center;
}

/* --- NEW: Quran Text Styling --- */
/* Ensures that any element with this class is properly styled for Uthmani script */
.uthmani-text {
    font-family: 'Amiri', serif;
    direction: rtl;
    text-align: right; /* Ensures text aligns to the right */
    display: block; /* Forces the element to be treated as a block, ensuring RTL is respected */
}


/* Define the custom font so it can be used by other classes. */
@font-face {
    font-family: 'IranNastaliq';
    src: url('/assets/fonts/IranNastaliq.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* NEW: Class to apply the Nastaliq font and ensure correct text alignment. */
.poem-text {
    font-family: 'IranNastaliq', serif;
    direction: rtl;
    text-align: right;
}

/* Styles for the linkified Farsi numbers in mnemonic stories */
.farsi-link-form {
    display: inline-block;
    vertical-align: middle;
}

.farsi-link-form .btn-link {
    vertical-align: baseline;
    text-decoration: none;
}

.farsi-number-badge {
    border: 1px solid #fff;
}

/* NEW: Style for the anchor tag that replaces the form to remove the underline */
.farsi-link-anchor {
    /* Use !important to increase specificity and ensure this rule always applies. */
    text-decoration: none !important;
}

/* Styles for the word-by-word Farsi translation view */
.word-by-word-container {
    direction: rtl;
}

.verse-block {
    border: 1px solid #444;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    background-color: #2c3034;
}

.verse-header {
    padding: 0.5rem 1rem;
    background-color: #343a40;
    border-bottom: 1px solid #444;
}

.verse-words {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding: 1rem;
}

.word-pair {
    text-align: center;
    margin: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.25rem;
    background-color: #212529;
    min-width: 80px;
}

.arabic-word {
    font-family: 'Amiri', serif;
    font-size: 1.5rem;
    color: #fff;
}

/* Default color for Farsi translation words */
.farsi-word {
    font-size: 0.9rem;
    color: #adb5bd; /* Default to the lighter gray color */
}

/* NEW: Style for the color swatch buttons in the translation modal */
.farsi-color-swatch {
    width: 25px;
    height: 25px;
}
