/**
 * DailyCalcHub - Modern, Clean & Fully Responsive CSS
 * Supports Light & Dark Themes, Mobile Optimization & Google AdSense compliance
 */

:root {
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

    /* Light Theme Palette */
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-surface: #f1f5f9;
    --bg-input: #ffffff;
    --border-color: #e2e8f0;
    --border-focus: #3b82f6;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-inverse: #ffffff;

    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-subtle: #eff6ff;
    --color-accent: #f59e0b;
    --color-success: #10b981;
    --color-success-subtle: #ecfdf5;
    --color-danger: #ef4444;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);

    --header-height: 70px;
    --transition: all 0.2s ease-in-out;
}

[data-theme="dark"] {
    --bg-page: #0b0f19;
    --bg-card: #131b2e;
    --bg-surface: #1e293b;
    --bg-input: #0f172a;
    --border-color: #27354f;
    --border-focus: #60a5fa;

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-inverse: #0b0f19;

    --color-primary: #3b82f6;
    --color-primary-hover: #60a5fa;
    --color-primary-subtle: #1e293b;
    --color-accent: #fbbf24;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* Reset & Box Sizing */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    line-height: 1.25;
    font-weight: 700;
}

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

/* ====================================================
   HEADER & NAVIGATION
   ==================================================== */
.site-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    gap: 1rem;
}

.header-brand .brand-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.brand-logo {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--color-primary), #6366f1);
    color: #ffffff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.text-accent {
    color: var(--color-primary);
}

.brand-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Header Search */
.header-search {
    flex: 1;
    max-width: 420px;
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-shortcut {
    position: absolute;
    right: 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.header-search input {
    width: 100%;
    padding: 0.55rem 2.2rem 0.55rem 2.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.header-search input:focus {
    background: var(--bg-input);
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 380px;
    overflow-y: auto;
    z-index: 1100;
    padding: 0.5rem;
}

.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
}

.search-result-item:hover, .search-result-item.highlighted {
    background: var(--color-primary-subtle);
    color: var(--color-primary);
}

.search-result-info {
    display: flex;
    flex-direction: column;
}

.search-result-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.search-result-cat {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.search-result-arrow {
    color: var(--text-muted);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-country-select {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-country-select:hover {
    background: var(--border-color);
}

.country-selector-wrap {
    position: relative;
}

.country-modal-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.75rem;
    z-index: 1200;
}

.country-modal-header {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.country-modal-header h4 {
    font-size: 0.95rem;
}

.country-modal-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.country-modal-list {
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.country-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.country-option:hover {
    background: var(--color-primary-subtle);
}

.country-option.selected {
    background: var(--color-primary-subtle);
    border-left: 3px solid var(--color-primary);
}

.country-opt-main {
    display: flex;
    flex-direction: column;
}

.country-opt-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.country-opt-tax {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.country-opt-badge {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-primary);
    background: var(--bg-surface);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
}

.theme-toggle-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle-btn:hover {
    color: var(--color-primary);
    background: var(--border-color);
}

[data-theme="dark"] .theme-toggle-btn .sun-icon { display: block; }
[data-theme="dark"] .theme-toggle-btn .moon-icon { display: none; }
[data-theme="light"] .theme-toggle-btn .sun-icon, :root:not([data-theme="dark"]) .theme-toggle-btn .sun-icon { display: none; }
[data-theme="light"] .theme-toggle-btn .moon-icon, :root:not([data-theme="dark"]) .theme-toggle-btn .moon-icon { display: block; }

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-btn span {
    display: block;
    height: 3px;
    width: 100%;
    background: var(--text-primary);
    border-radius: 2px;
}

/* Category Navigation Pills */
.category-nav-bar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.category-nav-inner {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
}

.cat-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid transparent;
    transition: var(--transition);
}

.cat-pill:hover {
    color: var(--color-primary);
    background: var(--color-primary-subtle);
}

.cat-pill.active {
    background: var(--color-primary);
    color: #ffffff;
}

/* ====================================================
   ADSENSE UNITS & PLACEMENTS (IAB Standard Compliant)
   ==================================================== */
.ad-container {
    width: 100%;
    margin: 1.5rem auto;
    text-align: center;
    position: relative;
    clear: both;
}

.ad-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.ad-placeholder {
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90px;
}

.ad-placeholder-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.ad-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    background: var(--bg-surface);
    color: var(--text-muted);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    letter-spacing: 0.05em;
}

.ad-info {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.ad-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.ad-banner-top {
    margin-top: 1rem;
}
.ad-banner-bottom {
    margin-bottom: 2rem;
}

.ad-unit-sidebar .ad-placeholder {
    min-height: 250px;
}

/* ====================================================
   HERO & HOMEPAGE STYLES
   ==================================================== */
.hero-section {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-page) 100%);
    padding: 3.5rem 0 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 820px;
}

.hero-badge {
    display: inline-block;
    background: var(--color-primary-subtle);
    color: var(--color-primary);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-full);
    margin-bottom: 1rem;
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 720px;
}

.hero-search-box {
    width: 100%;
    max-width: 680px;
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.hero-search-box svg {
    position: absolute;
    left: 1.25rem;
    color: var(--color-primary);
    pointer-events: none;
}

.hero-search-box input {
    width: 100%;
    padding: 1.1rem 3rem 1.1rem 3.4rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 1.1rem;
    color: var(--text-primary);
    outline: none;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.hero-search-box input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.btn-clear-search {
    position: absolute;
    right: 1.25rem;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-muted);
    cursor: pointer;
}

.active-country-banner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    box-shadow: var(--shadow-sm);
}

.btn-change-country {
    background: none;
    border: none;
    color: var(--color-primary);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    margin-left: 0.5rem;
}

/* Feature Strip */
.features-strip {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.features-strip-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.feat-icon {
    font-size: 1.5rem;
}

.feat-txt {
    display: flex;
    flex-direction: column;
}

.feat-txt strong {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.feat-txt span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Directory Section */
.directory-section {
    padding: 2.5rem 1.25rem;
}

.directory-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 1rem;
}

.section-title {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.section-desc {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.count-badge {
    background: var(--color-primary-subtle);
    color: var(--color-primary);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

/* Calculators Grid */
.calculators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.calc-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.calc-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-focus);
}

.calc-card-link {
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    text-decoration: none;
    color: inherit;
}

.calc-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.calc-num {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.calc-cat-badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    background: var(--bg-surface);
    color: var(--text-secondary);
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
}

.calc-feature-badge {
    font-size: 0.7rem;
    font-weight: 700;
    background: #fef3c7;
    color: #92400e;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    margin-left: auto;
}

[data-theme="dark"] .calc-feature-badge {
    background: #78350f;
    color: #fde68a;
}

.calc-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.calc-card-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    flex: 1;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.calc-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.btn-open-calc {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: var(--transition);
}

.calc-card:hover .btn-open-calc {
    gap: 0.5rem;
}

/* No Results State */
.no-results-state {
    text-align: center;
    padding: 3rem 1rem;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    margin: 2rem 0;
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.no-results-state h3 {
    margin-bottom: 0.5rem;
}

.no-results-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* SEO Info Section */
.seo-info-section {
    padding: 2rem 1.25rem 4rem;
}

.seo-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
}

.seo-card h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.seo-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.seo-feature-box h3 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.seo-feature-box p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* ====================================================
   CALCULATOR DETAIL PAGE LAYOUT
   ==================================================== */
.calculator-detail-page {
    padding: 2rem 0 4rem;
}

.breadcrumb-nav {
    margin-bottom: 1.25rem;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.breadcrumb-item a {
    color: var(--text-muted);
}
.breadcrumb-item a:hover {
    color: var(--color-primary);
}
.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 600;
}

.calc-page-header {
    margin-bottom: 2rem;
}

.calc-header-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.calc-badge-num {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.calc-country-pill {
    background: var(--color-success-subtle);
    color: var(--color-success);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
}

.calc-page-title {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.calc-page-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 800px;
}

/* Two Column Layout Grid */
.calc-layout-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
    align-items: start;
}

/* Interactive Calculator App Card */
.calculator-app-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.calc-card-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.5rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
}

.calc-mode-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-success);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--color-success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--color-success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

.calc-top-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-tool-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-tool-action:hover {
    color: var(--color-primary);
    border-color: var(--border-focus);
}

/* Calculator Form & Inputs */
.calc-form-container {
    padding: 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.calc-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

.calc-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.calc-form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.calc-label-tip {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
}

.calc-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.calc-input-affix {
    position: absolute;
    left: 0.85rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    pointer-events: none;
}

.calc-input-suffix {
    position: absolute;
    right: 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    pointer-events: none;
}

.calc-control {
    width: 100%;
    padding: 0.75rem 0.85rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.calc-input-wrapper.has-prefix .calc-control {
    padding-left: 2.2rem;
}

.calc-input-wrapper.has-suffix .calc-control {
    padding-right: 2.8rem;
}

.calc-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Quick Selection Button Badges */
.calc-preset-pills {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.35rem;
}

.preset-pill {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.preset-pill:hover, .preset-pill.active {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

/* Segmented Buttons / Tabs */
.segmented-control {
    display: flex;
    background: var(--bg-surface);
    padding: 0.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    gap: 0.25rem;
}

.segmented-btn {
    flex: 1;
    padding: 0.5rem;
    text-align: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.segmented-btn.active {
    background: var(--bg-card);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

/* Range Slider */
.calc-range-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.calc-range-input {
    flex: 1;
    accent-color: var(--color-primary);
    cursor: pointer;
}

/* Reactive Results Box */
.calc-result-box {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 1.75rem 1.5rem;
}

.calc-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.result-title {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.btn-copy-result {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-copy-result:hover {
    background: var(--color-primary-subtle);
    color: var(--color-primary);
}

.result-primary-display {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.hero-result-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.hero-result-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.result-tag-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    margin-top: 0.75rem;
}

.result-tag-green { background: #dcfce7; color: #166534; }
.result-tag-blue  { background: #dbeafe; color: #1e40af; }
.result-tag-orange { background: #ffedd5; color: #9a3412; }
.result-tag-red   { background: #fee2e2; color: #991b1b; }

[data-theme="dark"] .result-tag-green { background: #064e3b; color: #a7f3d0; }
[data-theme="dark"] .result-tag-blue  { background: #1e3a8a; color: #bfdbfe; }
[data-theme="dark"] .result-tag-orange { background: #7c2d12; color: #fed7aa; }
[data-theme="dark"] .result-tag-red   { background: #7f1d1d; color: #fecaca; }

.result-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.breakdown-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.breakdown-label {
    color: var(--text-secondary);
}

.breakdown-val {
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

/* Social Media Sharing Action Bar in Results */
.result-social-share-wrap {
    margin-top: 1.25rem;
    padding-top: 1.1rem;
    border-top: 1px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.social-share-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.social-share-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-social {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.825rem;
    font-weight: 600;
    color: #ffffff !important;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-social:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    opacity: 0.95;
}

.btn-social:active {
    transform: translateY(0);
}

.btn-social-whatsapp {
    background-color: #25D366;
}

.btn-social-x {
    background-color: #0F1419;
}
[data-theme="dark"] .btn-social-x {
    background-color: #27354f;
    border: 1px solid var(--border-color);
}

.btn-social-facebook {
    background-color: #1877F2;
}

.btn-social-telegram {
    background-color: #229ED9;
}

.btn-social-linkedin {
    background-color: #0A66C2;
}

/* Mid-Page Content Article & SEO Guide */
.calc-ad-mid {
    margin: 2rem 0;
}

.calc-guide-article {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.guide-section h2 {
    font-size: 1.4rem;
    margin-bottom: 0.85rem;
    color: var(--text-primary);
}

.guide-section p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.65;
}

.formula-box {
    background: var(--bg-surface);
    border-left: 4px solid var(--color-primary);
    padding: 1rem 1.25rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: 0.75rem 0;
    overflow-x: auto;
}

.formula-box code {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--color-primary);
    font-weight: 600;
}

.formula-explanation {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* FAQ Accordion */
.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.faq-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

.faq-item[open] {
    background: var(--bg-card);
    border-color: var(--border-focus);
}

.faq-question {
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-arrow {
    color: var(--text-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.faq-item[open] .faq-arrow {
    transform: rotate(180deg);
    color: var(--color-primary);
}

.faq-answer {
    padding: 0 1.25rem 1rem 1.25rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Sidebar Column */
.calc-sidebar-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.sidebar-card-title {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.sidebar-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.sidebar-country-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.sc-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    padding: 0.35rem 0;
    border-bottom: 1px dashed var(--border-color);
}

.sc-label {
    color: var(--text-muted);
}

.sc-val {
    font-weight: 700;
    color: var(--text-primary);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-sm {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
}

.w-100 {
    width: 100%;
}

.related-calcs-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.related-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.75rem;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
}

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

.view-all-category-link {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-primary);
}

/* ====================================================
   FOOTER
   ==================================================== */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 3.5rem 0 2rem;
    margin-top: auto;
}

.footer-top-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

.brand-col .footer-brand {
    margin-bottom: 0.85rem;
}

.footer-tagline {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.25rem;
    max-width: 380px;
}

.footer-badges {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.badge-item {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.footer-col-title {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.footer-links a:hover {
    color: var(--color-primary);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 1rem;
}

.legal-links {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.4rem;
    flex-wrap: wrap;
}

.legal-links a {
    color: var(--text-muted);
}
.legal-links a:hover {
    color: var(--color-primary);
}

.sep {
    color: var(--border-color);
}

.footer-back-top button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.footer-back-top button:hover {
    background: var(--color-primary);
    color: #ffffff;
}

/* Toast Message */
.site-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0f172a;
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.site-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Buttons utility */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--color-primary);
    color: #ffffff;
}

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

/* ====================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ==================================================== */
@media (max-width: 1024px) {
    .calc-layout-grid {
        grid-template-columns: 1fr;
    }
    .footer-top-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .header-search {
        display: none; /* Accessible in hero or via mobile search */
    }
    .hero-title {
        font-size: 2rem;
    }
    .hero-subtitle {
        font-size: 1rem;
    }
    .calculators-grid {
        grid-template-columns: 1fr;
    }
    .footer-top-grid {
        grid-template-columns: 1fr;
    }
    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
    .hero-result-number {
        font-size: 2.25rem;
    }
}

/* Print Stylesheet */
@media print {
    .site-header, .category-nav-bar, .ad-container, .site-footer, .calc-sidebar-col, .calc-top-actions, .btn-copy-result {
        display: none !important;
    }
    .calc-layout-grid {
        display: block !important;
    }
    body, .calc-main-col, .calculator-app-card {
        background: #ffffff !important;
        color: #000000 !important;
        border: none !important;
        box-shadow: none !important;
    }
}
