/* ═══════════════════════════════════════════════════════════════════
   FITNESSCALC - MODERN DARK THEME
   Clean, vibrant, and eye-catching design with smooth animations
   ═══════════════════════════════════════════════════════════════════ */

/* Google Fonts loaded via <link> in _Layout.cshtml for better LCP performance */

:root {
    --fc-bg: #1a1a1a;
    --fc-bg-elevated: #242424;
    --fc-bg-card: #242424;
    --fc-bg-input: #2a2a2a;
    --fc-bg-hover: #303030;

    --fc-text: #f5f5f5;
    --fc-text-muted: #a8a8a8;
    --fc-text-dim: #707070;

    --fc-accent: #F59E0B;
    --fc-accent-hover: #FBBF24;
    --fc-accent-dim: rgba(245, 158, 11, 0.12);
    --fc-accent-text: #000;

    --fc-danger: #ef4444;
    --fc-success: #4ade80;
    --fc-warning: #fbbf24;
    --fc-info: #38bdf8;

    --fc-border: #3a3a3a;
    --fc-border-strong: #4a4a4a;
    --fc-border-accent: rgba(245, 158, 11, 0.4);

    --fc-link: #F59E0B;
    --fc-link-hover: #FBBF24;

    --fc-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --fc-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --fc-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --fc-glow: 0 0 20px rgba(245, 158, 11, 0.2);

    --fc-radius-sm: 0;
    --fc-radius: 0;
    --fc-radius-lg: 0;
    --fc-radius-xl: 0;

    --fc-transition: 0.15s ease;
    --fc-transition-slow: 0.25s ease;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 15px;
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--fc-bg);
    color: var(--fc-text);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

/* ═══════════════════════════════════════════════════════════════════
   RTL & BIDIRECTIONAL TEXT SUPPORT
   Prevents number scrambling in RTL languages (Arabic, Hebrew, Urdu, Farsi)
   ═══════════════════════════════════════════════════════════════════ */

/* Isolate bidirectional text in interactive elements */
button,
.btn,
select,
option,
.preset-btn,
.method-btn,
.mode-btn,
.calc-method-btn,
.bar-btn,
.gender-btn,
.sex-btn,
.unit-btn,
.equipment-btn,
.event-btn,
.pct-btn {
    unicode-bidi: isolate;
}

/* Ensure select dropdowns display correctly in RTL */
[dir="rtl"] select,
[dir="rtl"] option {
    text-align: right;
}

/* ═══════════════════════════════════════════════════════════════════
   HEADER & NAVIGATION
   ═══════════════════════════════════════════════════════════════════ */

.site-header {
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--fc-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--fc-text);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color var(--fc-transition);
}

.site-logo:hover {
    color: var(--fc-accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links > li > a {
    display: block;
    padding: 0.625rem 0.75rem;
    color: var(--fc-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: var(--fc-radius-sm);
    transition: all var(--fc-transition);
}

.nav-links > li > a:hover {
    color: var(--fc-text);
    background: var(--fc-bg-hover);
}

/* Nav Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    background: var(--fc-bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--fc-border-strong);
    border-radius: var(--fc-radius);
    list-style: none;
    padding: 0.5rem;
    margin: 0;
    z-index: 150;
    box-shadow: var(--fc-shadow-lg);
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
    transition: all var(--fc-transition);
}

.nav-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 1rem;
    display: none;
}

.nav-dropdown:hover::after {
    display: block;
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown-menu li {
    margin: 0;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.625rem 1rem;
    color: var(--fc-text-muted);
    font-size: 0.875rem;
    border-radius: var(--fc-radius-sm);
    transition: all var(--fc-transition);
}

.nav-dropdown-menu a:hover {
    background: var(--fc-accent-dim);
    color: var(--fc-text);
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.nav-auth .btn {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* ═══════════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════════ */

.site-main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════ */

.site-footer {
    border-top: 1px solid var(--fc-border);
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: rgba(10, 10, 15, 0.5);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--fc-text-dim);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color var(--fc-transition);
}

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

.footer-copy {
    color: var(--fc-text-dim);
    font-size: 0.8125rem;
}

/* ═══════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--fc-radius);
    cursor: pointer;
    transition: all var(--fc-transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

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

.btn-primary:hover {
    background: var(--fc-accent-hover);
    color: var(--fc-accent-text);
    box-shadow: var(--fc-glow);
}

.btn-ghost {
    background: transparent;
    color: var(--fc-text-muted);
    border: 1px solid var(--fc-border-strong);
}

.btn-ghost:hover {
    background: var(--fc-bg-hover);
    color: var(--fc-text);
    border-color: var(--fc-border-accent);
}

.account-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

.btn-danger {
    background: var(--fc-danger);
    color: #fff;
}

.btn-danger:hover {
    background: #ff6b7a;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
    border-radius: var(--fc-radius-lg);
}

.btn-block {
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════════════════════ */

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

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--fc-text-muted);
    margin-bottom: 0.5rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Consolas', monospace;
    color: var(--fc-text);
    background: var(--fc-bg-input);
    border: 1px solid var(--fc-border-strong);
    border-radius: var(--fc-radius);
    transition: all var(--fc-transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--fc-accent);
    box-shadow: 0 0 0 2px var(--fc-accent-dim);
}

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

.form-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
    accent-color: var(--fc-accent);
    cursor: pointer;
}

.form-check-label {
    font-size: 0.9375rem;
    color: var(--fc-text-muted);
    cursor: pointer;
}

/* Floating labels */
.form-floating {
    position: relative;
}

.form-floating > .form-control {
    height: calc(3.5rem + 2px);
    padding: 1.625rem 1rem 0.625rem;
}

.form-floating > label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: 1rem;
    pointer-events: none;
    border: 1px solid transparent;
    transform-origin: 0 0;
    transition: opacity var(--fc-transition), transform var(--fc-transition);
    color: var(--fc-text-dim);
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    opacity: 0.8;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
    color: var(--fc-accent);
}

/* Validation */
.text-danger {
    color: var(--fc-danger) !important;
    font-size: 0.8125rem;
    margin-top: 0.5rem;
}

.validation-summary-errors {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.3);
    border-radius: var(--fc-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--fc-danger);
}

/* Checkbox styling */
input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    background: var(--fc-bg-input);
    border: 2px solid var(--fc-border-strong);
    border-radius: var(--fc-radius-sm);
    cursor: pointer;
    position: relative;
    transition: all var(--fc-transition);
}

input[type="checkbox"]:checked {
    background: var(--fc-accent);
    border-color: var(--fc-accent);
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid var(--fc-accent-text);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

input[type="checkbox"]:focus {
    outline: none;
    border-color: var(--fc-accent);
    box-shadow: 0 0 0 3px var(--fc-accent-dim);
}

/* ═══════════════════════════════════════════════════════════════════
   AUTH PAGES
   ═══════════════════════════════════════════════════════════════════ */

.auth-container {
    max-width: 420px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem;
    color: var(--fc-text);
}

.auth-subtitle {
    color: var(--fc-text-muted);
    font-size: 1rem;
    margin: 0;
}

.auth-card {
    background: var(--fc-bg-card);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius-lg);
    padding: 2rem;
    box-shadow: var(--fc-shadow);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--fc-accent);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--fc-text-dim);
    font-size: 0.8125rem;
    font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--fc-border);
}

.auth-links {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--fc-border);
    text-align: center;
    font-size: 0.9375rem;
    color: var(--fc-text-muted);
}

.auth-links a {
    display: inline-block;
    margin-top: 0.25rem;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.9375rem;
    color: var(--fc-text-muted);
}

/* Account Management */
.manage-nav {
    border: 1px solid var(--fc-border);
    background: var(--fc-bg-card);
    border-radius: var(--fc-radius);
    margin-bottom: 2rem;
    overflow: hidden;
}

.manage-nav a {
    display: block;
    padding: 1rem 1.25rem;
    color: var(--fc-text-muted);
    border-bottom: 1px solid var(--fc-border);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all var(--fc-transition);
}

.manage-nav a:last-child {
    border-bottom: none;
}

.manage-nav a:hover {
    background: var(--fc-bg-hover);
    color: var(--fc-text);
}

.manage-nav a.active {
    background: var(--fc-accent-dim);
    color: var(--fc-accent);
    border-left: 3px solid var(--fc-accent);
}

/* ═══════════════════════════════════════════════════════════════════
   ALERTS & MESSAGES
   ═══════════════════════════════════════════════════════════════════ */

.alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: var(--fc-radius);
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--fc-success);
}

.alert-danger {
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(244, 63, 94, 0.3);
    color: var(--fc-danger);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--fc-info);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--fc-warning);
}

/* ═══════════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════════ */

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0 0 1.5rem;
    line-height: 1.2;
}

h2 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 1rem;
}

h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
}

/* ═══════════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════════ */

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

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.w-100 {
    width: 100% !important;
}

hr {
    border: none;
    border-top: 1px solid var(--fc-border);
    margin: 2rem 0;
}

.container {
    max-width: 1200px;
    padding: 0 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════════
   LANGUAGE SELECTOR
   ═══════════════════════════════════════════════════════════════════ */

.lang-selector {
    position: relative;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: var(--fc-bg-input);
    border: 1px solid var(--fc-border-strong);
    border-radius: var(--fc-radius);
    color: var(--fc-text-muted);
    font-size: 0.8125rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--fc-transition);
}

.lang-toggle:hover {
    background: var(--fc-bg-hover);
    color: var(--fc-text);
    border-color: var(--fc-border-accent);
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 160px;
    background: var(--fc-bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--fc-border-strong);
    border-radius: var(--fc-radius);
    box-shadow: var(--fc-shadow-lg);
    z-index: 200;
    max-height: 320px;
    overflow-y: auto;
    padding: 0.5rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: all var(--fc-transition);
}

.lang-selector::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    height: 1rem;
    display: none;
}

.lang-selector:hover::after {
    display: block;
}

.lang-selector:hover .lang-dropdown,
.lang-selector:focus-within .lang-dropdown {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.lang-option {
    display: block;
    padding: 0.625rem 1rem;
    color: var(--fc-text-muted);
    font-size: 0.875rem;
    text-decoration: none;
    transition: all var(--fc-transition);
    border-radius: var(--fc-radius-sm);
}

.lang-option:hover {
    background: var(--fc-accent-dim);
    color: var(--fc-text);
}

.lang-option.active {
    color: var(--fc-accent);
    font-weight: 600;
    background: var(--fc-accent-dim);
}

/* ═══════════════════════════════════════════════════════════════════
   PAGE SUBTITLES
   ═══════════════════════════════════════════════════════════════════ */

.page-subtitle {
    color: var(--fc-text-muted);
    font-size: 1.125rem;
    margin-top: -1rem;
    margin-bottom: 2.5rem;
    max-width: 600px;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════════
   TOOL GRID - Section index pages
   ═══════════════════════════════════════════════════════════════════ */

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.tool-card {
    display: block;
    background: var(--fc-bg-card);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius-lg);
    padding: 1.75rem;
    text-decoration: none;
    transition: all var(--fc-transition-slow);
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--fc-accent);
    opacity: 0;
    transition: opacity var(--fc-transition);
}

.tool-card::after {
    content: '→';
    position: absolute;
    right: 1.75rem;
    top: 1.75rem;
    color: var(--fc-text-dim);
    font-size: 1.5rem;
    transition: all var(--fc-transition);
    opacity: 0;
    transform: translateX(-10px);
}

.tool-card:hover {
    border-color: var(--fc-border-accent);
    background: var(--fc-bg-hover);
    transform: translateY(-4px);
    box-shadow: var(--fc-shadow), var(--fc-glow);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-card:hover::after {
    opacity: 1;
    transform: translateX(0);
    color: var(--fc-accent);
}

.tool-card h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--fc-text);
    margin: 0 0 0.625rem;
}

.tool-card p {
    color: var(--fc-text-muted);
    font-size: 0.9375rem;
    margin: 0;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════════
   CALCULATOR PAGES
   ═══════════════════════════════════════════════════════════════════ */

.calc-container {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.calc-header {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--fc-border);
}

.calc-header h1 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.calc-header h1::before {
    content: '';
    width: 4px;
    height: 1.75rem;
    background: var(--fc-accent);
    flex-shrink: 0;
}

.calc-intro {
    color: var(--fc-text-muted);
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
    max-width: 650px;
}

.calc-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

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

.calc-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (max-width: 768px) {
    .calc-layout {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .calc-form,
    .calc-results {
        width: 100%;
        max-width: 100%;
    }

    .calc-form {
        order: 1;
    }

    .calc-results {
        order: 2;
    }
}

/* Extra small devices (Galaxy Fold, etc.) */
@media (max-width: 480px) {
    .site-nav {
        padding: 0 1rem;
        height: 56px;
    }

    .site-logo {
        font-size: 1rem;
        flex-shrink: 0;
    }

    .nav-auth {
        gap: 0.375rem;
        flex-shrink: 1;
        min-width: 0;
    }

    .nav-auth .btn {
        padding: 0.5rem 0.625rem;
        font-size: 0.6875rem;
    }

    .lang-toggle {
        font-size: 0.6875rem;
        padding: 0.375rem 0.5rem;
    }

    .site-main {
        padding: 1.5rem 1rem;
    }

    .calc-container {
        max-width: 100%;
    }

    .calc-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1.25rem;
    }

    .calc-header h1 {
        font-size: 1.5rem;
    }

    .calc-intro {
        font-size: 0.9375rem;
    }

    .calc-form {
        padding: 1.25rem;
    }

    .calc-result-value {
        font-size: 2rem;
    }

    .calc-result {
        padding: 1.25rem;
    }

    .calc-secondary {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* Calc Field with Unit Toggle */
.calc-field {
    margin-bottom: 1.5rem;
}

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

.calc-field-header .form-label {
    margin-bottom: 0;
}

.unit-toggle {
    display: flex;
    border-radius: var(--fc-radius-sm);
    overflow: hidden;
    border: 1px solid var(--fc-border-strong);
}

/* Toggle containers for button-based toggles (gender, equipment, unit) */
.gender-toggle,
.equipment-toggle,
.event-toggle,
.method-toggle {
    display: flex;
    gap: 0;
}

.gender-btn,
.equipment-btn,
.event-btn,
.mode-btn {
    flex: 1;
    text-align: center;
    padding: 0.625rem 1rem;
    background: var(--fc-bg-input);
    border: 1px solid var(--fc-border-strong);
    cursor: pointer;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--fc-text-muted);
    transition: all var(--fc-transition);
    font-weight: 500;
}

.gender-btn:first-child,
.equipment-btn:first-child,
.event-btn:first-child,
.mode-btn:first-child {
    border-radius: var(--fc-radius) 0 0 var(--fc-radius);
}

.gender-btn:last-child,
.equipment-btn:last-child,
.event-btn:last-child,
.mode-btn:last-child {
    border-radius: 0 var(--fc-radius) var(--fc-radius) 0;
    border-left: none;
}

.gender-btn:hover:not(.active),
.equipment-btn:hover:not(.active),
.event-btn:hover:not(.active),
.mode-btn:hover:not(.active) {
    background: var(--fc-bg-hover);
    color: var(--fc-text);
}

.gender-btn.active,
.equipment-btn.active,
.event-btn.active,
.mode-btn.active {
    background: var(--fc-accent-dim);
    border-color: var(--fc-accent);
    color: var(--fc-accent);
}

.gender-btn.active + .gender-btn,
.equipment-btn.active + .equipment-btn,
.event-btn.active + .event-btn,
.mode-btn.active + .mode-btn {
    border-left: 1px solid var(--fc-border-strong);
}

/* Unit toggle container */
.unit-toggle {
    display: flex;
    gap: 0;
    border-radius: var(--fc-radius-sm);
    overflow: hidden;
}

.unit-btn {
    padding: 0.375rem 0.875rem;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    background: transparent;
    border: none;
    color: var(--fc-text-muted);
    cursor: pointer;
    transition: all var(--fc-transition);
}

.unit-btn:first-child {
    border-right: 1px solid var(--fc-border);
}

.unit-btn:hover {
    color: var(--fc-text);
    background: var(--fc-bg-hover);
}

.unit-btn.active {
    background: var(--fc-accent);
    color: var(--fc-accent-text);
}

/* Results display */
.calc-result {
    background: var(--fc-bg-card);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius-lg);
    padding: 1.5rem 1.75rem;
    position: relative;
    overflow: hidden;
}

.calc-result::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--fc-accent);
}

.calc-result-value {
    font-size: 2.75rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Consolas', monospace;
    color: var(--fc-accent);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.calc-result-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--fc-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.5rem;
}

.calc-secondary {
    background: var(--fc-bg-card);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9375rem;
}

.calc-secondary-label {
    color: var(--fc-text-muted);
    font-size: 0.875rem;
}

.calc-secondary-value {
    font-weight: 700;
    font-family: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Consolas', monospace;
    color: var(--fc-text);
}

.calc-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Category badges - BMI ranges etc */
.calc-category {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 1rem;
    border-radius: var(--fc-radius);
}

.calc-category.underweight {
    background: rgba(59, 130, 246, 0.15);
    color: var(--fc-info);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.calc-category.normal {
    background: rgba(16, 185, 129, 0.15);
    color: var(--fc-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.calc-category.overweight {
    background: rgba(245, 158, 11, 0.15);
    color: var(--fc-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.calc-category.obese {
    background: rgba(244, 63, 94, 0.15);
    color: var(--fc-danger);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.calc-range {
    margin-top: 1rem;
    font-size: 0.9375rem;
    color: var(--fc-text-muted);
}

/* Comparison tables */
.calc-comparison {
    background: var(--fc-bg-card);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius-lg);
    padding: 1.5rem 1.75rem;
}

.calc-comparison h3 {
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0 0 1.25rem;
    color: var(--fc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.calc-comparison .table {
    width: 100%;
    font-size: 0.875rem;
    border-collapse: collapse;
    margin: 0;
}

.calc-comparison .table th,
.calc-comparison .table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--fc-border);
}

.calc-comparison .table th {
    font-weight: 600;
    color: var(--fc-text-muted);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calc-comparison .table td {
    font-family: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.calc-comparison .table tr:last-child td {
    border-bottom: none;
}

.calc-comparison .table-primary {
    background: var(--fc-accent-dim);
}

.calc-comparison .table-primary td {
    color: var(--fc-accent);
    font-weight: 600;
}

.calc-comparison-row {
    display: flex;
    justify-content: space-between;
    padding: 0.625rem 0;
    font-size: 0.9375rem;
    border-bottom: 1px solid var(--fc-border);
}

.calc-comparison-row:last-child {
    border-bottom: none;
}

.calc-comparison-row span:last-child {
    font-weight: 700;
    font-family: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Consolas', monospace;
}

/* Calculator Ad Slot */
.calc-ad-slot {
    margin: 2rem 0;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fc-bg-elevated, #f8f9fa);
    border-radius: var(--fc-radius);
    border: 1px dashed var(--fc-border, #e0e0e0);
}

.calc-ad-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    text-align: center;
    color: var(--fc-text-muted, #666);
}

.calc-ad-placeholder .placeholder-icon {
    font-size: 2rem;
}

.calc-ad-placeholder .placeholder-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--fc-text-dim, #999);
}

.calc-ad-placeholder .placeholder-info {
    font-size: 0.75rem;
    color: var(--fc-text-dim, #999);
}

.calc-ad-slot .calc-ad {
    display: block;
    width: 100%;
    min-height: 250px;
}

@media (max-width: 767px) {
    .calc-ad-slot {
        min-height: 100px;
        margin: 1.5rem 0;
    }

    .calc-ad-slot .calc-ad {
        min-height: 100px;
    }
}

[dir="rtl"] .calc-ad-slot {
    direction: ltr;
}

/* Button groups */
.btn-group-toggle {
    display: flex;
    gap: 0.5rem;
}

.btn-group-toggle .btn {
    flex: 1;
    padding: 0.75rem;
    font-size: 0.8125rem;
}

.btn-group-toggle .btn.active {
    background: var(--fc-accent);
    color: var(--fc-accent-text);
    border-color: var(--fc-accent);
}

.btn-outline-secondary {
    background: transparent;
    border: 1px solid var(--fc-border-strong);
    color: var(--fc-text-muted);
}

.btn-outline-secondary:hover {
    background: var(--fc-bg-hover);
    color: var(--fc-text);
}

/* Form hints */
.form-text {
    font-size: 0.8125rem;
    color: var(--fc-text-dim);
    margin-top: 0.5rem;
}

.small, small {
    font-size: 0.875rem;
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE NAVIGATION
   ═══════════════════════════════════════════════════════════════════ */

.nav-toggle {
    display: none;
    background: var(--fc-bg-input);
    border: 1px solid var(--fc-border-strong);
    border-radius: var(--fc-radius-sm);
    color: var(--fc-text);
    padding: 0.625rem;
    cursor: pointer;
    transition: all var(--fc-transition);
}

.nav-toggle:hover {
    background: var(--fc-bg-hover);
    border-color: var(--fc-border-accent);
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    margin: 4px 0;
    transition: all var(--fc-transition);
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .site-nav {
        padding: 0 1rem;
        height: 60px;
    }

    .site-logo {
        font-size: 1.125rem;
    }

    .nav-auth {
        gap: 0.5rem;
    }

    .nav-auth .btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.75rem;
    }

    .lang-toggle {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--fc-bg);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--fc-border);
        flex-direction: column;
        padding: 1rem;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links > li > a {
        padding: 1rem 0;
        border-bottom: 1px solid var(--fc-border);
        border-radius: 0;
    }

    .nav-dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        background: transparent;
        backdrop-filter: none;
        border-left: 2px solid var(--fc-accent);
        margin-left: 0.75rem;
        padding-left: 0.75rem;
        opacity: 1;
        transform: none;
    }

    .auth-card {
        padding: 1.5rem;
    }

    h1 {
        font-size: 2rem;
    }

    .calc-header h1 {
        font-size: 1.75rem;
    }

    .calc-result-value {
        font-size: 2.25rem;
    }

    .tool-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   BOOTSTRAP OVERRIDES
   ═══════════════════════════════════════════════════════════════════ */

.btn:focus,
.btn:active:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: none;
}

/* External auth */
.auth-external {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--fc-border);
}

.auth-external h3 {
    color: var(--fc-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}

.auth-external .btn {
    margin-bottom: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════════
   SCROLLBAR STYLING
   ═══════════════════════════════════════════════════════════════════ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--fc-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--fc-border-strong);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--fc-text-dim);
}

/* ═══════════════════════════════════════════════════════════════════
   SELECTION
   ═══════════════════════════════════════════════════════════════════ */

::selection {
    background: var(--fc-accent);
    color: var(--fc-accent-text);
}

::-moz-selection {
    background: var(--fc-accent);
    color: var(--fc-accent-text);
}

/* ═══════════════════════════════════════════════════════════════════
   SEX TOGGLE
   ═══════════════════════════════════════════════════════════════════ */

.sex-toggle {
    display: flex;
    gap: 0.5rem;
}

.sex-btn {
    flex: 1;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    background: var(--fc-bg-input);
    border: 1px solid var(--fc-border-strong);
    border-radius: var(--fc-radius);
    color: var(--fc-text-muted);
    cursor: pointer;
    transition: all var(--fc-transition);
}

.sex-btn:hover {
    background: var(--fc-bg-hover);
    color: var(--fc-text);
    border-color: var(--fc-border-accent);
}

.sex-btn.active {
    background: var(--fc-accent);
    border-color: var(--fc-accent);
    color: var(--fc-accent-text);
}

/* ═══════════════════════════════════════════════════════════════════
   TOGGLE GROUPS - Radio-button-like toggles for gender, units, etc.
   ═══════════════════════════════════════════════════════════════════ */

/* Main toggle group container */
.toggle-group {
    display: flex;
    gap: 0;
}

.toggle-group label {
    flex: 1;
    text-align: center;
    padding: 0.625rem 1rem;
    background: var(--fc-bg-input);
    border: 1px solid var(--fc-border-strong);
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--fc-text-muted);
    transition: all var(--fc-transition);
    font-weight: 500;
}

.toggle-group label:first-child {
    border-radius: var(--fc-radius) 0 0 var(--fc-radius);
}

.toggle-group label:last-child {
    border-radius: 0 var(--fc-radius) var(--fc-radius) 0;
    border-left: none;
}

.toggle-group input {
    display: none;
}

.toggle-group input:checked + span {
    font-weight: 600;
}

.toggle-group label:has(input:checked) {
    background: var(--fc-accent-dim);
    border-color: var(--fc-accent);
    color: var(--fc-accent);
}

.toggle-group label:has(input:checked) + label {
    border-left: 1px solid var(--fc-border-strong);
}

.toggle-group label:hover:not(:has(input:checked)) {
    background: var(--fc-bg-hover);
    color: var(--fc-text);
}

/* Compact unit toggle (for inline with labels) */
.unit-toggle-inline {
    display: flex;
    gap: 0;
    border-radius: var(--fc-radius-sm);
    overflow: hidden;
}

.unit-toggle-inline label {
    padding: 0.375rem 0.625rem;
    background: var(--fc-bg-input);
    border: 1px solid var(--fc-border-strong);
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--fc-text-muted);
    transition: all var(--fc-transition);
}

.unit-toggle-inline label:first-child {
    border-radius: var(--fc-radius-sm) 0 0 var(--fc-radius-sm);
}

.unit-toggle-inline label:last-child {
    border-radius: 0 var(--fc-radius-sm) var(--fc-radius-sm) 0;
    border-left: none;
}

.unit-toggle-inline input {
    display: none;
}

.unit-toggle-inline label:has(input:checked) {
    background: var(--fc-accent);
    border-color: var(--fc-accent);
    color: var(--fc-accent-text);
    font-weight: 600;
}

.unit-toggle-inline label:has(input:checked) + label {
    border-left: 1px solid var(--fc-border-strong);
}

/* Field header with inline toggle */
.field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.field-header .form-label {
    margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   FORM HINTS
   ═══════════════════════════════════════════════════════════════════ */

.form-hint {
    display: block;
    font-size: 0.8125rem;
    color: var(--fc-text-dim);
    margin-top: 0.5rem;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════
   INFO CARDS
   ═══════════════════════════════════════════════════════════════════ */

.info-card {
    background: var(--fc-bg-card);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius-lg);
    padding: 1.5rem;
}

.info-card h4 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--fc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 1rem;
}

.info-card ul {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--fc-text-muted);
    font-size: 0.9375rem;
    line-height: 1.7;
}

.info-card li {
    margin-bottom: 0.5rem;
}

.info-card p {
    margin: 0;
    color: var(--fc-text-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.info-description {
    font-style: italic;
}

.info-card.info-warning {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.05);
}

.info-card.info-warning h4 {
    color: var(--fc-warning);
}

/* ═══════════════════════════════════════════════════════════════════
   CATEGORY TABLES
   ═══════════════════════════════════════════════════════════════════ */

.category-table {
    background: var(--fc-bg-card);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius-lg);
    padding: 1.5rem;
}

.category-table h3 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--fc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 1rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--fc-border);
}

.data-table th {
    font-weight: 600;
    color: var(--fc-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr.highlight {
    background: var(--fc-accent-dim);
}

.data-table tr.highlight td {
    color: var(--fc-accent);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════
   DISCLAIMERS
   ═══════════════════════════════════════════════════════════════════ */

.disclaimer {
    padding: 1.25rem;
    background: var(--fc-bg-card);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    font-size: 0.8125rem;
    color: var(--fc-text-dim);
    line-height: 1.6;
}

.disclaimer p {
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   RISK CATEGORIES (WHR, etc.)
   ═══════════════════════════════════════════════════════════════════ */

.calc-category.low-risk {
    background: rgba(16, 185, 129, 0.15);
    color: var(--fc-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.calc-category.moderate-risk {
    background: rgba(245, 158, 11, 0.15);
    color: var(--fc-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.calc-category.high-risk {
    background: rgba(244, 63, 94, 0.15);
    color: var(--fc-danger);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

/* Body Fat Percentage Categories */
.calc-category.essential {
    background: rgba(59, 130, 246, 0.15);
    color: var(--fc-info);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.calc-category.athlete {
    background: rgba(16, 185, 129, 0.15);
    color: var(--fc-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.calc-category.fitness {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.calc-category.acceptable {
    background: rgba(245, 158, 11, 0.15);
    color: var(--fc-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Secondary grid layout for multiple results */
.calc-secondary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .calc-secondary-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════ */

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

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

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════════════════
   HOME PAGE STYLES
   ═══════════════════════════════════════════════════════════════════ */

.home-hero {
    padding: 3rem 0 2rem;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.home-hero-compact {
    padding: 2.5rem 0 1.5rem;
}

.home-title {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin: 0 0 0.75rem;
    color: var(--fc-text);
}

.home-subtitle {
    color: var(--fc-text-muted);
    font-size: 1.0625rem;
    line-height: 1.6;
    margin: 0;
}

.home-tagline {
    color: var(--fc-text-dim);
    font-size: 0.9rem;
    margin: 0.25rem 0 0;
}

@media (max-width: 640px) {
    .home-hero {
        padding: 2rem 0 1rem;
    }

    .home-title {
        font-size: 1.75rem;
    }

    .home-subtitle {
        font-size: 0.9375rem;
    }

    .home-tagline {
        font-size: 0.8125rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   GLASS MORPHISM UTILITIES
   ═══════════════════════════════════════════════════════════════════ */

.glass {
    background: rgba(22, 22, 31, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--fc-border);
}

.glass-strong {
    background: rgba(22, 22, 31, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--fc-border-strong);
}

/* ═══════════════════════════════════════════════════════════════════
   HOME PAGE - SECTIONS
   ═══════════════════════════════════════════════════════════════════ */

.home-section {
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--fc-border);
}

.home-section:first-of-type {
    margin-top: 1.5rem;
    padding-top: 0;
    border-top: none;
}

.home-section-title {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 1.25rem;
    color: var(--fc-text-dim);
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.category-card {
    display: flex;
    flex-direction: column;
    background: var(--fc-bg-card);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius-lg);
    padding: 1.75rem;
    text-decoration: none;
    transition: all var(--fc-transition-slow);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--fc-accent);
    opacity: 0;
    transition: opacity var(--fc-transition);
}

.category-card:hover {
    border-color: var(--fc-border-accent);
    background: var(--fc-bg-hover);
    transform: translateY(-4px);
    box-shadow: var(--fc-shadow), var(--fc-glow);
}

.category-card:hover::before {
    opacity: 1;
}

.category-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fc-accent-dim);
    border-radius: var(--fc-radius);
    margin-bottom: 1.25rem;
    color: var(--fc-accent);
    transition: all var(--fc-transition);
}

.category-card:hover .category-icon {
    background: var(--fc-accent);
    color: var(--fc-accent-text);
}

.category-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--fc-text);
    margin: 0 0 0.5rem;
}

.category-card p {
    color: var(--fc-text-muted);
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.5;
    flex: 1;
}

.category-count {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--fc-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* SEO Content Section */
.home-seo {
    text-align: center;
}

.seo-content {
    max-width: 700px;
    margin: 0 auto;
}

.seo-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 1.5rem;
    color: var(--fc-text);
}

.seo-content p {
    color: var(--fc-text-muted);
    font-size: 1rem;
    line-height: 1.7;
    margin: 0 0 1rem;
}

.seo-content p:last-child {
    margin-bottom: 0;
}

/* Responsive: Category Grid */
@media (max-width: 900px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .home-section {
        margin-top: 2.5rem;
        padding-top: 2rem;
    }

    .home-section:first-of-type {
        margin-top: 1rem;
    }

    .home-section-title {
        font-size: 0.75rem;
        margin-bottom: 1rem;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .category-card {
        padding: 1.25rem;
    }

    .category-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 1rem;
    }

    .category-icon svg {
        width: 20px;
        height: 20px;
    }

    .seo-content h2 {
        font-size: 1.5rem;
    }

    .seo-content p {
        font-size: 0.9375rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   LEGAL PAGES (Privacy Policy, Terms of Service)
   ═══════════════════════════════════════════════════════════════════ */

.privacy-policy,
.terms-of-service {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

.privacy-policy h2,
.terms-of-service h2 {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--fc-border);
}

.privacy-policy h2:first-of-type,
.terms-of-service h2:first-of-type {
    margin-top: 1.5rem;
    padding-top: 0;
    border-top: none;
}

.privacy-policy h3,
.terms-of-service h3 {
    margin-top: 1.5rem;
}

.privacy-policy ul,
.terms-of-service ul {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.privacy-policy li,
.terms-of-service li {
    margin-bottom: 0.5rem;
    color: var(--fc-text-muted);
}

.privacy-policy p,
.terms-of-service p {
    color: var(--fc-text-muted);
    margin-bottom: 1rem;
}

.privacy-policy .last-updated,
.terms-of-service .last-updated {
    font-size: 0.875rem;
    color: var(--fc-text-dim);
    margin-bottom: 2rem;
}

.privacy-table {
    width: 100%;
    margin: 1rem 0;
    border-collapse: collapse;
}

.privacy-table th,
.privacy-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--fc-border);
}

.privacy-table th {
    font-weight: 600;
    color: var(--fc-text-muted);
    font-size: 0.875rem;
}

.privacy-resources {
    list-style: none;
    padding: 0;
}

.privacy-resources li {
    margin-bottom: 0.75rem;
}

/* ═══════════════════════════════════════════════════════════════════
   RTL (RIGHT-TO-LEFT) SUPPORT - Arabic, Hebrew, Persian, etc.
   ═══════════════════════════════════════════════════════════════════ */

[dir="rtl"] {
    font-family: 'Noto Sans Arabic', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

[dir="rtl"] .form-control,
[dir="rtl"] .calc-result-value,
[dir="rtl"] .calc-secondary-value,
[dir="rtl"] .calc-comparison .table td,
[dir="rtl"] .calc-comparison-row span:last-child {
    font-family: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Consolas', monospace;
}

[dir="rtl"] .nav-dropdown-menu {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

[dir="rtl"] .nav-dropdown:hover .nav-dropdown-menu {
    transform: translateX(50%) translateY(0);
}

[dir="rtl"] .nav-dropdown-menu {
    transform: translateX(50%) translateY(-10px);
}

[dir="rtl"] .lang-dropdown {
    right: auto;
    left: 0;
}

[dir="rtl"] .lang-selector::after {
    left: 0;
    right: 0;
}

[dir="rtl"] .tool-card::after {
    right: auto;
    left: 1.75rem;
    content: '←';
}

[dir="rtl"] .tool-card:hover::after {
    transform: translateX(0);
}

[dir="rtl"] .calc-result::before {
    left: auto;
    right: 0;
}

[dir="rtl"] .calc-header h1::before {
    margin-left: 1rem;
    margin-right: 0;
}

[dir="rtl"] .auth-card::before {
    left: auto;
    right: 0;
}

[dir="rtl"] .manage-nav a.active {
    border-left: none;
    border-right: 3px solid var(--fc-accent);
}

[dir="rtl"] input[type="checkbox"]:checked::after {
    left: auto;
    right: 5px;
}

[dir="rtl"] .validation-summary-errors ul {
    padding-left: 0;
    padding-right: 1.25rem;
}

[dir="rtl"] .info-card ul {
    padding-left: 0;
    padding-right: 1.25rem;
}

[dir="rtl"] .privacy-policy ul,
[dir="rtl"] .terms-of-service ul {
    padding-left: 0;
    padding-right: 1.5rem;
}

[dir="rtl"] .privacy-table th,
[dir="rtl"] .privacy-table td {
    text-align: right;
}

[dir="rtl"] .calc-comparison .table th,
[dir="rtl"] .calc-comparison .table td,
[dir="rtl"] .data-table th,
[dir="rtl"] .data-table td {
    text-align: right;
}

[dir="rtl"] .form-floating > label {
    left: auto;
    right: 0;
    transform-origin: 100% 0;
}

[dir="rtl"] .form-floating > .form-control:focus ~ label,
[dir="rtl"] .form-floating > .form-control:not(:placeholder-shown) ~ label {
    transform: scale(0.85) translateY(-0.5rem) translateX(-0.15rem);
}

[dir="rtl"] .gender-btn:first-child,
[dir="rtl"] .equipment-btn:first-child,
[dir="rtl"] .event-btn:first-child,
[dir="rtl"] .mode-btn:first-child {
    border-radius: 0 var(--fc-radius) var(--fc-radius) 0;
}

[dir="rtl"] .gender-btn:last-child,
[dir="rtl"] .equipment-btn:last-child,
[dir="rtl"] .event-btn:last-child,
[dir="rtl"] .mode-btn:last-child {
    border-radius: var(--fc-radius) 0 0 var(--fc-radius);
    border-left: 1px solid var(--fc-border-strong);
    border-right: none;
}

[dir="rtl"] .toggle-group label:first-child {
    border-radius: 0 var(--fc-radius) var(--fc-radius) 0;
}

[dir="rtl"] .toggle-group label:last-child {
    border-radius: var(--fc-radius) 0 0 var(--fc-radius);
    border-left: 1px solid var(--fc-border-strong);
    border-right: none;
}

[dir="rtl"] .unit-btn:first-child {
    border-right: none;
    border-left: 1px solid var(--fc-border);
}

[dir="rtl"] .unit-toggle-inline label:first-child {
    border-radius: 0 var(--fc-radius-sm) var(--fc-radius-sm) 0;
}

[dir="rtl"] .unit-toggle-inline label:last-child {
    border-radius: var(--fc-radius-sm) 0 0 var(--fc-radius-sm);
    border-left: 1px solid var(--fc-border-strong);
    border-right: none;
}

@media (max-width: 768px) {
    [dir="rtl"] .nav-links {
        left: auto;
        right: 0;
    }

    [dir="rtl"] .nav-dropdown-menu {
        border-left: none;
        border-right: 2px solid var(--fc-accent);
        margin-left: 0;
        margin-right: 0.75rem;
        padding-left: 0;
        padding-right: 0.75rem;
    }
}

[dir="rtl"] .lang-toggle svg {
    margin-left: 0;
    margin-right: 0.25rem;
}

[dir="rtl"] .bmi-scale,
[dir="rtl"] .heart-rate-zones,
[dir="rtl"] .scale-visualization,
[dir="rtl"] .scale-bar,
[dir="rtl"] .scale-zones,
[dir="rtl"] .scale-labels,
[dir="rtl"] .scale-values,
[dir="rtl"] .bac-scale,
[dir="rtl"] .vo2-scale,
[dir="rtl"] .dots-scale,
[dir="rtl"] .wilks-scale,
[dir="rtl"] .ffmi-scale,
[dir="rtl"] .whr-scale,
[dir="rtl"] .bfp-scale {
    direction: ltr;
}

[dir="rtl"] .calc-references ul {
    direction: ltr;
    text-align: left;
    padding-left: 1.25rem;
    padding-right: 0;
}

[dir="rtl"] .calc-references ul li {
    text-align: left;
}

/* Cookie Consent Banner */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 12vh;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    /* Hidden by default, slide up on .visible */
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out, visibility 0.3s;
}

.cookie-consent.visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.cookie-consent-content {
    max-width: 1000px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.cookie-consent-text {
    margin: 0;
    color: #fff;
    font-size: 15px;
    line-height: 1.5;
    flex: 1;
}

.cookie-consent-buttons {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.cookie-consent .btn {
    min-width: 120px;
    height: 42px;
    padding: 0 1.25rem;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cookie-consent .btn-primary {
    background: var(--fc-accent);
    color: var(--fc-accent-text);
    border: none;
}

.cookie-consent .btn-primary:hover {
    background: var(--fc-accent-hover);
}

.cookie-consent .btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
}

.cookie-consent .btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
}

.cookie-consent .btn-link {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: underline;
    min-width: auto;
    padding: 0 0.75rem;
}

.cookie-consent .btn-link:hover {
    color: #fff;
}

@media (max-width: 768px) {
    .cookie-consent {
        min-height: 23vh;
        padding: 1.25rem 1rem;
    }

    .cookie-consent-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .cookie-consent-text {
        font-size: 16px;
    }

    .cookie-consent-buttons {
        flex-direction: column;
        width: 100%;
        gap: 0.625rem;
    }

    .cookie-consent .btn {
        width: 100%;
        height: 46px;
        font-size: 15px;
    }

    .cookie-consent .btn-link {
        width: auto;
        height: auto;
        padding: 0.5rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   FAVORITE CALCULATOR TOGGLE (Star Icon)
   ═══════════════════════════════════════════════════════════════════ */

.favorite-calculator-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--fc-border);
    cursor: pointer;
    color: var(--fc-text-muted);
    transition: all var(--fc-transition);
}

.favorite-calculator-toggle:hover {
    color: var(--fc-warning);
    border-color: var(--fc-warning);
    background: rgba(251, 191, 36, 0.1);
}

.favorite-calculator-toggle.active {
    color: var(--fc-warning);
    border-color: var(--fc-warning);
}

.favorite-calculator-toggle.loading {
    opacity: 0.6;
    pointer-events: none;
}

.favorite-calculator-toggle .star-filled {
    display: none;
}

.favorite-calculator-toggle.active .star-outline {
    display: none;
}

.favorite-calculator-toggle.active .star-filled {
    display: block;
}

/* ═══════════════════════════════════════════════════════════════════
   SAVE TO FAVORITES BUTTON (Heart Icon)
   ═══════════════════════════════════════════════════════════════════ */

.save-to-favorites-container {
    margin-top: 1rem;
}

.save-to-favorites-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.save-to-favorites-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.save-to-favorites-btn .heart-filled,
.save-to-favorites-btn .btn-text-saved {
    display: none;
}

.save-to-favorites-btn.saved .heart-outline,
.save-to-favorites-btn.saved .btn-text {
    display: none;
}

.save-to-favorites-btn.saved .heart-filled,
.save-to-favorites-btn.saved .btn-text-saved {
    display: inline;
}

.save-to-favorites-btn.saved {
    color: var(--fc-success);
    border-color: var(--fc-success);
}

.save-to-favorites-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════
   HISTORY PAGE
   ═══════════════════════════════════════════════════════════════════ */

.history-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.history-page .page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.history-page .page-header h1 {
    margin: 0;
}

.history-page .clear-all-form {
    margin: 0;
}

/* Empty State */
.history-page .empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.history-page .empty-icon {
    color: var(--fc-text-dim);
    margin-bottom: 1.5rem;
}

.history-page .empty-state h2 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem;
}

.history-page .empty-state p {
    color: var(--fc-text-muted);
    margin: 0 0 1.5rem;
}

/* History Groups */
.history-group {
    margin-bottom: 2rem;
}

.history-group-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fc-text-muted);
    margin: 0 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--fc-border);
}

.history-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-item {
    display: flex;
    align-items: center;
    background: var(--fc-bg-card);
    border: 1px solid var(--fc-border);
    transition: all var(--fc-transition);
}

.history-item:hover {
    border-color: var(--fc-border-strong);
    background: var(--fc-bg-hover);
}

.history-item-link {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    color: var(--fc-text);
    text-decoration: none;
}

.history-item-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.history-item-title {
    font-weight: 500;
}

.history-item-preview {
    font-size: 0.875rem;
    color: var(--fc-text-muted);
}

.history-item-time {
    font-size: 0.75rem;
    color: var(--fc-text-dim);
    white-space: nowrap;
}

.history-item-delete {
    margin: 0;
    padding: 0;
}

.history-item-delete .btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 100%;
    padding: 0.875rem;
    background: transparent;
    border: none;
    border-left: 1px solid var(--fc-border);
    color: var(--fc-text-dim);
    cursor: pointer;
    transition: all var(--fc-transition);
}

.history-item-delete .btn-icon:hover {
    color: var(--fc-danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Category accent colors */
.history-item.category-body {
    border-left: 3px solid #1D4ED8;
}

.history-item.category-strength {
    border-left: 3px solid #4338CA;
}

.history-item.category-nutrition {
    border-left: 3px solid #15803D;
}

.history-item.category-alcohol {
    border-left: 3px solid #B91C1C;
}

.history-item.category-cardio {
    border-left: 3px solid #0891B2;
}

.history-item.category-converters {
    border-left: 3px solid #6D28D9;
}

/* History/Favorites Table */
.history-table-container {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--fc-bg-card);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    overflow: hidden;
}

.history-table thead {
    background: var(--fc-bg-offset);
    border-bottom: 1px solid var(--fc-border);
}

.history-table th {
    text-align: left;
    padding: 0.875rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fc-text-muted);
    white-space: nowrap;
}

.history-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color var(--fc-transition);
}

.history-table th.sortable:hover {
    color: var(--fc-text);
}

.history-table th .sort-icon {
    display: inline-block;
    width: 1em;
    margin-left: 0.25rem;
    opacity: 0.3;
}

.history-table th .sort-icon::after {
    content: '\2195'; /* ↕ */
}

.history-table th .sort-icon.asc {
    opacity: 1;
}

.history-table th .sort-icon.asc::after {
    content: '\25B2'; /* ▲ */
}

.history-table th .sort-icon.desc {
    opacity: 1;
}

.history-table th .sort-icon.desc::after {
    content: '\25BC'; /* ▼ */
}

.history-table tbody tr {
    border-bottom: 1px solid var(--fc-border);
    cursor: pointer;
    transition: background var(--fc-transition), opacity 0.2s, transform 0.2s;
}

.history-table tbody tr:last-child {
    border-bottom: none;
}

.history-table tbody tr:hover {
    background: var(--fc-bg-hover);
}

.history-table td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
}

.history-table .col-calculator {
    font-weight: 500;
}

.history-table .col-result {
    color: var(--fc-text-muted);
    font-size: 0.875rem;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-table .col-when {
    color: var(--fc-text-dim);
    font-size: 0.875rem;
    white-space: nowrap;
}

.history-table .col-actions {
    width: 48px;
    padding: 0.5rem;
    text-align: center;
}

.history-table .btn-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--fc-radius-sm);
    color: var(--fc-text-dim);
    cursor: pointer;
    transition: all var(--fc-transition);
}

.history-table .btn-delete:hover {
    color: var(--fc-danger);
    background: rgba(239, 68, 68, 0.1);
}

.history-table .delete-form {
    margin: 0;
    padding: 0;
}

/* Table row category accents */
.history-row.category-body {
    border-left: 3px solid #1D4ED8;
}

.history-row.category-strength {
    border-left: 3px solid #4338CA;
}

.history-row.category-nutrition {
    border-left: 3px solid #15803D;
}

.history-row.category-alcohol {
    border-left: 3px solid #B91C1C;
}

.history-row.category-cardio {
    border-left: 3px solid #0891B2;
}

.history-row.category-converters {
    border-left: 3px solid #6D28D9;
}

/* ═══════════════════════════════════════════════════════════════════
   PREFERENCES PAGE
   ═══════════════════════════════════════════════════════════════════ */

.form-section {
    border: 1px solid var(--fc-border);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: var(--fc-bg-card);
}

.form-section legend {
    font-weight: 600;
    font-size: 1rem;
    padding: 0 0.5rem;
    margin-left: -0.5rem;
}

.form-hint {
    display: block;
    font-size: 0.8125rem;
    color: var(--fc-text-dim);
    margin-top: 0.25rem;
}

/* ═══════════════════════════════════════════════════════════════════
   CALCULATOR PAGE HEADER WITH ACTIONS
   ═══════════════════════════════════════════════════════════════════ */

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

.calc-header-with-actions h1 {
    margin: 0;
}

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

/* ═══════════════════════════════════════════════════════════════════
   HOME PAGE PERSONALIZATION
   ═══════════════════════════════════════════════════════════════════ */

.user-section {
    margin-bottom: 2rem;
}

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

.user-section-header h2 {
    font-size: 1.25rem;
    margin: 0;
}

.user-section-link {
    font-size: 0.875rem;
    color: var(--fc-link);
}

.recent-items,
.favorite-calculators {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.recent-item,
.favorite-calculator-card {
    display: block;
    padding: 1rem;
    background: var(--fc-bg-card);
    border: 1px solid var(--fc-border);
    color: var(--fc-text);
    text-decoration: none;
    transition: all var(--fc-transition);
}

.recent-item:hover,
.favorite-calculator-card:hover {
    border-color: var(--fc-accent);
    background: var(--fc-bg-hover);
    color: var(--fc-text);
}

.recent-item-title,
.favorite-calculator-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.recent-item-preview {
    font-size: 0.875rem;
    color: var(--fc-text-muted);
}

/* Recent Calculations Grid */
.recent-calculations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.recent-calc-card {
    display: flex;
    flex-direction: column;
    padding: 0.875rem;
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    background: var(--fc-bg-card);
    color: var(--fc-text);
    transition: all var(--fc-transition);
    text-decoration: none;
    min-height: 90px;
}

.recent-calc-card:hover {
    border-color: var(--fc-accent);
    background: var(--fc-bg-hover);
    color: var(--fc-text);
}

.recent-calc-name {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
    line-height: 1.3;
}

.recent-calc-result {
    font-size: 0.8125rem;
    color: var(--fc-text-muted);
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.recent-calc-time {
    font-size: 0.75rem;
    color: var(--fc-text-muted);
    opacity: 0.8;
    margin-top: 0.5rem;
    padding-top: 0.375rem;
    border-top: 1px solid var(--fc-border);
}

@media (max-width: 576px) {
    .recent-calculations-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .recent-calc-card {
        padding: 0.75rem;
        min-height: 80px;
    }

    .recent-calc-name {
        font-size: 0.8125rem;
    }

    .recent-calc-result {
        font-size: 0.75rem;
    }
}

.favorite-calculator-desc {
    font-size: 0.875rem;
    color: var(--fc-text-muted);
}

/* Favorite Results Section */
.favorite-results-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.favorite-results-controls .control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.favorite-results-controls label {
    font-size: 0.875rem;
    color: var(--fc-text-muted);
    white-space: nowrap;
}

.favorite-results-controls .form-select-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--fc-border);
    background: var(--fc-bg-card);
    color: var(--fc-text);
    min-width: 120px;
}

.favorite-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.favorite-result-card {
    position: relative;
    display: flex;
    background: var(--fc-bg-card);
    border: 1px solid var(--fc-border);
    transition: all var(--fc-transition);
}

.favorite-result-card:hover {
    border-color: var(--fc-accent);
    background: var(--fc-bg-hover);
}

.favorite-result-content {
    flex: 1;
    padding: 1rem;
    text-decoration: none;
    color: var(--fc-text);
    display: block;
}

.favorite-result-content:hover {
    color: var(--fc-text);
}

.favorite-result-calculator {
    font-size: 0.75rem;
    color: var(--fc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.favorite-result-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.favorite-result-preview {
    font-size: 0.875rem;
    color: var(--fc-text-muted);
}

.favorite-result-time {
    font-size: 0.75rem;
    color: var(--fc-text-muted);
    margin-top: 0.5rem;
    opacity: 0.8;
}

.favorite-result-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--fc-text-muted);
    cursor: pointer;
    opacity: 0;
    transition: all var(--fc-transition);
}

.favorite-result-card:hover .favorite-result-remove {
    opacity: 1;
}

.favorite-result-remove:hover {
    color: var(--fc-danger, #dc3545);
    background: rgba(220, 53, 69, 0.1);
}

/* Favorites Page */
.favorites-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.favorites-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.favorites-page .page-header h1 {
    margin: 0;
    font-size: 1.75rem;
}

.favorites-page .favorite-results-controls {
    margin-bottom: 1.5rem;
}

.favorites-page .favorite-result-remove {
    opacity: 0.5;
}

.favorites-page .favorite-result-card:hover .favorite-result-remove {
    opacity: 1;
}

@media (max-width: 640px) {
    .history-page .page-header,
    .favorites-page .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .calc-header-with-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   BREADCRUMB NAVIGATION
   Minimal, clean breadcrumb styling with RTL support
   ═══════════════════════════════════════════════════════════════════ */

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

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

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

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

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

/* Separator between items */
.breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--fc-text-dim);
}

/* RTL Support */
[dir="rtl"] .breadcrumb-list {
    flex-direction: row-reverse;
}

[dir="rtl"] .breadcrumb-item:not(:last-child)::after {
    content: '\\';
    margin-left: 0;
    margin-right: 0.5rem;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .breadcrumb-list {
        font-size: 0.8125rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   FAQ SECTION
   Collapsible accordion for frequently asked questions with SEO schema
   ═══════════════════════════════════════════════════════════════════ */

.faq-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--fc-bg-card);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius-lg);
}

.faq-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 1.25rem;
    color: var(--fc-text);
}

.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.faq-item:hover {
    border-color: var(--fc-accent);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--fc-bg-elevated);
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--fc-text);
    transition: background var(--fc-transition), color var(--fc-transition);
}

.faq-question:hover {
    background: var(--fc-bg-hover);
}

.faq-question[aria-expanded="true"] {
    background: var(--fc-accent-dim);
    color: var(--fc-accent);
}

.faq-question span {
    flex: 1;
    padding-right: 1rem;
}

.faq-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
    color: var(--fc-text-muted);
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(180deg);
    color: var(--fc-accent);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-answer.open {
    max-height: 1000px;
}

.faq-answer-content {
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--fc-text-muted);
    background: var(--fc-bg);
    border-top: 1px solid var(--fc-border);
}

.faq-answer-content p {
    margin: 0 0 0.75rem;
}

.faq-answer-content p:last-child {
    margin-bottom: 0;
}

.faq-answer-content ul,
.faq-answer-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.faq-answer-content li {
    margin-bottom: 0.375rem;
}

.faq-answer-content strong {
    color: var(--fc-text);
    font-weight: 600;
}

.faq-answer-content em {
    color: var(--fc-text);
}

/* RTL Support */
[dir="rtl"] .faq-question {
    text-align: right;
}

[dir="rtl"] .faq-question span {
    padding-right: 0;
    padding-left: 1rem;
}

[dir="rtl"] .faq-answer-content ul,
[dir="rtl"] .faq-answer-content ol {
    padding-left: 0;
    padding-right: 1.5rem;
}

/* Mobile responsiveness */
@media (max-width: 767px) {
    .faq-section {
        padding: 1rem;
        margin: 1.5rem 0;
    }

    .faq-question {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }

    .faq-answer-content {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }
}
