/* ===== Custom Variables ===== */
:root {
    --brand-gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    --hero-gradient: linear-gradient(135deg, #0f172a 0%, #1e3a5f 40%, #1e1b4b 100%);
    --card-hover-shadow: 0 16px 40px rgba(37, 99, 235, 0.12);
    --card-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --success: #10b981;
    --success-dark: #059669;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --warning: #f59e0b;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-light: #64748b;
    --border: #e2e8f0;
    --bg: #f8fafc;
    --bg-alt: #f1f5f9;
    --surface: #ffffff;
    --radius: 1rem;
    --radius-lg: 1.25rem;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
}

/* ===== Global ===== */
body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Navbar ===== */
.navbar {
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    padding: 0.625rem 0;
    z-index: 1030;
}
.navbar-brand {
    font-size: 1.4rem;
    letter-spacing: -0.03em;
    font-weight: 800 !important;
}
.navbar .nav-link {
    font-weight: 500;
    padding: 0.5rem 0.875rem !important;
    border-radius: 0.5rem;
    transition: var(--card-transition);
    font-size: 0.9rem;
    color: var(--text-secondary) !important;
}
.navbar .nav-link:hover,
.navbar .nav-link.active {
    background: var(--primary-light);
    color: var(--primary) !important;
}
.dropdown-menu {
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.1) !important;
    border-radius: 0.875rem !important;
    padding: 0.5rem !important;
}
.dropdown-menu .dropdown-item {
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    transition: var(--card-transition);
    color: var(--text-secondary);
}
.dropdown-menu .dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}
.dropdown-menu .dropdown-item.active {
    background: var(--primary);
    color: #fff;
}

/* ===== Hero Section ===== */
.hero-section {
    background: var(--hero-gradient);
    position: relative;
}
.hero-bg {
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-section h1 {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.min-vh-50 {
    min-height: 50vh;
}

/* ===== Tool Cards (homepage) ===== */
.tool-icon {
    width: 52px;
    height: 52px;
    border-radius: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: var(--card-transition);
}
.tool-card {
    border-radius: var(--radius-lg) !important;
    transition: var(--card-transition);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.04) !important;
}
.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-hover-shadow) !important;
    border-color: transparent !important;
}
.tool-card:hover .tool-icon {
    transform: scale(1.12);
}
.tool-card .card-title {
    font-size: 0.9rem;
    line-height: 1.3;
    font-weight: 600 !important;
}
.tool-card .card-text {
    font-size: 0.78rem;
    line-height: 1.4;
}

/* ===== Custom color utility classes ===== */
.bg-purple-subtle {
    background-color: #f3e8ff !important;
}
.text-purple {
    color: #9333ea !important;
}

/* ===== Calculator Container ===== */
.calculator-container {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
.calculator-container.wide {
    max-width: 960px;
}

/* ===== Calculator Card Section ===== */
.calc-card-section {
    background: var(--surface);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.calc-card-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--brand-gradient);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.calc-card-section h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}
.calc-card-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}
.calc-card-section > p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ===== Calculator Display ===== */
.display {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 1.5rem 1.75rem;
    text-align: right;
    margin-bottom: 1.25rem;
    min-height: 88px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.display .expression {
    font-size: 0.95rem;
    color: #94a3b8;
    min-height: 24px;
    word-break: break-all;
}
.display .result {
    font-size: 2.2rem;
    font-weight: 700;
    word-break: break-all;
    letter-spacing: -0.02em;
}

/* ===== Calculator Buttons (override Bootstrap .btn) ===== */
.btn-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
}
.btn-grid .btn,
.btn-grid button {
    padding: 1.05rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.15rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--card-transition);
    background: var(--bg-alt);
    color: var(--text);
    line-height: 1;
    border: 1px solid transparent;
}
.btn-grid .btn:hover,
.btn-grid button:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}
.btn-grid .btn:active,
.btn-grid button:active {
    transform: translateY(0);
    box-shadow: none;
}
.btn-grid .btn:focus-visible,
.btn-grid button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.btn-grid .btn.operator,
.btn-grid button.operator {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: transparent !important;
}
.btn-grid .btn.operator:hover,
.btn-grid button.operator:hover {
    background: var(--primary-dark) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
}
.btn-grid .btn.equals,
.btn-grid button.equals {
    background: var(--success) !important;
    color: #fff !important;
    border-color: transparent !important;
}
.btn-grid .btn.equals:hover,
.btn-grid button.equals:hover {
    background: var(--success-dark) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}
.btn-grid .btn.clear,
.btn-grid button.clear {
    background: var(--danger) !important;
    color: #fff !important;
    border-color: transparent !important;
}
.btn-grid .btn.clear:hover,
.btn-grid button.clear:hover {
    background: var(--danger-dark) !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
}
.btn-grid .btn.wide,
.btn-grid button.wide {
    grid-column: span 2;
}

/* ===== Action Buttons (outside grid) ===== */
.calc-action-btn {
    display: block;
    width: 100%;
    padding: 0.9rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--card-transition);
    background: var(--brand-gradient);
    color: #fff;
    letter-spacing: 0.01em;
}
.calc-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}
.calc-action-btn:active {
    transform: translateY(0);
}

/* ===== Form Elements (override Bootstrap) ===== */
.calc-form .form-label,
.calc-card-section .form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.calc-card-section .form-control,
.calc-card-section .form-select {
    border-radius: 0.75rem;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border);
    transition: var(--card-transition);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    background: var(--surface);
}
.calc-card-section .form-control:hover,
.calc-card-section .form-select:hover {
    border-color: #cbd5e1;
}
.calc-card-section .form-control:focus,
.calc-card-section .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

/* ===== Legacy form-group (keep for old templates) ===== */
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.375rem;
    font-size: 0.85rem;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border);
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--card-transition);
    background: var(--surface);
    color: var(--text);
}
.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #cbd5e1;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}
.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: monospace;
}

/* ===== Result Box ===== */
.result-box {
    border-radius: var(--radius);
    border: 2px solid #d1fae5;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    padding: 1.5rem;
    text-align: center;
}
.result-box .result-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: #059669;
    letter-spacing: -0.02em;
}
.result-box .result-label {
    font-size: 0.85rem;
    color: #047857;
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== Info Boxes ===== */
.info-box {
    border-radius: var(--radius);
    border: 1px solid rgba(0, 0, 0, 0.04);
    padding: 1.5rem;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.info-box h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--primary);
}
.info-box p,
.info-box li {
    font-size: 0.92rem;
    color: var(--text-light);
    line-height: 1.8;
}
.info-box ul,
.info-box ol {
    padding-left: 1.25rem;
    margin-bottom: 0;
}

/* ===== E-E-A-T Section Styles ===== */
.eeat-section {
    background: var(--surface);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-top: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--card-transition);
}
.eeat-section:hover {
    box-shadow: var(--shadow);
}
.eeat-section h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.eeat-section h3 i {
    color: var(--primary);
    font-size: 1rem;
}
.eeat-section p {
    font-size: 0.92rem;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 0.75rem;
}
.eeat-section ul,
.eeat-section ol {
    padding-left: 1.25rem;
    margin-bottom: 0;
}
.eeat-section li {
    font-size: 0.92rem;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 0.25rem;
}
.eeat-section .formula-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin: 1rem 0;
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.95rem;
    text-align: center;
    color: var(--text);
    overflow-x: auto;
}
.eeat-section .step-list {
    list-style: none;
    padding-left: 0;
    counter-reset: step-counter;
}
.eeat-section .step-list li {
    counter-increment: step-counter;
    padding-left: 2.75rem;
    position: relative;
    margin-bottom: 0.875rem;
}
.eeat-section .step-list li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0.1rem;
    width: 1.75rem;
    height: 1.75rem;
    background: var(--brand-gradient);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}
.example-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.125rem 1.25rem;
    margin-bottom: 0.75rem;
    transition: var(--card-transition);
}
.example-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.06);
}
.example-card .example-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}
.example-card .example-calc {
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.88rem;
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.3rem 0.6rem;
    border-radius: 0.375rem;
    display: inline-block;
}

/* ===== FAQ Accordion ===== */
.faq-item {
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    margin-bottom: 0.625rem;
    overflow: hidden;
    transition: var(--card-transition);
}
.faq-item:hover {
    border-color: #cbd5e1;
}
.faq-item h4 {
    font-size: 0.92rem;
    font-weight: 600;
    margin: 0;
    padding: 0.875rem 1.25rem;
    background: var(--bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
    color: var(--text);
}
.faq-item h4:hover {
    background: var(--bg-alt);
}
.faq-item h4 i {
    transition: transform 0.2s;
    font-size: 0.75rem;
    color: var(--text-light);
}
.faq-item .faq-answer {
    padding: 0 1.25rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}
.faq-item.open .faq-answer {
    max-height: 500px;
    padding: 0 1.25rem 1rem;
}
.faq-item.open .faq-answer i {
    transform: rotate(180deg);
}

/* ===== Disclaimer Banner ===== */
.disclaimer-banner {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: #92400e;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.disclaimer-banner i {
    color: #f59e0b;
    font-size: 1.1rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

/* ===== Related Tools ===== */
.related-tools {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}
.related-tool-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    text-decoration: none;
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 500;
    transition: var(--card-transition);
}
.related-tool-link:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}
.related-tool-link i {
    color: var(--primary);
    font-size: 1rem;
}

/* ===== Two Column Layout ===== */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ===== Three Column Layout ===== */
.three-col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

/* ===== BMI Meter ===== */
.bmi-meter {
    height: 20px;
    border-radius: 1rem;
    background: linear-gradient(to right, #22c55e 0%, #22c55e 30%, #eab308 30%, #eab308 50%, #f97316 50%, #f97316 70%, #ef4444 70%);
    position: relative;
    margin: 1rem 0;
}
.bmi-marker {
    position: absolute;
    top: -4px;
    width: 4px;
    height: 28px;
    background: #1e293b;
    border-radius: 2px;
    transition: left 0.3s;
}

/* ===== Percentage Tabs ===== */
.pct-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.pct-tab {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    background: var(--surface);
    color: var(--text);
    transition: var(--card-transition);
}
.pct-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.pct-panel {
    display: none;
}
.pct-panel.active {
    display: block;
}

/* ===== Date Mode Tabs ===== */
.date-mode-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.date-mode-tab {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    color: var(--text);
    background: var(--surface);
    transition: var(--card-transition);
}
.date-mode-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ===== Fraction Input ===== */
.frac-input {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
    margin: 1rem 0;
}
.frac-input input {
    width: 60px;
    text-align: center;
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1.1rem;
}
.frac-line {
    width: 40px;
    height: 2px;
    background: var(--text);
}
.frac-op {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}
.frac-result {
    font-size: 1.5rem;
    text-align: center;
    margin: 1rem 0;
}

/* ===== Unit Converter ===== */
.uc-category {
    margin-bottom: 1.5rem;
}
.uc-category h3 {
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 1rem;
}
.uc-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.uc-row input {
    flex: 1;
    min-width: 100px;
    padding: 0.625rem 0.75rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
}
.uc-row select {
    padding: 0.625rem 0.75rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    min-width: 120px;
}
.uc-row .uc-eq {
    font-size: 1.2rem;
    color: var(--text-light);
}
.uc-row .uc-out {
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 100px;
    text-align: right;
    color: var(--primary);
}

/* ===== GPA Course ===== */
.gpa-course {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}
.gpa-course input[type="text"] {
    flex: 2;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
}
.gpa-course select,
.gpa-course input[type="number"] {
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
}
.gpa-course select {
    flex: 1;
}
.gpa-course input[type="number"] {
    width: 60px;
}

/* ===== Password Strength ===== */
.strength-bar {
    height: 8px;
    border-radius: 0.5rem;
    background: #e2e8f0;
    margin-top: 0.5rem;
    overflow: hidden;
}
.strength-fill {
    height: 100%;
    border-radius: 0.5rem;
    transition: width 0.3s;
}

/* ===== Table ===== */
.result-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    border-radius: 0.75rem;
    overflow: hidden;
}
.result-table th,
.result-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.result-table th {
    background: var(--bg-alt);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}
.result-table td {
    color: var(--text);
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    background: transparent !important;
    padding: 0 !important;
}

/* ===== Footer ===== */
.footer-section {
    background: #0f172a;
    color: #94a3b8;
}
.footer-section h6 {
    color: #e2e8f0;
}
.footer-section a {
    transition: color 0.2s;
}
.footer-section a:hover {
    color: #fff !important;
}
.footer-brand {
    display: flex;
    align-items: center;
}

/* ===== Print ===== */
@media print {
    .navbar,
    .footer-section,
    .hero-section,
    .btn,
    .visually-hidden-focusable,
    .calc-action-btn,
    .floating-toolbar {
        display: none !important;
    }
    .main,
    #main-content {
        padding: 0 !important;
    }
    .calc-card-section,
    .info-box,
    .eeat-section,
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    .calc-card-section::before {
        display: none !important;
    }
}

/* ===== Dark Mode Toggle ===== */
#themeToggle {
    font-size: 1.1rem;
    text-decoration: none !important;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--card-transition);
    color: var(--text);
    background: var(--bg);
}
#themeToggle:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

/* ===== Floating Toolbar ===== */
.floating-toolbar {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1020;
}
.floating-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
    transition: var(--card-transition);
}
.floating-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

/* ===== Last Updated ===== */
.last-updated {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ===== Dark Mode Overrides ===== */
[data-bs-theme="dark"] {
    --text: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-light: #94a3b8;
    --border: #334155;
    --bg: #0f172a;
    --bg-alt: #1e293b;
    --surface: #1e293b;
}
[data-bs-theme="dark"] .navbar {
    background: rgba(15, 23, 42, 0.92) !important;
    border-bottom-color: rgba(255, 255, 255, 0.06);
}
[data-bs-theme="dark"] .navbar .nav-link:hover,
[data-bs-theme="dark"] .navbar .nav-link.active {
    background: #1e293b;
    color: #60a5fa !important;
}
[data-bs-theme="dark"] .dropdown-menu {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
}
[data-bs-theme="dark"] .dropdown-menu .dropdown-item {
    color: #e2e8f0;
}
[data-bs-theme="dark"] .dropdown-menu .dropdown-item:hover {
    background: #334155;
    color: #60a5fa;
}
[data-bs-theme="dark"] .calc-card-section {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
[data-bs-theme="dark"] .calc-card-section .form-control,
[data-bs-theme="dark"] .calc-card-section .form-select,
[data-bs-theme="dark"] .form-group input,
[data-bs-theme="dark"] .form-group select {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}
[data-bs-theme="dark"] .btn-grid .btn,
[data-bs-theme="dark"] .btn-grid button {
    background: #334155;
    color: #e2e8f0;
}
[data-bs-theme="dark"] .btn-grid .btn:hover,
[data-bs-theme="dark"] .btn-grid button:hover {
    background: #475569;
}
[data-bs-theme="dark"] .eeat-section {
    background: #1e293b;
    border-color: #334155;
}
[data-bs-theme="dark"] .eeat-section .formula-box {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}
[data-bs-theme="dark"] .example-card {
    background: #0f172a;
    border-color: #334155;
}
[data-bs-theme="dark"] .faq-item {
    border-color: #334155;
}
[data-bs-theme="dark"] .faq-item h4 {
    background: #0f172a;
    color: #e2e8f0;
}
[data-bs-theme="dark"] .faq-item h4:hover {
    background: #334155;
}
[data-bs-theme="dark"] .result-box {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-color: #334155;
}
[data-bs-theme="dark"] .result-box .result-value {
    color: #34d399;
}
[data-bs-theme="dark"] .result-box .result-label {
    color: #6ee7b7;
}
[data-bs-theme="dark"] .related-tool-link {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}
[data-bs-theme="dark"] .related-tool-link:hover {
    background: #1e293b;
    border-color: #3b82f6;
    color: #60a5fa;
}
[data-bs-theme="dark"] .info-box {
    background: #1e293b;
    border-color: #334155;
}
[data-bs-theme="dark"] .result-table th {
    background: #334155;
    color: #e2e8f0;
}
[data-bs-theme="dark"] .result-table td {
    border-color: #334155;
    color: #e2e8f0;
}
[data-bs-theme="dark"] #themeToggle {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}
[data-bs-theme="dark"] #themeToggle:hover {
    background: #334155;
    border-color: #3b82f6;
    color: #60a5fa;
}
[data-bs-theme="dark"] .breadcrumb-item a {
    color: #94a3b8;
}
[data-bs-theme="dark"] .breadcrumb-item.active {
    color: #64748b;
}
[data-bs-theme="dark"] .display {
    background: linear-gradient(135deg, #020617 0%, #0f172a 100%);
}
[data-bs-theme="dark"] .disclaimer-banner {
    background: linear-gradient(135deg, #422006 0%, #451a03 100%);
    border-color: #92400e;
}

/* ===== Responsive ===== */
@media (max-width: 991.98px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    .hero-section .lead {
        font-size: 1rem;
    }
}
@media (max-width: 767.98px) {
    .tool-icon {
        width: 44px;
        height: 44px;
        font-size: 1.15rem;
    }
    .tool-card .card-body {
        padding: 1rem !important;
    }
    .two-col {
        grid-template-columns: 1fr;
    }
    .three-col {
        grid-template-columns: 1fr;
    }
    .calculator-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .related-tools {
        grid-template-columns: 1fr;
    }
    .calc-card-section {
        padding: 1.25rem;
    }
    .eeat-section {
        padding: 1.25rem;
    }
    .floating-toolbar {
        bottom: 1rem;
        right: 1rem;
    }
    .floating-btn {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }
}

/* ===== Search Results ===== */
#searchResults .hover-bg:hover {
    background: var(--primary-light);
}
#searchResults a:hover span {
    color: var(--primary);
}
#toolSearch:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    width: 240px !important;
    transition: width 0.2s ease;
}
