:root {
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --accent-blue: #0d6efd;
    --accent-hover: #0b5ed7;
    --heading-dark: #111827;
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 12px 28px rgba(15, 23, 42, 0.08);
    --radius-md: 18px;
    --radius-lg: 22px;
}

/* ===== Base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background-color: var(--bg-color);
    font-family: var(--font-sans);
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    line-height: 1.6;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
}

/* ===== Layout ===== */
.main-container {
    width: 100%;
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
}

.container,
.container-fluid,
.main-container {
    padding-left: 20px;
    padding-right: 20px;
}

/* ===== Navbar ===== */
.navbar {
    background: #ffffff !important;
    border-bottom: 1px solid rgba(229, 231, 235, 0.85);
    min-height: 74px;
}

.navbar .container.main-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    font-weight: 800 !important;
    font-size: 2rem !important;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.navbar-brand span {
    color: var(--accent-blue) !important;
}

.navbar-toggler {
    padding: 0.4rem 0.55rem;
    box-shadow: none !important;
}

.navbar-toggler:focus {
    box-shadow: none !important;
}

.nav-link {
    color: var(--text-dark) !important;
    font-weight: 600;
    transition: color 0.25s ease;
}

.nav-link:hover,
.nav-link:focus {
    color: var(--accent-blue) !important;
}

/* ===== Hero ===== */
.hero-section {
    padding: 4.5rem 0 2.75rem;
}

.hero-title {
    color: var(--heading-dark);
    font-size: 3rem;
    line-height: 1.08;
    letter-spacing: -0.04em;
    font-weight: 800;
    margin-bottom: 1rem;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 1.12rem;
    line-height: 1.8;
    max-width: 760px;
    margin: 0 auto 1.75rem;
}

.section-title {
    color: var(--heading-dark);
    font-size: 2rem;
    line-height: 1.15;
    letter-spacing: -0.03em;
    font-weight: 800;
    margin-bottom: 1.2rem;
}

/* ===== Search ===== */
.search-box {
    width: 100%;
}

#search-input {
    width: 100%;
    min-height: 62px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #ffffff;
    color: var(--text-dark);
    font-size: 1.08rem;
    padding: 0 22px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    box-shadow: var(--shadow-sm);
}

#search-input::placeholder {
    color: #9ca3af;
}

#search-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.12);
    outline: none;
}

/* ===== Sections ===== */
.tool-section {
    margin-bottom: 2.25rem;
}

.row {
    --bs-gutter-x: 1.2rem;
    --bs-gutter-y: 1.2rem;
}

/* ===== Tool Cards ===== */
.tool-card {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 24px 22px;
    text-decoration: none;
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.tool-card:hover {
    transform: translateY(-4px);
    border-color: rgba(13, 110, 253, 0.45);
    box-shadow: var(--shadow-md);
}

.tool-card:focus-visible {
    outline: 3px solid rgba(13, 110, 253, 0.35);
    outline-offset: 2px;
}

.tool-title {
    font-size: 1.3rem;
    line-height: 1.35;
    margin: 0;
    font-weight: 600;
}

.tool-keyword {
    color: var(--accent-blue);
    font-weight: 800;
}

.tool-suffix {
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== Tool / Calculator Page ===== */
.card {
    border: 1px solid var(--border-color) !important;
    border-radius: 22px !important;
    box-shadow: var(--shadow-sm) !important;
}

.breadcrumb {
    margin-bottom: 0;
    flex-wrap: wrap;
    gap: 4px;
}

.breadcrumb-item a {
    color: var(--accent-blue);
}

h1, h2, h3 {
    color: var(--heading-dark);
}

.form-control,
.form-select {
    min-height: 54px;
    border-radius: 14px;
    border: 1px solid #d1d5db;
    box-shadow: none;
    font-size: 1rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
}

.btn {
    min-height: 50px;
    border-radius: 14px;
    font-weight: 600;
}

/* ===== FAQ / Content ===== */
article .bg-white {
    border-radius: 20px;
}

.accordion-item {
    overflow: hidden;
}

/* ===== Animation ===== */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    will-change: opacity, transform;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Back to Top ===== */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: var(--accent-blue);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.35rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    color: #ffffff;
}

/* ===== Footer ===== */
.footer {
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
}

.footer-link:hover {
    color: var(--accent-blue) !important;
}

/* ===== Tablet ===== */
@media (max-width: 991.98px) {
    .hero-section {
        padding: 4rem 0 2.5rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.04rem;
        line-height: 1.7;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .tool-title {
        font-size: 1.2rem;
    }
}

/* ===== Mobile ===== */
@media (max-width: 767.98px) {
    .container,
    .container-fluid,
    .main-container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .navbar {
        min-height: 66px;
    }

    .navbar-brand {
        font-size: 1.45rem !important;
    }

    .navbar-collapse {
        background: #ffffff;
        margin-top: 10px;
        padding: 8px;
        border-radius: 14px;
        box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
    }

    .nav-link {
        padding: 10px 12px !important;
        border-radius: 10px;
    }

    .hero-section {
        padding: 2.4rem 0 1.7rem;
        text-align: center;
    }

    /* Override inline max-width from HTML */
    .hero-section .container[style] {
        max-width: 100% !important;
        width: 100% !important;
    }

    .search-box[style] {
        max-width: 100% !important;
        width: 100% !important;
    }

    .hero-title {
        font-size: 2.15rem;
        line-height: 1.14;
        margin-bottom: 0.9rem;
    }

    .hero-subtitle {
        font-size: 0.98rem;
        line-height: 1.65;
        margin-bottom: 1.25rem;
        max-width: 100%;
    }

    .section-title {
        font-size: 1.75rem;
        line-height: 1.2;
        margin-bottom: 0.9rem;
    }

    #search-input {
        min-height: 56px;
        font-size: 1rem;
        padding: 0 18px;
        border-radius: 18px;
    }

    .row {
        --bs-gutter-x: 0.9rem;
        --bs-gutter-y: 1rem;
    }

    .tool-item,
    .col,
    [class*="col-"] {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }

    .tool-card {
        padding: 20px 18px;
        border-radius: 16px;
        min-height: auto;
    }

    .tool-title {
        font-size: 1.1rem;
        line-height: 1.35;
    }

    .card {
        border-radius: 18px !important;
    }

    .breadcrumb {
        font-size: 0.95rem;
    }

    h1.display-4,
    .display-4 {
        font-size: 2rem !important;
        line-height: 1.15;
    }

    .lead {
        font-size: 1rem !important;
        line-height: 1.65;
    }

    .card .form-label {
        font-size: 0.98rem;
    }

    .btn-lg,
    .btn {
        min-height: 52px;
        font-size: 1rem;
    }

    article .bg-white {
        border-radius: 16px;
    }

    .back-to-top {
        width: 44px;
        height: 44px;
        right: 16px;
        bottom: 16px;
        font-size: 1.1rem;
    }
}

/* ===== Small Mobile ===== */
@media (max-width: 480px) {
    .container,
    .container-fluid,
    .main-container {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    .navbar-brand {
        font-size: 1.35rem !important;
    }

    .hero-title {
        font-size: 1.95rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

    #search-input {
        min-height: 54px;
        font-size: 0.97rem;
    }

    .tool-title {
        font-size: 1.02rem;
    }
}