/* ============================================================
   FinCalc Pro — Custom Stylesheet
   Premium dark-mode financial calculator design
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
    --fc-primary: #0F4C3A; /* Deep forest green */
    --fc-primary-dark: #0a3628;
    --fc-primary-light: #1A7056;
    --fc-accent: #C28E0E; /* Elegant gold/mustard */
    --fc-accent-dark: #9F720A;
    --fc-bg-main: #FDFBF7; /* Warm ivory */
    --fc-bg-card: #FFFFFF;
    --fc-bg-card-hover: #F8F6F0;
    --fc-bg-surface: #F5F2E9;
    --fc-text: #2C3330; /* Dark slate */
    --fc-text-muted: #596560;
    --fc-text-heading: #13221C;
    --fc-border: #D1D5D2;
    --fc-success: #1A7056;
    --fc-warning: #C28E0E;
    --fc-danger: #D94848;
    --fc-gradient: linear-gradient(135deg, var(--fc-primary) 0%, var(--fc-primary-light) 100%);
    --fc-radius: 8px;
    --fc-radius-sm: 4px;
    --fc-shadow: 4px 4px 0px rgba(15, 76, 58, 0.1);
    --fc-shadow-lg: 8px 8px 0px rgba(15, 76, 58, 0.15);
    --fc-transition: all 0.25s ease-in-out;
    --fc-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --fc-font-serif: 'Fraunces', Georgia, serif;
}

/* ---------- Base Styles ---------- */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--fc-font-sans);
    background-color: var(--fc-bg-main);
    color: var(--fc-text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--fc-text-heading);
    font-family: var(--fc-font-serif);
    font-weight: 600;
}

a {
    color: var(--fc-primary);
    text-decoration: none;
    transition: var(--fc-transition);
}

.text-muted {
    color: var(--fc-text-muted) !important;
}

a:hover {
    color: var(--fc-accent);
}

main {
    flex: 1;
}

::selection {
    background: var(--fc-primary);
    color: #fff;
}

/* ---------- Navbar ---------- */
.bg-dark-custom {
    background: #FFFFFF !important;
    border-bottom: 1px solid var(--fc-border);
    padding: 0.75rem 0;
}

.brand-icon {
    font-size: 1.5rem;
    color: var(--fc-accent);
}

.brand-text {
    font-size: 1.4rem;
    font-family: var(--fc-font-serif);
    font-weight: 700;
    color: var(--fc-primary);
    letter-spacing: -0.5px;
}

.brand-accent {
    color: var(--fc-accent);
}

.navbar-nav .nav-link {
    color: var(--fc-text) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--fc-radius-sm);
    transition: var(--fc-transition);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--fc-primary) !important;
    background: var(--fc-bg-surface);
}

.dropdown-item.active, .dropdown-item:active {
    background-color: var(--fc-primary);
    color: #fff;
}
.dropdown-item:hover {
    background-color: var(--fc-bg-surface);
    color: var(--fc-primary);
}

/* ---------- Mobile Hamburger Menu ---------- */
.navbar-toggler {
    color: var(--fc-primary);
    transition: var(--fc-transition);
}

.navbar-toggler:focus {
    box-shadow: none;
    outline: 2px solid var(--fc-primary);
    outline-offset: 2px;
}

.hamburger-icon {
    display: block;
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        background: var(--fc-bg-card);
        border: 1px solid var(--fc-border);
        border-radius: var(--fc-radius);
        margin-top: 0.75rem;
        padding: 1rem;
        box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    }

    .navbar-nav .nav-link {
        padding: 0.65rem 1rem !important;
        border-radius: var(--fc-radius-sm);
        margin-bottom: 0.15rem;
    }

    .navbar-nav .nav-link:hover {
        background: var(--fc-bg-surface);
    }

    .navbar-nav .dropdown-menu {
        border: none;
        box-shadow: none;
        padding-left: 1rem;
    }
}

/* ---------- Hero Section ---------- */
.hero-section {
    background: var(--fc-bg-main);
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--fc-border);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40%;
    height: 100%;
    background: var(--fc-bg-surface);
    pointer-events: none;
    z-index: 0;
    clip-path: polygon(20% 0, 100% 0, 100% 100%, 0% 100%);
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.min-vh-60 {
    min-height: 60vh;
}

.hero-title {
    font-family: var(--fc-font-serif);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--fc-primary);
}

.hero-accent {
    display: inline-block;
    color: var(--fc-accent);
    font-style: italic;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--fc-text-muted);
    line-height: 1.8;
    margin-bottom: 2rem;
    max-width: 520px;
}

.hero-actions .btn-primary {
    background: var(--fc-primary);
    color: #fff;
    border: none;
    padding: 0.8rem 2rem;
    font-weight: 600;
    border-radius: var(--fc-radius-sm);
    box-shadow: var(--fc-shadow);
    transition: var(--fc-transition);
}

.hero-actions .btn-primary:hover {
    transform: translateY(-2px) translateX(-2px);
    box-shadow: var(--fc-shadow-lg);
    background: var(--fc-primary-light);
}

.hero-actions .btn-outline-light {
    border-color: var(--fc-border);
    color: var(--fc-text);
    background: #fff;
    padding: 0.8rem 2rem;
    font-weight: 600;
    border-radius: var(--fc-radius-sm);
    box-shadow: 2px 2px 0px rgba(0,0,0,0.05);
}

.hero-actions .btn-outline-light:hover {
    background: var(--fc-bg-surface);
    border-color: var(--fc-border);
    transform: translateY(-1px);
}

.hero-visual {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-left: 2rem;
}

.hero-card {
    background: var(--fc-bg-card);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    padding: 1.2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--fc-transition);
    animation: fadeSlideIn 0.6s ease-out forwards;
    opacity: 0;
}

.hero-card:nth-child(1) { animation-delay: 0.1s; }
.hero-card:nth-child(2) { animation-delay: 0.3s; }
.hero-card:nth-child(3) { animation-delay: 0.5s; }

.hero-card:hover {
    border-color: var(--fc-primary);
    transform: translateX(8px);
}

.hero-card i {
    font-size: 1.5rem;
    color: var(--fc-accent);
}

.hero-card span {
    font-weight: 600;
    font-size: 1.05rem;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ---------- Section Styles ---------- */
.section-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.section-subtitle {
    color: var(--fc-text-muted);
    font-size: 1.1rem;
}

.page-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
}

.page-section {
    min-height: 60vh;
}

/* ---------- Calculator Cards ---------- */
.calculator-card {
    background: var(--fc-bg-card);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    transition: var(--fc-transition);
    overflow: hidden;
    position: relative;
    box-shadow: var(--fc-shadow);
}

.calculator-card:hover {
    transform: translateY(-4px);
    border-color: var(--fc-primary);
    box-shadow: var(--fc-shadow-lg);
}

.calc-card-icon {
    width: 48px;
    height: 48px;
    background: var(--fc-bg-surface);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.calc-card-icon i {
    font-size: 1.3rem;
    color: var(--fc-primary);
}

.calc-card-category {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--fc-accent-dark);
    margin-bottom: 0.5rem;
}

.calc-card-title {
    font-size: 1.25rem;
    font-family: var(--fc-font-serif);
    font-weight: 700;
    color: var(--fc-text-heading);
    margin-bottom: 0.5rem;
}

.calc-card-desc {
    color: var(--fc-text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.calc-card-link {
    color: var(--fc-primary);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--fc-transition);
}

.calculator-card:hover .calc-card-link {
    color: var(--fc-accent);
}

.calculator-card:hover .calc-card-link i {
    transform: translateX(4px);
}

.calc-card-link i {
    transition: var(--fc-transition);
}

/* ---------- Features Section ---------- */
.features-section {
    background: var(--fc-bg-surface);
}

.feature-item {
    padding: 2rem;
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: var(--fc-bg-card);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    box-shadow: var(--fc-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.feature-icon i {
    font-size: 1.5rem;
    color: var(--fc-primary);
}

.feature-item h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.feature-item p {
    color: var(--fc-text-muted);
    font-size: 0.95rem;
}

/* ---------- Calculator Widget ---------- */
.calc-widget-card {
    background: var(--fc-bg-card);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    padding: 2rem;
    box-shadow: var(--fc-shadow);
}

.calc-widget-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--fc-border);
}

.calc-widget-title i {
    color: var(--fc-primary);
}

/* ---------- Form Controls ---------- */
.form-label {
    color: var(--fc-text);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.form-control,
.form-select {
    background: #FFFFFF;
    border: 1px solid var(--fc-border);
    color: var(--fc-text);
    border-radius: var(--fc-radius-sm);
    padding: 0.7rem 1rem;
    transition: var(--fc-transition);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.form-control:focus,
.form-select:focus {
    background: #FFFFFF;
    border-color: var(--fc-primary);
    color: var(--fc-text);
    box-shadow: 0 0 0 3px rgba(15, 76, 58, 0.15);
}

.form-control::placeholder {
    color: var(--fc-text-muted);
}

.form-text {
    color: var(--fc-text-muted);
    font-size: 0.8rem;
}

.btn-primary {
    background: var(--fc-primary);
    color: #fff;
    border: none;
    font-weight: 600;
    border-radius: var(--fc-radius-sm);
    box-shadow: var(--fc-shadow);
    transition: var(--fc-transition);
}

.btn-primary:hover {
    transform: translateY(-2px) translateX(-2px);
    box-shadow: var(--fc-shadow-lg);
    background: var(--fc-primary-light);
}

.btn-outline-primary {
    color: var(--fc-primary);
    border-color: var(--fc-primary);
    border-radius: var(--fc-radius-sm);
    font-weight: 600;
}

.btn-outline-primary:hover {
    background: var(--fc-primary);
    border-color: var(--fc-primary);
    color: #fff;
}

/* ---------- Results ---------- */
.calc-results {
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--fc-accent);
}

.result-card {
    background: var(--fc-bg-main);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    padding: 1.25rem;
    text-align: center;
}

.result-card-primary {
    border: 2px solid var(--fc-primary);
    background: var(--fc-bg-surface);
}

.result-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--fc-text-muted);
    margin-bottom: 0.5rem;
}

.result-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--fc-text-heading);
}

.result-card-primary .result-value {
    color: var(--fc-primary);
}

.result-card-sm {
    background: var(--fc-bg-main);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius-sm);
    padding: 1rem;
    text-align: center;
}

.result-card-sm .result-value {
    font-size: 1.1rem;
}

/* ---------- Tables ---------- */
.calc-table {
    background: var(--fc-bg-card);
    color: var(--fc-text);
    border-radius: var(--fc-radius);
    overflow: hidden;
    font-size: 0.9rem;
}

.calc-table thead th {
    background: var(--fc-bg-surface);
    color: var(--fc-text-heading);
    font-weight: 600;
    border-bottom: 2px solid var(--fc-primary);
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calc-table td {
    padding: 0.7rem 1rem;
    border-color: var(--fc-border);
    vertical-align: middle;
}

.calc-table .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: var(--fc-bg-surface);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-bg-type: var(--fc-bg-surface);
    color: var(--fc-text);
}

.table-striped > tbody > tr:nth-of-type(even) > * {
    color: var(--fc-text);
}

.table-hover > tbody > tr:hover > * {
    --bs-table-bg-state: rgba(15, 76, 58, 0.08);
    color: var(--fc-text);
}

/* ---------- Category Title ---------- */
.category-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--fc-border);
}

.category-title i {
    color: var(--fc-primary);
}

/* ---------- Calculator Detail Page ---------- */
.calculator-title {
    font-family: var(--fc-font-serif);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--fc-primary);
}

.calculator-description {
    font-size: 1.05rem;
}

/* ---------- Article Content ---------- */
.calculator-article {
    background: var(--fc-bg-card);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    padding: 2rem;
}

.calculator-article h2 {
    font-family: var(--fc-font-serif);
    font-size: 1.8rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--fc-border);
}

.calculator-article h2:first-child {
    margin-top: 0;
}

.calculator-article h3 {
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.calculator-article p {
    margin-bottom: 1rem;
    color: var(--fc-text);
    line-height: 1.8;
}

.calculator-article ul,
.calculator-article ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.calculator-article li {
    margin-bottom: 0.5rem;
    color: var(--fc-text);
}

.calculator-article strong {
    color: var(--fc-text-heading);
}

.calculator-article code {
    background: var(--fc-bg-surface);
    color: var(--fc-primary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ---------- FAQs ---------- */
.calculator-faqs .accordion-item {
    background: var(--fc-bg-card);
    border: 1px solid var(--fc-border);
    margin-bottom: 0.5rem;
    border-radius: var(--fc-radius-sm) !important;
    overflow: hidden;
}

.calculator-faqs .accordion-button {
    background: var(--fc-bg-card);
    color: var(--fc-text-heading);
    font-weight: 600;
    font-size: 1rem;
    padding: 1rem 1.25rem;
    box-shadow: none;
}

.calculator-faqs .accordion-button:not(.collapsed) {
    background: var(--fc-bg-surface);
    color: var(--fc-primary);
}

.calculator-faqs .accordion-button::after {
    filter: invert(0);
}

.calculator-faqs .accordion-body {
    color: var(--fc-text);
    line-height: 1.7;
    padding: 1rem 1.25rem;
}

/* ---------- Sidebar ---------- */
.sidebar-widget {
    background: var(--fc-bg-card);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--fc-border);
}

.related-calculators li {
    margin-bottom: 0.75rem;
}

.related-calculators a {
    color: var(--fc-text-muted);
    font-weight: 500;
    transition: var(--fc-transition);
    display: flex;
    align-items: center;
}

.related-calculators a:hover {
    color: var(--fc-primary);
    padding-left: 4px;
}

/* ---------- Content Body (legal pages, about) ---------- */
.content-body h2 {
    font-family: var(--fc-font-serif);
    font-size: 1.6rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.content-body h3 {
    font-family: var(--fc-font-serif);
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.content-body p,
.content-body li {
    color: var(--fc-text);
    line-height: 1.8;
}

.legal-content {
    background: var(--fc-bg-card);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    padding: 2rem;
}

/* ---------- Value Cards (About page) ---------- */
.value-card {
    background: var(--fc-bg-card);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    padding: 1.5rem;
    text-align: center;
    transition: var(--fc-transition);
}

.value-card:hover {
    border-color: var(--fc-primary);
    transform: translateY(-2px);
}

.value-card i {
    font-size: 2rem;
    color: var(--fc-primary);
    margin-bottom: 0.75rem;
    display: block;
}

.value-card h5 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.value-card p {
    color: var(--fc-text-muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* ---------- Contact Form ---------- */
.contact-form .form-control:focus {
    border-color: var(--fc-primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.25);
}

/* ---------- Success Icon ---------- */
.success-icon i {
    font-size: 4rem;
    color: var(--fc-accent);
}

/* ---------- Breadcrumbs ---------- */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.breadcrumb-item a {
    color: var(--fc-text-muted);
}

.breadcrumb-item a:hover {
    color: var(--fc-primary-light);
}

.breadcrumb-item.active {
    color: var(--fc-text);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--fc-text-muted);
}

/* ---------- Footer ---------- */
.footer-section {
    background: var(--fc-bg-surface);
    border-top: 1px solid var(--fc-border);
}

.footer-heading {
    color: var(--fc-text-heading);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.footer-text {
    color: var(--fc-text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--fc-text-muted);
    font-size: 0.9rem;
    transition: var(--fc-transition);
}

.footer-links a:hover {
    color: var(--fc-primary-light);
    padding-left: 4px;
}

.footer-divider {
    border-color: var(--fc-border);
    opacity: 0.5;
}

.footer-copyright {
    color: var(--fc-text-muted);
    font-size: 0.85rem;
}

/* ---------- Cookie Consent ---------- */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--fc-bg-card);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--fc-border);
    padding: 1rem 0;
    animation: slideUp 0.5s ease-out;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.cookie-consent-text p {
    color: var(--fc-text);
    font-size: 0.9rem;
    margin-bottom: 0;
}

.cookie-link {
    color: var(--fc-primary) !important;
    text-decoration: underline !important;
    font-weight: 500;
}

/* ---------- Ad Slots ---------- */
.ad-slot {
    text-align: center;
    min-height: 50px;
}

/* ---------- Calculator Disclaimer ---------- */
.calculator-disclaimer {
    background: rgba(255, 181, 71, 0.08);
    border: 1px solid rgba(255, 181, 71, 0.2);
    border-radius: var(--fc-radius-sm);
    padding: 1rem 1.25rem;
}

/* ---------- Alert Override ---------- */
.alert-warning {
    background: rgba(255, 181, 71, 0.1);
    border-color: rgba(255, 181, 71, 0.3);
    color: var(--fc-warning);
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .hero-section {
        padding: 3rem 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .calc-widget-card {
        padding: 1.5rem;
    }

    .calculator-article {
        padding: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .hero-section {
        padding: 2rem 0;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .result-value {
        font-size: 1.2rem;
    }

    .calc-widget-card {
        padding: 1rem;
    }

    .page-title {
        font-size: 1.6rem;
    }
}
