/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@400;600;700;900&family=Montserrat:wght@400;600;700;800&display=swap');

:root {
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body {
    font-family: var(--font-body);
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-family: var(--font-heading);
}

/* Shared styles for Tools and Calculators */

/* Glass panel */
.glass-panel {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

.fi {
    width: 1.3em;
    height: 1em;
    line-height: 1;
    vertical-align: middle;
}

[data-bs-theme="dark"] .glass-panel {
    background: rgba(33, 37, 41, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Premium Navbar */
.navbar-glass {
    transition: all 0.3s ease;
    background: transparent;
    border-bottom: 1px solid transparent;
    overflow: visible !important;
    z-index: 1050 !important; /* Above subnav (1020) */
}

.navbar-glass .container,
.navbar-glass .navbar-collapse {
    overflow: visible !important;
}

/* Explicitly remove any rogue masks or pseudo-elements in the header */
.navbar-glass::after,
.navbar-glass::before,
.navbar-glass .container::after,
.navbar-glass .container::before,
.right-controls::after,
.right-controls::before {
    content: none !important;
    display: none !important;
}

.right-controls {
    flex-wrap: nowrap !important;
}

.navbar-glass.scrolled {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Ensure the language switcher doesn't touch the edge */
.navbar-glass .container {
    padding-right: 1rem;
}

.nav-link.dropdown-toggle {
    color: inherit !important; /* Prevent accidental white-out */
}

.dropdown-menu {
    z-index: 1060 !important;
}

/* Ensure no masks or clipping in the header */
.navbar-glass::after,
.navbar-glass::before {
    content: none !important;
    display: none !important;
}

[data-bs-theme="dark"] .navbar-glass.scrolled {
    background: rgba(33, 37, 41, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-link {
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--bs-primary) !important;
}

/* Typography Utilities */
.tracking-wider { letter-spacing: 0.1em; }
.fw-black { font-weight: 900; }
.font-brand { font-family: 'Montserrat', sans-serif; font-weight: 800; letter-spacing: -0.02em; }
.nav-divider {
    width: 1px;
    height: 24px;
    background: rgba(0, 0, 0, 0.1);
    margin: 0 1rem;
    align-self: center;
}
[data-bs-theme="dark"] .nav-divider {
    background: rgba(255, 255, 255, 0.15);
}

/* Subnav Improvements */
.subnav-row {
    background: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] .subnav-row {
    background: transparent;
    border-bottom: none;
}

.subnav-glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .subnav-glass {
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.subnav-glass .nav {
    position: relative;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overflow-x: auto;
    overflow-y: visible;
    padding-top: 10px;
    padding-bottom: 20px; /* Increased padding (5px more) to avoid pill clipping */
}

.subnav-glass .nav::-webkit-scrollbar {
    display: none;
}

.navbar-nav {
    position: relative;
}

.nav-glider {
    position: absolute;
    height: 34px;
    background: rgba(0, 0, 0, 0.05); /* Subtle spotlight for light mode */
    border-radius: 50px;
    z-index: 1;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    opacity: 0;
}

[data-bs-theme="dark"] .nav-glider {
    background: rgba(255, 255, 255, 0.15) !important; /* Translucent spotlight for Dark Mode */
    box-shadow: none !important;
}

.navbar-nav .nav-link {
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

/* Primary Nav Active State (Underline) */
.navbar-nav .nav-link.active {
    color: var(--bs-primary) !important;
    font-weight: 800 !important;
    background: transparent !important;
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 1rem;
    right: 1rem;
    height: 3px;
    background-color: var(--bs-primary);
    border-radius: 3px;
}

/* Secondary Nav (Sub-nav) Links */
.subnav-glass .nav-link {
    color: #4a4a4a; /* High-contrast dark gray for Light Mode */
    transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
    z-index: 2;
    position: relative;
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
    display: flex;
    align-items: center;
}

[data-bs-theme="dark"] .subnav-glass .nav-link {
    color: #c0c0c0; /* Visible gray in Dark Mode */
}

/* 
   Active State: High Contrast White 
   Applied to .active in both themes for a solid prominent look.
*/
.subnav-glass .nav-link.active {
    color: #ffffff !important;
    background-color: #1a1a1a !important; /* Static dark pill for Light Mode */
    box-shadow: none !important;
}

[data-bs-theme="dark"] .subnav-glass .nav-link.active {
    background-color: var(--bs-primary) !important; /* Static blue pill for Dark Mode */
}

/* 
   Hover/Glider Contrast Fix:
   - Light Theme: Hovered non-active text remains dark (#212529) even with the subtle spotlight.
   - Dark Theme: Hovered text turns white for clarity against the translucent spotlight.
*/
.subnav-glass .nav-link:hover:not(.active) {
    color: #212529 !important; /* Stay dark in Light Mode */
}

[data-bs-theme="dark"] .subnav-glass .nav-link.has-glider {
    color: #ffffff !important; /* Turn white in Dark Mode spotlight */
}

.subnav-glass .nav-link.text-secondary:hover:not(.has-glider) {
    color: var(--bs-body-color) !important;
}

/* Light subtle background */
.bg-light-subtle {
    background-color: rgba(248, 249, 250, 0.5) !important;
}

[data-bs-theme="dark"] .bg-light-subtle {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Fix for input-group-text bg-light and bg-white in dark mode across calculators */
[data-bs-theme="dark"] .input-group-text.bg-light,
[data-bs-theme="dark"] .input-group-text.bg-white {
    background-color: #2b3035 !important;
    border-color: #495057 !important;
    color: #dee2e6 !important;
}

/* Print styles */
@media print {
    body * {
        visibility: hidden;
    }

    .glass-panel,
    .glass-panel * {
        visibility: visible;
    }

    .glass-panel {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: white !important;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }

    .btn,
    form.d-print-none {
        display: none !important;
    }
}
/* Extracted from base.html */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

.footer {
  background-color: #f8f9fa;
  padding: 2.5rem 0 1.5rem;
  margin-top: auto;
  border-top: 1px solid #dee2e6;
}

[data-bs-theme="dark"] .footer {
  background-color: #212529;
  border-top: 1px solid #373b3e;
}

.footer-link {
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--bs-primary) !important;
  text-decoration: none !important;
}

.footer-social-link {
  transition: color 0.2s ease, transform 0.2s ease;
}

.footer-social-link:hover {
  color: var(--bs-primary) !important;
  transform: translateY(-2px);
}

.footer-email-input {
  max-width: 250px;
}

@media (max-width: 575.98px) {
  .footer-email-input {
    max-width: 100%;
  }
}

.social-share-link {
  text-decoration: none;
  transition: opacity 0.2s ease-in-out;
}

.social-share-link:hover {
  opacity: 0.7;
}

/* Extracted Unified Styles */
.text-gradient {
    background: linear-gradient(45deg, var(--bs-primary), #00d2ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Blog Post Styles */
.blog-content { font-size: 1.15rem; line-height: 1.8; }
.blog-content h2 { font-weight: 800; margin-top: 2.5rem; margin-bottom: 1.5rem; }
.blog-content h3 { font-weight: 700; margin-top: 2rem; margin-bottom: 1rem; }
.blog-content p { margin-bottom: 1.5rem; }
.blog-content img { max-width: 100%; height: auto; border-radius: 1rem; margin: 2rem 0; box-shadow: 0 1rem 3rem rgba(0,0,0,0.1); }
.blog-featured-img { max-height: 200px; width: auto; object-fit: contain; }
.blog-content blockquote { padding: 1.5rem 2rem; background: var(--bs-light-bg-subtle); border-left: 5px solid var(--bs-primary); border-radius: 0.5rem; font-style: italic; margin: 2rem 0; }

/* Donation Card Styles */
.bg-pink-light { background-color: rgba(255, 105, 180, 0.15); }
.text-pink { color: #FF69B4; }
.btn-pink { background-color: #FF69B4; border-color: #FF69B4; color: white; }
.btn-pink:hover { background-color: #ff4da6; border-color: #ff4da6; color: white; box-shadow: 0 4px 15px rgba(255, 105, 180, 0.4); }
.donation-card { border-left: 4px solid #FF69B4 !important; }

/* Card & Interactive Utilities */
.transition-transform { transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.hover-up:hover { transform: translateY(-8px); box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, .12) !important; }

/* Line Clamp Utilities */
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; line-clamp: 1; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-clamp: 2; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-clamp: 3; }

/* Icon Box Animation */
.icon-box { transition: background-color 0.3s ease; }
.hover-up:hover .icon-box { background-color: var(--bs-primary-bg-subtle) !important; }

/* Layout & Transform Overrides */
.min-vh-50 { min-height: 50vh; }
.transform-rotate-3 { transform: rotate(3deg); }
.transform-rotate--6 { transform: rotate(-6deg); }
.transform-rotate-12 { transform: rotate(12deg); }
