:root {
    --primary-blue: #0d4d92;
    --btn-blue-hover: #083262;
    --bg-gray: #f5f5f5;
    --text-dark: #333333;
    --text-light: #555555;
    --border-color: #e1e1e1;
    --card-bg: #ffffff;
    --footer-bg: #092c54;
    --white: #ffffff;
    --font-main: 'Inter', sans-serif;
    --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 8px 15px rgba(13, 77, 146, 0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-gray);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

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

img, svg {
    max-width: 100%;
    height: auto;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary-blue);
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.3;
}

/* Header */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-soft);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.main-nav a {
    font-weight: 500;
    color: var(--text-dark);
}

.main-nav a:hover {
    color: var(--primary-blue);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--primary-blue);
    cursor: pointer;
}

/* Banner Area */
.page-banner {
    background: var(--white);
    position: relative;
    overflow: hidden;
    padding: 4rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.banner-content {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.banner-text h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.breadcrumb {
    color: var(--text-light);
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--primary-blue);
}

.banner-image {
    width: 40%;
    position: relative;
}

/* Slanted background effect for banner */
.page-banner::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 50%;
    background: linear-gradient(135deg, rgba(13,77,146,0.05) 0%, rgba(13,77,146,0.1) 100%);
    transform: skewX(-20deg) translateX(10%);
    z-index: 1;
}

/* Grid layout for listing */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Search and Filters */
.filter-section {
    margin-bottom: 2rem;
}

.search-box {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    font-family: var(--font-main);
    outline: none;
    transition: var(--transition);
}

.search-box:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(13, 77, 146, 0.1);
}

.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chip {
    padding: 0.5rem 1rem;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.chip:hover, .chip.active {
    background: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
}

/* Calculator Grid */
.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

/* Calculator Card */
.calc-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    height: 100%;
}

.calc-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-blue);
}

.calc-card .card-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--primary-blue);
}

.calc-card .card-title a::after {
    content: '';
    position: absolute;
    inset: 0;
}

.calc-card { position: relative; }

.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    border: none;
    font-family: var(--font-main);
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-blue);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--btn-blue-hover);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-blue);
    color: var(--primary-blue);
}

.btn-outline:hover {
    background: var(--primary-blue);
    color: var(--white);
}

.calc-card .btn-calc {
    width: max-content;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

/* Tool Page Layout */
.tool-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.main-content-col {
    flex: 0 0 70%;
    max-width: 70%;
}

.sidebar-col {
    flex: 0 0 calc(30% - 2rem);
    max-width: calc(30% - 2rem);
    position: sticky;
    top: 5rem;
}

.tool-header {
    background: var(--white);
    padding: 1.5rem 2rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    border: 1px solid var(--border-color);
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tool-icon {
    width: 48px;
    height: 48px;
    color: var(--primary-blue);
    background: rgba(13, 77, 146, 0.1);
    padding: 0.5rem;
    border-radius: var(--border-radius);
}

/* Calculator Form */
.calculator-form-container {
    background: var(--white);
    padding: 2rem;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 77, 146, 0.1);
}

.calc-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.result-box {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f0f7ff;
    border: 1px solid #cce3ff;
    border-radius: var(--border-radius);
    display: none;
}

.result-box.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-title {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-blue);
}

/* SEO Content Area */
.seo-content {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
}

.seo-content h2, .seo-content h3 {
    margin-top: 2rem;
}

.seo-content p, .seo-content ul {
    margin-bottom: 1rem;
}

.seo-content ul {
    padding-left: 1.5rem;
}

.toc-box {
    background: var(--bg-gray);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.toc-box ul {
    list-style: none;
    padding-left: 0;
}

.toc-box li {
    margin-bottom: 0.5rem;
}

/* FAQs */
.faq-item {
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.faq-q {
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-a {
    margin-top: 0.5rem;
    display: none;
    color: var(--text-light);
}

.faq-item.active .faq-a {
    display: block;
}

/* Sidebar */
.sidebar-widget {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    margin-bottom: 1.5rem;
}

.sidebar-widget.bg-light {
    background: #f0f7ff;
}

.widget-title {
    font-size: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--bg-gray);
    margin-bottom: 1rem;
}

.related-list {
    list-style: none;
}

.related-list li {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-color);
}

.related-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.related-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-dark);
}

.related-link:hover {
    color: var(--primary-blue);
}

.related-icon {
    width: 24px;
    height: 24px;
    color: var(--primary-blue);
}

/* Footer */
.site-footer {
    background: var(--footer-bg);
    color: rgba(255,255,255,0.8);
    padding: 4rem 2rem 2rem;
    margin-top: 4rem;
}

.foo-container {
    max-width: 1200px;
    margin: 0 auto;
}

.foo-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.foo-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 1rem;
}

.foo-logo svg {
    color: var(--white);
}

.foo-col h3 {
    color: var(--white);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.foo-col ul {
    list-style: none;
}

.foo-col li {
    margin-bottom: 0.8rem;
}

.foo-col a:hover {
    color: var(--white);
    text-decoration: underline;
}

.foo-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
}

/* Utilities */
.text-center { text-align: center; }
.d-block { display: block; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.error-text { color: #dc3545; font-size: 0.9rem; margin-top: 0.5rem; display: none; }

/* Back to top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-blue);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-hover);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--btn-blue-hover);
    transform: translateY(-3px);
}
