/* ==========================================================================
   Insight & Nurture - Main Stylesheet v1.3 (Final Verified Version)
   Includes styles for landing page, tool pages, multi-part calculators,
   themes, and responsiveness.
   ========================================================================== */

/* --- Base Styles & Variables --- */
:root {
    --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-secondary: Georgia, 'Times New Roman', Times, serif; /* Retained */
    --transition-speed: 0.3s ease;
    --link-opacity-hover: 0.85;

    /* Light Mode Colors */
    --bg-color-light: #f9fcff;
    --text-color-light: #2c3e50;
    --primary-color-light: #3498db;
    --secondary-color-light: #ffffff;
    --accent-color-light: #2ecc71;
    --border-color-light: #e1e8ed;
    --card-shadow-light: 0 5px 15px rgba(0, 0, 0, 0.07);
    --section-card-shadow-light: 0 8px 25px rgba(60, 100, 130, 0.1);
    --header-bg-light: #ffffff;
    --footer-bg-light: #f2f6f9;
    --alt-bg-light: #f7fafd;
    --ad-bg-light: #eef3f7;
    --ad-border-light: #d8e1e8;
    --link-color-light: var(--primary-color-light);
    --link-hover-light: #2980b9;
    --icon-color-light: #ffffff;
    --error-color-light: #e74c3c;

    /* Dark Mode Colors */
    --bg-color-dark: #1c2128;
    --text-color-dark: #cdd9e5;
    --primary-color-dark: #58a6ff;
    --secondary-color-dark: #22272e;
    --accent-color-dark: #56d364;
    --border-color-dark: #373e47;
    --card-shadow-dark: 0 6px 18px rgba(0, 0, 0, 0.25);
    --section-card-shadow-dark: 0 10px 30px rgba(0, 0, 0, 0.3);
    --header-bg-dark: #22272e;
    --footer-bg-dark: #161a20;
    --alt-bg-dark: #1f242b;
    --ad-bg-dark: #272c34;
    --ad-border-dark: #3f4650;
    --link-color-dark: var(--primary-color-dark);
    --link-hover-dark: #79b8ff;
    --icon-color-dark: #ffffff;
    --error-color-dark: #ff7b72;

    /* Gradients */
    --gradient-primary-light: linear-gradient(135deg, var(--primary-color-light), var(--accent-color-light));
    --gradient-primary-dark: linear-gradient(135deg, var(--primary-color-dark), var(--accent-color-dark));
    --gradient-hero-light: linear-gradient(140deg, #4facfe 0%, #00f2fe 100%);
    --gradient-hero-dark: linear-gradient(140deg, #3b4a75 0%, #266a73 100%);
    --gradient-cta-light: linear-gradient(45deg, var(--accent-color-light), #27ae60);
    --gradient-cta-dark: linear-gradient(45deg, var(--accent-color-dark), #4cc168);
}

/* --- Theme Application --- */
[data-theme="light"] {
    --bg-color: var(--bg-color-light);
    --text-color: var(--text-color-light);
    --primary-color: var(--primary-color-light);
    --secondary-color: var(--secondary-color-light);
    --accent-color: var(--accent-color-light);
    --border-color: var(--border-color-light);
    --card-bg: var(--secondary-color-light);
    --section-card-bg: var(--secondary-color-light);
    --section-card-alt-bg: var(--alt-bg-light);
    --card-shadow: var(--card-shadow-light);
    --section-card-shadow: var(--section-card-shadow-light);
    --header-bg: var(--header-bg-light);
    --footer-bg: var(--footer-bg-light);
    --ad-bg: var(--ad-bg-light);
    --ad-border: var(--ad-border-light);
    --link-color: var(--link-color-light);
    --link-hover: var(--link-hover-light);
    --gradient-primary: var(--gradient-primary-light);
    --gradient-hero: var(--gradient-hero-light);
    --gradient-cta: var(--gradient-cta-light);
    --icon-color: var(--icon-color-light);
    --error-color: var(--error-color-light);
}

[data-theme="dark"] {
    --bg-color: var(--bg-color-dark);
    --text-color: var(--text-color-dark);
    --primary-color: var(--primary-color-dark);
    --secondary-color: var(--secondary-color-dark);
    --accent-color: var(--accent-color-dark);
    --border-color: var(--border-color-dark);
    --card-bg: var(--secondary-color-dark);
    --section-card-bg: var(--secondary-color-dark);
    --section-card-alt-bg: var(--alt-bg-dark);
    --card-shadow: var(--card-shadow-dark);
    --section-card-shadow: var(--section-card-shadow-dark);
    --header-bg: var(--header-bg-dark);
    --footer-bg: var(--footer-bg-dark);
    --ad-bg: var(--ad-bg-dark);
    --ad-border: var(--ad-border-dark);
    --link-color: var(--link-color-dark);
    --link-hover: var(--link-hover-dark);
    --gradient-primary: var(--gradient-primary-dark);
    --gradient-hero: var(--gradient-hero-dark);
    --gradient-cta: var(--gradient-cta-dark);
    --icon-color: var(--icon-color-dark);
    --error-color: var(--error-color-dark);
}

/* --- Global Styles --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font-primary); background-color: var(--bg-color); color: var(--text-color); line-height: 1.7; transition: background-color var(--transition-speed), color var(--transition-speed); display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden; }
main { flex-grow: 1; padding: 1rem 0; }
.container { width: 92%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.tool-page-main .container { max-width: 1280px; }
a { color: var(--link-color); text-decoration: none; transition: color var(--transition-speed), opacity 0.2s ease; }
a:hover, a:focus { color: var(--link-hover); text-decoration: underline; opacity: var(--link-opacity-hover); }
h1, h2, h3, h4 { font-family: var(--font-primary); margin-bottom: 0.7em; line-height: 1.3; color: var(--primary-color); font-weight: 600; }
h1 { font-size: 3rem; font-weight: 700; color: white; text-shadow: 1px 1px 5px rgba(0,0,0,0.4); }
.tool-page-main h1.tool-title { color: var(--primary-color); text-shadow: none; }
h2 { font-size: 2.3rem; text-align: center; margin-bottom: 1.2em; }
h3 { font-size: 1.7rem; color: var(--text-color); font-weight: 600; }
h4 { font-size: 1.05rem; color: var(--primary-color); margin-bottom: 0.4em; font-weight: 600; }
p { margin-bottom: 1.2em; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font-family: inherit; padding: 0.7em 1.5em; border: none; border-radius: 6px; background-color: var(--primary-color); color: white; font-weight: 600; transition: background-color var(--transition-speed), transform 0.2s ease, box-shadow var(--transition-speed); text-align: center; }
button:hover { background-color: var(--link-hover); transform: translateY(-2px); box-shadow: 0 5px 12px rgba(0,0,0,0.15); }

/* --- Header --- */
.site-header { background-color: var(--header-bg); padding: 0.8rem 0; border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 1000; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06); transition: background-color var(--transition-speed), border-color var(--transition-speed); }
.header-container { display: flex; justify-content: space-between; align-items: center; }
.logo a { font-size: 1.6rem; font-weight: 700; color: var(--primary-color); text-decoration: none; }
.logo a:hover { color: var(--link-hover); text-decoration: none; }
.main-nav ul { display: flex; gap: 1.8rem; align-items: center; }
.main-nav a { text-decoration: none; font-weight: 500; padding-bottom: 0.3em; position: relative; color: var(--text-color); transition: color var(--transition-speed); font-size: 1rem; }
.main-nav a:hover, .main-nav a:focus { color: var(--primary-color); text-decoration: none; }
.main-nav a::after { content: ''; position: absolute; bottom: 0px; left: 0; width: 0; height: 2px; background-color: var(--primary-color); transition: width var(--transition-speed); }
.main-nav a:hover::after, .main-nav a:focus::after { width: 100%; }
/* Dropdown Menu */
.dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; top: calc(100% + 12px); left: 0; background-color: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); min-width: 230px; z-index: 1001; padding: 0.8rem 0; opacity: 0; transform: translateY(10px); transition: opacity 0.25s ease, transform 0.25s ease; flex-direction: column; gap: 0; }
@media (min-width: 769px) { .dropdown:hover .dropdown-menu, .dropdown:focus-within .dropdown-menu { display: block; opacity: 1; transform: translateY(0); } }
.dropdown.active .dropdown-menu { display: block; opacity: 1; transform: translateY(0); }
.dropdown-menu li { width: 100%; }
.dropdown-menu a { display: block; padding: 0.7rem 1.4rem; white-space: nowrap; color: var(--text-color); font-size: 0.9rem; }
.dropdown-menu a:hover { background-color: var(--alt-bg-color); color: var(--primary-color); }
.dropdown-menu a::after { display: none; }
/* Theme Toggle Button */
#theme-toggle { background: none; border: 1px solid var(--border-color); font-size: 1rem; cursor: pointer; padding: 0; color: var(--text-color); border-radius: 6px; transition: color var(--transition-speed), transform 0.2s ease, border-color var(--transition-speed), background-color var(--transition-speed); line-height: 1; display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; }
#theme-toggle:hover { transform: scale(1.08) rotate(15deg); color: var(--primary-color); border-color: var(--primary-color); background-color: var(--alt-bg-color); }
#theme-toggle .toggle-icon .fa-moon { display: none; }
[data-theme="dark"] #theme-toggle .toggle-icon .fa-sun { display: none; }
[data-theme="dark"] #theme-toggle .toggle-icon .fa-moon { display: inline-block; }

/* --- Hero Section (Landing Page Only) --- */
#hero { background-image: var(--gradient-hero); padding: 6rem 0; text-align: center; color: #ffffff; position: relative; overflow: hidden; margin-bottom: 3rem; }
#hero::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.2); z-index: 1; }
[data-theme="dark"] #hero::before { background-color: rgba(0, 0, 0, 0.3); }
.hero-content { position: relative; z-index: 2; }
#hero h1 { margin-bottom: 0.4em; font-size: 3.2rem; }
#hero p { font-size: 1.3rem; max-width: 800px; margin: 0 auto 2.2em auto; color: inherit; opacity: 0.95; text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3); font-weight: 300; }
.cta-button { display: inline-block; background-image: var(--gradient-cta); color: #ffffff !important; padding: 1em 2.5em; border-radius: 35px; text-decoration: none; font-weight: 700; font-size: 1.15rem; border: none; box-shadow: 0 5px 18px rgba(0, 0, 0, 0.25); transition: transform var(--transition-speed), box-shadow var(--transition-speed), filter var(--transition-speed); }
.cta-button i { margin-left: 0.6em; font-size: 0.9em; transition: transform 0.3s ease; }
.cta-button:hover { transform: translateY(-4px) scale(1.04); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3); filter: brightness(1.15); text-decoration: none; }
.cta-button:hover i { transform: translateY(3px); }

/* --- Content Sections & Section Card Styling --- */
.content-section { margin-bottom: 3rem; }
.section-card { background-color: var(--section-card-bg, var(--secondary-color-light)); border-radius: 12px; padding: 3rem 2.5rem; box-shadow: var(--section-card-shadow, var(--card-shadow-light)); border: 1px solid var(--border-color); margin-top: 3rem; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.section-card.alt-bg { background-color: var(--section-card-alt-bg, var(--alt-bg-light)); border-color: color-mix(in srgb, var(--border-color) 80%, transparent); }
.section-card h2 { text-align: center; margin-top: 0; margin-bottom: 1.5em; padding-bottom: 0.5em; border-bottom: 1px solid var(--border-color); display: inline-block; position: relative; left: 50%; transform: translateX(-50%); }
.section-card h3 { text-align: left; font-size: 1.5rem; margin-bottom: 1em; margin-top: 2.5em; padding-bottom: 0.4em; border-bottom: 2px solid var(--primary-color); display: inline-block; color: var(--primary-color); }
.section-card > .container > h3:first-child { margin-top: 0; }
.section-card p { max-width: 900px; margin-left: auto; margin-right: auto; margin-bottom: 1.2em; line-height: 1.75; text-align: left; font-size: 1rem; }
.section-card p strong { font-weight: 600; color: var(--primary-color); }
.section-card ul { list-style: none; padding-left: 0; margin-bottom: 1.5em; max-width: 900px; margin-left: auto; margin-right: auto; }
.section-card ul li { position: relative; margin-bottom: 0.8em; padding-left: 2.2rem; line-height: 1.6; font-size: 1rem; }
.section-card ul li .list-icon { position: absolute; left: 0; top: 5px; color: var(--accent-color); font-size: 1.1em; text-align: center; width: 1.5rem; }

/* --- Tool Showcase (Landing Page Only) --- */
.tool-showcase { padding: 4.5rem 0 2rem 0; }
.tool-showcase > .container > h2.section-heading-large { margin-bottom: 0.6em; font-size: 2.5rem; }
.section-description.large-description { text-align: center; margin-bottom: 4em; max-width: 850px; margin-left: auto; margin-right: auto; opacity: 0.85; font-size: 1.15rem; }
.tool-category { margin-bottom: 4.5rem; }
.category-description { margin-bottom: 2.5rem; text-align: center; border-bottom: 1px dashed var(--border-color); padding-bottom: 2.5rem; margin-top: 1rem; }
.category-description h3 { margin-bottom: 0.8em; display: inline-flex; align-items: center; padding-bottom: 0.6em; position: relative; text-align: center; font-size: 1.8rem; color: var(--text-color); border-bottom: none; }
.category-description h3::after { content: ''; position: absolute; left: 50%; transform: translateX(-50%); bottom: 0; width: 80%; height: 3px; background-image: var(--gradient-primary); border-radius: 1.5px; }
.category-description h3 .emoji, .category-description h3 .category-icon { margin-right: 0.7em; font-size: 1em; color: var(--primary-color); vertical-align: middle; width: 1.5em; text-align: center; }
.category-description p { max-width: 900px; margin-left: auto; margin-right: auto; font-size: 1.1rem; opacity: 0.9; text-align: center; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.8rem; }
.tool-card { background-color: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; padding: 1.5rem 1.2rem; text-align: center; box-shadow: var(--card-shadow); transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; display: flex; flex-direction: column; align-items: center; color: var(--text-color); min-height: 175px; }
.tool-card:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.1); border-color: var(--primary-color); text-decoration: none; }
.tool-card h4 { margin-top: 0.8em; margin-bottom: 0.5em; font-size: 1rem; line-height: 1.3; }
.tool-card p { font-size: 0.88rem; opacity: 0.8; flex-grow: 1; margin-bottom: 0; line-height: 1.45; }
.tool-icon { font-size: 1.5rem; width: 60px; height: 60px; line-height: 1; border-radius: 50%; background-image: var(--gradient-primary); color: var(--icon-color); margin-bottom: 0.9rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 8px rgba(0,0,0,0.15); transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease; flex-shrink: 0; }
.tool-icon .fa-a, .tool-icon .fa-b, .tool-icon .fa-1, .tool-icon .fa-2 { margin: 0 1px; font-size: 1.2rem; }
.tool-card:hover .tool-icon { transform: scale(1.1) rotate(5deg); box-shadow: 0 5px 12px rgba(0,0,0,0.2); filter: brightness(1.12); }

/* Why Us Section Styling (Uses .section-card) */
#why-us h2 { margin-bottom: 1em; }
.section-description.less-margin { margin-bottom: 2.5em; font-size: 1.1rem; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2.2rem; max-width: 1150px; margin: 0 auto; }
.feature-item { text-align: center; padding: 1.8rem; background-color: color-mix(in srgb, var(--card-bg) 95%, var(--border-color)); border-radius: 8px; border: 1px solid var(--border-color); box-shadow: var(--card-shadow); transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; }
.feature-item:hover { transform: translateY(-5px); box-shadow: 0 7px 18px rgba(0,0,0,0.1); border-color: var(--primary-color); }
.feature-item h4 { font-size: 1.2rem; margin-bottom: 0.8em; color: var(--primary-color); font-family: var(--font-primary); font-weight: 600; display: flex; align-items: center; justify-content: center; }
.feature-item h4 .emoji, .feature-item h4 .feature-icon { margin-right: 0.6em; font-size: 1.2em; color: var(--accent-color); min-width: 25px; }
.feature-item p { font-size: 0.95rem; opacity: 0.85; max-width: none; margin-left: 0; margin-right: 0; text-align: center; }

/* --- Tool Page Specific Styles --- */
.tool-page-main { padding: 2rem 0 4rem 0; }
.calculator-section { padding: 2.5rem 2rem; margin-bottom: 2.5rem; margin-top: 2rem; /* Uses .section-card */ }
.tool-title { font-size: 2.2rem; text-align: center; margin-bottom: 0.3em; display: flex; align-items: center; justify-content: center; gap: 0.5em; }
.tool-title-icon { font-size: 0.9em; color: var(--primary-color); }
.tool-subtitle { text-align: center; font-size: 1.1rem; opacity: 0.8; margin-bottom: 2rem; max-width: 700px; margin-left: auto; margin-right: auto; }
/* Calculator Interface Styles */
.calculator-interface { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem 2rem; align-items: end; max-width: 800px; margin: 0 auto 2rem auto; }
.input-group { display: flex; flex-direction: column; gap: 0.5rem; }
.input-group.full-width-input { grid-column: 1 / -1; }
.input-group label { font-weight: 600; font-size: 0.95rem; color: var(--text-color); opacity: 0.9; }
.input-group input[type="date"], .input-group input[type="number"], .input-group input[type="text"], .input-group select, .input-group textarea { padding: 0.8em 1em; border: 1px solid var(--border-color); border-radius: 6px; font-size: 1rem; background-color: var(--bg-color); color: var(--text-color); transition: border-color 0.2s ease, box-shadow 0.2s ease; width: 100%; font-family: inherit; }
.input-group textarea { resize: vertical; min-height: 80px; }
.input-group input:focus, .input-group select:focus, .input-group textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 20%, transparent); }
input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.7; transition: opacity 0.2s ease; }
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.8); }
.calculate-button { padding: 0.9em 1.5em; font-size: 1.05rem; font-weight: 600; grid-column: 1 / -1; justify-self: center; min-width: 200px; margin-top: 1rem; }
.calculate-button i { margin-right: 0.5em; }
/* Unit switcher style */
.unit-switcher { margin-bottom: 1.5rem; text-align: center; font-size: 0.95rem;}
.unit-switcher label { margin: 0 0.5rem 0 0.2rem; cursor: pointer; opacity: 0.9;}
.unit-switcher input[type="radio"] { margin-right: 0.1rem; cursor: pointer;}
/* Height group for imperial BMI/Calorie/etc */
.height-imperial-group { display: flex; gap: 0.5rem; align-items: center; }
.height-imperial-group input { flex: 1; }
.height-imperial-group .unit-label { font-size: 0.9em; opacity: 0.8; margin-left: 0.2rem; }
/* Input with Select Unit Style */
.input-with-unit { display: flex; gap: 0.5rem; align-items: center;}
.input-with-unit input { flex-grow: 1; }
.input-with-unit select { flex-shrink: 0; padding: 0.8em 0.5em; }
/* Time Input Split Style */
.time-input-split { display: flex; gap: 0.5rem; align-items: center; }
.time-input-split input { text-align: center; flex: 1; }
.time-input-split label { font-size: 0.9em; opacity: 0.8;}
/* Pace Input Split Style */
.pace-input-split { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap;}
.pace-input-split input { flex: 1 1 50px; text-align: center; }
.pace-input-split label { font-size: 0.9em; opacity: 0.8;}
.pace-input-split span { opacity: 0.8; }
.pace-input-split select { flex: 2 1 100px; margin-left: 0.5rem; }
/* Fieldset for grouping time */
.time-input-fieldset { border: 1px solid var(--border-color); border-radius: 6px; padding: 1rem; margin: 0; grid-column: 1 / -1;}
.time-input-fieldset legend { font-weight: 600; padding: 0 0.5em; font-size: 0.9rem; color: var(--text-color); }
.time-parts { display: flex; gap: 1rem; flex-wrap: wrap;}
.time-parts .input-group.compact-input { flex: 1 1 80px; gap: 0.2rem;}
.time-parts .input-group.compact-input label { font-size: 0.85rem; }
.operator-group { grid-column: 1 / -1; text-align: center; justify-self: center; max-width: 200px; margin-top: 0.5rem; margin-bottom: 0.5rem;}
/* Styles for Multi-Part Calculator Pages */
.calculator-sub-section { border-top: 1px dashed var(--border-color); padding-top: 2rem; margin-top: 2rem; }
.calculator-sub-section:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.calculator-sub-section h4 { text-align: center; margin-bottom: 1.5rem; font-size: 1.2rem; color: var(--text-color); font-weight: 500; }
.calculator-sub-section .calculator-interface { max-width: 700px; margin-bottom: 1.5rem; }
.calculate-button.small-button { padding: 0.7em 1.3em; font-size: 0.95rem; justify-self: start; grid-column: auto; margin-top: 0; }
.calculator-result.mini-result { margin-top: 0; padding: 1rem; font-size: 1rem; min-height: auto; max-width: 700px; }
.calculator-result.mini-result p { margin-bottom: 0; }
/* Calculator Result Area (General) */
.calculator-result { margin-top: 2rem; padding: 1.5rem; border: 1px dashed var(--border-color); border-radius: 8px; background-color: var(--section-card-alt-bg); min-height: 80px; text-align: center; font-size: 1.1rem; line-height: 1.6; max-width: 800px; margin-left: auto; margin-right: auto; }
.calculator-result p { margin-bottom: 0.5em; }
.calculator-result p:last-child { margin-bottom: 0; }
.calculator-result .error { color: var(--error-color); font-weight: bold; }
.calculator-result ul { list-style: none; padding: 0; margin-top: 1rem; font-size: 1rem; opacity: 0.9; }
.calculator-result ul li { margin-bottom: 0.3em; padding-left: 0; text-align: center; }
.result-note { text-align: center; font-size: 0.85rem; opacity: 0.7; margin-top: 1rem; max-width: 800px; margin-left: auto; margin-right: auto; }
/* Amortization Table Style */
.amortization-table-container { margin-top: 2rem; max-width: 900px; margin-left: auto; margin-right: auto; }
.amortization-table-container h3 { text-align: center; margin-bottom: 1rem; }
.table-responsive { overflow-x: auto; }
.amortization-table-container table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.amortization-table-container th, .amortization-table-container td { border: 1px solid var(--border-color); padding: 0.6em 0.8em; text-align: right; }
.amortization-table-container th { background-color: var(--alt-bg-color); font-weight: 600; }
.amortization-table-container tbody tr:nth-child(even) { background-color: var(--alt-bg-color); }
.amortization-table-container tbody tr:hover { background-color: color-mix(in srgb, var(--primary-color) 10%, transparent); }
.amortization-table-container td:nth-child(1), .amortization-table-container td:nth-child(2) { text-align: center; }
/* BMI Chart Info */
.bmi-chart-info { margin-top: 2rem; max-width: 800px; margin-left: auto; margin-right: auto; text-align: center; }
.bmi-chart-info h4 { font-size: 1rem; margin-bottom: 0.8em; }
.bmi-chart-info ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.5rem; margin-bottom: 1rem;}
.bmi-chart-info li { font-size: 0.9rem; }
/* Article Styles */
.tool-article ol { list-style: decimal; margin-left: 1.5rem; margin-bottom: 1.5em; max-width: 850px; margin-left: auto; margin-right: auto; padding-left: 1rem; }
.tool-article ol li { margin-bottom: 0.8em; line-height: 1.6; font-size: 1rem; padding-left: 0; }
.tool-article ul { max-width: 850px; margin-left: auto; margin-right: auto; list-style: none; padding-left: 0; } /* Ensure list icons work */
.tool-article ul li { position: relative; margin-bottom: 0.8em; padding-left: 2.2rem; line-height: 1.6; font-size: 1rem; }
.tool-article ul li .list-icon { position: absolute; left: 0; top: 5px; color: var(--accent-color); font-size: 1.1em; text-align: center; width: 1.5rem; }
/* Tool Page Ad Placeholders */
.ad-placeholder.ad-banner-toolpage { margin-top: 2.5rem; margin-bottom: 2.5rem; max-width: 728px; }
/* GPA Input Row Styles */
.gpa-course-row { display: flex; gap: 1rem; margin-bottom: 0.75rem; align-items: center; flex-wrap: wrap; }
.gpa-course-row input { flex: 1 1 150px; }
.gpa-course-row input.gpa-grade { flex-basis: 100px; flex-grow: 0;}
.gpa-course-row input.gpa-credits { flex-basis: 120px; flex-grow: 0;}
.remove-gpa-row-btn, .remove-grade-row-btn { padding: 0.4em 0.6em; background-color: var(--error-color); border: none; color: white; cursor: pointer; border-radius: 4px; line-height: 1; flex-shrink: 0; margin-left: auto; }
.remove-gpa-row-btn:hover, .remove-grade-row-btn:hover { background-color: color-mix(in srgb, var(--error-color) 80%, black); }
.add-row-button { background-color: var(--accent-color); margin-top: 1rem; display: inline-block; width: auto; padding: 0.6em 1.2em; } /* Style add button */
.add-row-button:hover { background-color: color-mix(in srgb, var(--accent-color) 85%, black); }
.add-row-button i { margin-right: 0.4em; }
.scale-info { font-size: 0.85rem; opacity: 0.7; margin-top: -0.5em; }
/* Tip Calculator Quick Buttons */
.tip-options button { background: var(--alt-bg-color); border: 1px solid var(--border-color); color: var(--text-color); padding: 0.5em 0.8em; margin: 0.1rem; cursor: pointer; border-radius: 4px; transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;}
.tip-options button.active { background-color: var(--primary-color); color: white; border-color: var(--primary-color); font-weight: bold;}
.tip-options { margin-bottom: 0.5rem; margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
/* Random Number List Styling */
.random-results-list { list-style: decimal; margin-left: 2em; font-weight: bold; columns: 2; column-gap: 2em; max-width: 400px; margin: 1em auto 0 auto;}
/* Checklist styles */
.checklist-section { margin-bottom: 2em; }
.checklist-section h3 { border-bottom: 1px solid var(--border-color); padding-bottom: 0.3em; margin-bottom: 1em; font-size: 1.5rem; text-align: left; display: block; position: static; transform: none; border-color: var(--primary-color); color: var(--primary-color); }
.checklist-list { list-style: none; padding-left: 0; }
.checklist-list li { margin-bottom: 0.8em; display: flex; align-items: flex-start; }
.checklist-list input[type="checkbox"] { margin-right: 0.8em; margin-top: 0.3em; width: 1.2em; height: 1.2em; flex-shrink: 0; cursor: pointer;}
.checklist-list label { cursor: pointer; }
.print-button-container { text-align: center; margin-bottom: 2rem; }
/* Panchang styles */
.panchang-details { list-style: none; padding: 0; margin: 1.5rem auto; max-width: 600px; }
.panchang-details li { display: flex; justify-content: space-between; padding: 0.6em 0; border-bottom: 1px dotted var(--border-color); }
.panchang-details li span:first-child { font-weight: 600; color: var(--primary-color); margin-right: 1em; }
.panchang-details li span:last-child { text-align: right; }
#locationInputPanchang { max-width: 500px; margin: 0 auto 1rem auto; }
#useCurrentLocationBtn { margin-top: 0.5em; width: auto; padding: 0.6em 1em; font-size: 0.9rem;}
/* Blood type results */
.bloodtype-results ul { padding-left: 0; list-style: none; text-align: center;}
.bloodtype-results li { display: inline-block; margin: 0.5em 1em; font-weight: bold; font-size: 1.1em; }
/* Moon phase results */
.moon-phase-result { text-align: center; }
.moon-phase-result .phase-icon { font-size: 3rem; margin-bottom: 0.5rem; display: block; }
.moon-phase-result .phase-name { font-size: 1.3rem; font-weight: bold; }
.moon-phase-result .phase-details { font-size: 0.9em; opacity: 0.8; }
/* Legal page styles */
.legal-page h2 { margin-top: 2em; text-align: left; border-bottom: none; display: block; position: static; transform: none; }
.legal-page h3 { margin-top: 1.5em; font-size: 1.3rem; border-bottom: none; display: block; position: static; transform: none;}
.legal-page ul { list-style: disc; padding-left: 2em; max-width: 900px; } /* Use standard bullets */
.legal-page ol { list-style: decimal; padding-left: 2em; max-width: 900px; }


/* --- Ad Placeholders --- */
.ad-placeholder { background-color: var(--ad-bg); border: 1px dashed var(--ad-border); color: var(--text-color); opacity: 0.5; text-align: center; padding: 1rem; margin: 3rem auto; display: flex; align-items: center; justify-content: center; min-height: 90px; border-radius: 6px; transition: background-color var(--transition-speed), border-color var(--transition-speed), color var(--transition-speed); font-size: 0.9rem; }
.ad-placeholder p { margin-bottom: 0; }
.ad-banner-top, .ad-banner-bottom { max-width: 970px; min-height: 90px; }
.ad-box-mid { max-width: 300px; min-height: 250px; margin-left: auto; margin-right: auto; }
.ad-box-footer { max-width: 300px; min-height: 100px; margin-top: 1.5rem; max-width: 100%; }

/* --- Footer --- */
.site-footer { background-color: var(--footer-bg); color: var(--text-color); padding: 3.5rem 0 1.5rem 0; margin-top: 1rem; border-top: 2px solid var(--primary-color); transition: background-color var(--transition-speed), border-color var(--transition-speed); position: relative; }
.footer-columns { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2.5rem; margin-bottom: 3rem; }
.footer-col { flex: 1; min-width: 200px; }
.footer-col h4 { color: var(--text-color); margin-bottom: 1.2em; font-size: 1.1rem; font-family: var(--font-primary); font-weight: 600; opacity: 0.95; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 0.6em; }
.footer-col a { color: var(--text-color); opacity: 0.8; transition: opacity var(--transition-speed), color var(--transition-speed); font-size: 0.9rem; }
.footer-col a:hover { opacity: 1; color: var(--primary-color); text-decoration: underline; }
.social-links a { display: inline-flex; align-items: center; justify-content: center; margin: 0 0.5rem; font-size: 1.1rem; opacity: 0.8; width: 40px; height: 40px; border: 1px solid var(--border-color); border-radius: 50%; transition: opacity var(--transition-speed), color var(--transition-speed), border-color var(--transition-speed), background-color var(--transition-speed), transform 0.2s ease; }
.social-links a:hover { opacity: 1; color: var(--icon-color); border-color: var(--primary-color); background-color: var(--primary-color); text-decoration: none; transform: scale(1.1) translateY(-2px); }
.footer-bottom { border-top: 1px solid var(--border-color); padding-top: 1.8rem; text-align: center; font-size: 0.9rem; opacity: 0.75; }
.footer-bottom p { margin-bottom: 0.5em; }
.attribution { font-weight: 500; }
.attribution::before { content: "Developed by "; }

/* --- Responsiveness --- */
@media (max-width: 1200px) { .tool-grid { grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); } .container { width: 94%; } .section-card { padding: 2.5rem 2rem;} .random-results-list { columns: 3; max-width: 700px; }}
@media (max-width: 992px) { h1 { font-size: 2.6rem; } h2 { font-size: 2.1rem; } .section-heading-large { font-size: 2.3rem; } #hero { padding: 5rem 0; } .tool-grid { grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 1.5rem; } .footer-columns { gap: 2rem; } .features-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.8rem; } .main-nav ul { gap: 1.5rem; } .content-section p, .section-card p, .section-card ul li, .tool-article ol li { font-size: 0.95rem; } .section-card { padding: 2rem 1.5rem;} }
@media (max-width: 768px) {
    html { font-size: 15.5px; }
    .header-container { flex-wrap: wrap; justify-content: space-between; } .logo { width: auto; text-align: left; margin-bottom: 0; font-size: 1.5rem; }
    .main-nav { order: 3; width: 100%; margin-top: 1rem; border-top: 1px solid var(--border-color); padding-top: 1rem; }
    .main-nav ul { justify-content: center; gap: 1rem; flex-wrap: wrap; } #theme-toggle { order: 2; }
    .dropdown > a:first-child::after { content: ' ▼'; font-size: 0.7em; margin-left: 4px; display: inline-block; }
    .dropdown-menu { width: 100%; position: static; box-shadow: none; border: none; background: transparent; padding: 0.5rem 0 0 1rem; margin-top: 0.5rem; border-top: 1px dashed var(--border-color); transform: none !important; opacity: 1 !important; }
    #hero { padding: 4rem 0; } #hero h1 { font-size: 2.4rem; } #hero p { font-size: 1.15rem; } .cta-button { padding: 0.9em 2em; font-size: 1.1rem; }
    .section-card { padding: 2rem 1.5rem; margin-top: 2rem; margin-bottom: 2rem;}
    .content-section p, .section-card p, .section-card ul li, .tool-article ol li { text-align: left; font-size: 0.95rem; }
    .category-description h3 { text-align: left; display: block; font-size: 1.6rem; }
    .category-description h3::after { left: 0; transform: none; width: 60%; } .category-description p { text-align: left; font-size: 1rem;}
    .section-card h2 { font-size: 2rem; } .section-card h3 { font-size: 1.4rem; }
    .tool-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
    .tool-card { padding: 1.3rem; min-height: auto; } .tool-icon { width: 55px; height: 55px; font-size: 1.4rem;} .tool-card h4 { font-size: 0.95rem; } .tool-card p { font-size: 0.85rem; }
    .features-grid { grid-template-columns: 1fr; }
    .footer-columns { flex-direction: column; text-align: center; align-items: center; }
    .footer-col { min-width: auto; margin-bottom: 2rem; width: 90%; }
    .social-links { margin-bottom: 1.5rem; display: flex; justify-content: center; gap: 1rem; } .social-links a { margin: 0;}
    .ad-box-footer { margin-left: auto; margin-right: auto; }
    .content-section ul, .section-card ul, .tool-article ol { padding-left: 0;}
    .content-section ul li, .section-card ul li { padding-left: 2rem; }
    .content-section ul li .list-icon, .section-card ul li .list-icon { left: 0; }
    .tool-article ol { margin-left: 1rem; padding-left: 1rem; } .tool-article ol li { padding-left: 0; }
    .calculator-interface { grid-template-columns: 1fr; gap: 1rem; }
    .calculate-button { width: 100%; justify-self: stretch; }
    .calculate-button.small-button { margin-top: 0.5rem; justify-self: stretch; grid-column: 1 / -1; }
    .tool-title { font-size: 1.8rem; } .tool-subtitle { font-size: 1rem; } .calculator-result { font-size: 1rem;}
    .time-parts { flex-direction: column; gap: 0.8rem; align-items: stretch;}
    .time-parts .input-group.compact-input { flex-basis: auto; }
    .gpa-course-row { flex-wrap: wrap; }
    .gpa-course-row input { flex-basis: calc(50% - 1rem); }
    .remove-gpa-row-btn, .remove-grade-row-btn { margin-left: 0; order: 4; flex-basis: auto;}
    .gpa-course-row input.gpa-grade { order: 2; } .gpa-course-row input.gpa-credits { order: 3; } .gpa-course-row input.gpa-item-name { flex-basis: 100%; order: 1;}
    .random-results-list { columns: 1; max-width: 100%; margin-left: 1.5em;}
}
@media (max-width: 480px) {
    .container { width: 95%; padding: 0 15px; }
    .main-nav ul { gap: 0.8rem; } .main-nav a { font-size: 0.95rem; }
    #hero h1 { font-size: 2rem; } #hero p { font-size: 1.05rem; }
    .section-heading-large { font-size: 2rem; } .section-description.large-description { font-size: 1.05rem; }
    .tool-grid { grid-template-columns: 1fr; }
    .footer-col h4 { font-size: 1.05rem; } .footer-col a { font-size: 0.9rem; }
    .section-card { padding: 1.5rem 1rem;}
    .category-description h3 { font-size: 1.5rem; }
    .section-card h2 { font-size: 1.8rem; } .section-card h3 { font-size: 1.3rem; }
    .pace-input-split input { flex-basis: 40px;} /* Tighter pace inputs */
    .pace-input-split select { flex-basis: 100px;}
}

/* Print styles for checklists */
@media print {
    .checklist-list input[type="checkbox"] { appearance: none; -webkit-appearance: none; border: 1px solid #666; width: 1em; height: 1em; vertical-align: middle; margin-top: 0.1em;}
    .checklist-list input[type="checkbox"]:checked::before { content: '✔'; display: block; text-align: center; line-height: 0.9em; color: #333;}
    .site-header, .site-footer, .ad-placeholder, .print-button-container, .tool-subtitle, .section-card>h1:not(.tool-title), .section-card > p:first-of-type, footer, header, .content-section.section-card > .container > h2:not(.checklist-title) { display: none !important; }
    body { margin: 0.75in; font-size: 11pt; color: #000 !important; background-color: #fff !important;} /* Ensure print colors */
    .calculator-section.section-card, .content-section.section-card { box-shadow: none; border: none; padding: 0; margin: 0; background-color: transparent !important;}
    h1.tool-title, h3.checklist-title { font-size: 1.4rem; text-align: left; margin-bottom: 1rem; border-bottom: 1px solid #ccc; color: #000 !important; }
    a { text-decoration: none; color: inherit !important; }
    .checklist-section h3 { font-size: 1.2rem; }
    .checklist-list li { margin-bottom: 0.5em;}
    /* Ensure dark mode colors don't interfere */
     * { color: #000 !important; background-color: transparent !important; }
}