/* =========================================================
   DR. LOAY HESHAM FITNESS - APEX LUXURY CINEMATIC SYSTEM
   Ultra-Modern Athleticism, Conic Lasers, Particles & 3D Glass
   Full Bilingual (RTL/LTR) & Dual Theme (Dark / Light Mode)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Anton&family=Cairo:wght@400;600;700;800;900&family=Inter:wght@300;400;500;600;700;800;900&family=Oswald:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* =========================================================
   THEME TOKENS: DARK (DEFAULT) & LIGHT MODE
   ========================================================= */
:root,
[data-theme="dark"] {
    /* Dark Obsidian & Carbon Canvas */
    --bg-void: #040504;
    --bg-black: #080a08;
    --bg-primary: #0d100d;
    --bg-card: rgba(18, 24, 18, 0.75);
    --bg-card-elevated: rgba(25, 35, 25, 0.92);
    --bg-input: #101610;
    --bg-modal: linear-gradient(180deg, #141c14 0%, #090c09 100%);
    --bg-surface-glow: rgba(30, 45, 30, 0.6);

    /* Metallic Imperial Gold Palette */
    --gold-50: #fbf9f4;
    --gold-100: #f4efe4;
    --gold-200: #e5d9c2;
    --gold-300: #d4c4a4;
    --gold-400: #bcad8b;       /* Core Brand Gold */
    --gold-500: #a4936f;
    --gold-600: #867553;
    --gold-700: #63553a;

    /* Glows & Lighting */
    --gold-glow-subtle: rgba(188, 173, 139, 0.2);
    --gold-glow-medium: rgba(188, 173, 139, 0.45);
    --gold-glow-laser: rgba(229, 217, 194, 0.85);
    --spotlight-glow: rgba(188, 173, 139, 0.09);
    --spotlight-secondary: rgba(35, 55, 35, 0.04);
    --grid-line-color: rgba(188, 173, 139, 0.035);

    /* Text Colors */
    --text-pure: #ffffff;
    --text-cream: #f4efe4;
    --text-gold: #bcad8b;
    --text-gold-light: #e5d9c2;
    --text-muted: #958a74;
    --text-dim: #605949;

    /* Borders */
    --border-subtle: rgba(188, 173, 139, 0.16);
    --border-medium: rgba(188, 173, 139, 0.35);
    --border-bright: rgba(188, 173, 139, 0.65);

    /* Gradients */
    --title-gradient: linear-gradient(135deg, #ffffff 0%, var(--gold-100) 25%, var(--gold-400) 65%, #8d7950 100%);
    --body-bg-gradient: 
        radial-gradient(circle at 50% 12%, rgba(188, 173, 139, 0.15) 0%, transparent 45%),
        radial-gradient(circle at 50% 88%, rgba(30, 48, 30, 0.45) 0%, transparent 60%),
        linear-gradient(180deg, #050605 0%, #0c0f0c 45%, #040504 100%);

    /* Shadows */
    --shadow-deep: 0 35px 80px -15px rgba(0, 0, 0, 0.98);
    --shadow-card-hover: 0 35px 80px rgba(0, 0, 0, 0.98);
}

[data-theme="light"] {
    /* Ivory Silk & Warm Alabaster Canvas */
    --bg-void: #f8f6f0;
    --bg-black: #f0ebe1;
    --bg-primary: #e8e2d4;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-elevated: rgba(255, 255, 255, 0.98);
    --bg-input: #ffffff;
    --bg-modal: linear-gradient(180deg, #ffffff 0%, #f7f4ed 100%);
    --bg-surface-glow: rgba(188, 173, 139, 0.25);

    /* Metallic Warm Bronze & Gold Palette */
    --gold-50: #1a1610;
    --gold-100: #2c251b;
    --gold-200: #423829;
    --gold-300: #736142;
    --gold-400: #9e875d;       /* Richer Bronze Gold for Light Mode */
    --gold-500: #b59f75;
    --gold-600: #cbb892;
    --gold-700: #e2d6bc;

    /* Glows & Lighting */
    --gold-glow-subtle: rgba(158, 135, 93, 0.15);
    --gold-glow-medium: rgba(158, 135, 93, 0.35);
    --gold-glow-laser: rgba(158, 135, 93, 0.7);
    --spotlight-glow: rgba(188, 173, 139, 0.16);
    --spotlight-secondary: rgba(210, 195, 165, 0.1);
    --grid-line-color: rgba(158, 135, 93, 0.06);

    /* Text Colors */
    --text-pure: #120f0a;
    --text-cream: #221d15;
    --text-gold: #8c754d;
    --text-gold-light: #6e5a37;
    --text-muted: #6e6452;
    --text-dim: #9c917d;

    /* Borders */
    --border-subtle: rgba(158, 135, 93, 0.22);
    --border-medium: rgba(158, 135, 93, 0.4);
    --border-bright: rgba(158, 135, 93, 0.75);

    /* Gradients */
    --title-gradient: linear-gradient(135deg, #18140e 0%, #4a3e2c 50%, #8c754d 100%);
    --body-bg-gradient: 
        radial-gradient(circle at 50% 12%, rgba(188, 173, 139, 0.25) 0%, transparent 45%),
        radial-gradient(circle at 50% 88%, rgba(220, 210, 190, 0.5) 0%, transparent 60%),
        linear-gradient(180deg, #fbf9f4 0%, #f0ebe1 50%, #e8e1d2 100%);

    /* Shadows */
    --shadow-deep: 0 25px 60px -10px rgba(120, 105, 75, 0.15);
    --shadow-card-hover: 0 30px 65px rgba(120, 105, 75, 0.22);
}

:root {
    /* Typography Tokens */
    --font-display: 'Anton', 'Cairo', sans-serif;
    --font-heading: 'Oswald', 'Cairo', sans-serif;
    --font-arabic: 'Cairo', sans-serif;
    --font-tech: 'Space Grotesk', 'Cairo', monospace;
    --font-body: 'Inter', 'Cairo', sans-serif;

    /* Curves & Shadows */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --radius-pill: 9999px;
}

/* =========================================================
   RESET & FOUNDATIONS
   ========================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: var(--font-body);
    background-color: var(--bg-void);
    color: var(--text-cream);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background 0.4s ease, color 0.4s ease;
}

body {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 80px 20px 60px;
    background: var(--body-bg-gradient);
}

/* =========================================================
   TOP CORNER CONTROLS (LANG TOP-LEFT / THEME TOP-RIGHT)
   ========================================================= */
.lang-toggle-container {
    position: fixed;
    top: 28px;
    left: 28px;
    z-index: 1000;
}

.theme-toggle-container {
    position: fixed;
    top: 28px;
    right: 28px;
    z-index: 1000;
}

.control-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    border-radius: var(--radius-pill);
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1.5px solid var(--border-medium);
    color: var(--text-cream);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 20px var(--gold-glow-subtle);
    outline: none;
    user-select: none;
}

.control-pill-btn:hover {
    background: var(--bg-card-elevated);
    border-color: var(--gold-400);
    color: var(--text-pure);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 25px var(--gold-glow-medium);
}

.control-pill-btn i {
    color: var(--gold-400);
    font-size: 14px;
    transition: transform 0.4s ease;
}

.control-pill-btn:hover i {
    transform: rotate(18deg) scale(1.1);
}

.lang-indicator-active {
    color: var(--gold-400);
    font-weight: 800;
}

.lang-divider {
    color: var(--text-muted);
    font-weight: 400;
    opacity: 0.6;
}

.lang-indicator-inactive {
    color: var(--text-muted);
    font-weight: 500;
}

/* =========================================================
   CINEMATIC BACKGROUND LAYERS & PARTICLES
   ========================================================= */
.particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Mouse-Tracking Spotlight */
.spotlight-beam {
    position: fixed;
    top: 0;
    left: 0;
    width: 900px;
    height: 900px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--spotlight-glow) 0%, var(--spotlight-secondary) 50%, transparent 70%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    filter: blur(70px);
    z-index: 0;
    transition: opacity 0.5s ease;
}

/* Atmospheric Grid & Fine Scanlines */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(var(--grid-line-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line-color) 1px, transparent 1px);
    background-size: 64px 64px;
    background-position: center center;
    mask-image: radial-gradient(circle at center, black 45%, transparent 85%);
    -webkit-mask-image: radial-gradient(circle at center, black 45%, transparent 85%);
    pointer-events: none;
    z-index: 0;
}

/* Floating Ambient Glow Nebula */
.ambient-glow-orb {
    position: fixed;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--gold-glow-medium) 0%, var(--bg-surface-glow) 50%, transparent 75%);
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: blur(110px);
    pointer-events: none;
    z-index: 0;
    animation: ambientNebula 12s ease-in-out infinite alternate;
}

@keyframes ambientNebula {
    0% { transform: translate(-50%, -50%) scale(0.85) rotate(0deg); opacity: 0.6; }
    50% { transform: translate(-48%, -52%) scale(1.15) rotate(180deg); opacity: 0.9; }
    100% { transform: translate(-52%, -48%) scale(1.25) rotate(360deg); opacity: 0.7; }
}

/* =========================================================
   MAIN WRAPPER
   ========================================================= */
.main-wrapper {
    position: relative;
    z-index: 1;
    max-width: 1040px;
    width: 100%;
    margin: 45px auto 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: apexFadeIn 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes apexFadeIn {
    from { opacity: 0; transform: translateY(40px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* =========================================================
   HERO / MASSIVE LOGO & RADAR HUD STAGING
   ========================================================= */
.brand-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 60px;
    position: relative;
}

/* Elite Status Pill */
.brand-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 22px;
    border-radius: var(--radius-pill);
    background: var(--bg-card);
    border: 1.5px solid var(--border-bright);
    color: var(--gold-400);
    font-family: var(--font-tech);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    margin-bottom: 28px;
    box-shadow: 0 0 25px var(--gold-glow-subtle);
    position: relative;
    overflow: hidden;
}

.brand-status-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: badgeSheen 4s infinite ease-in-out;
}

@keyframes badgeSheen {
    0% { left: -100%; }
    30%, 100% { left: 100%; }
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold-400);
    box-shadow: 0 0 10px var(--gold-400);
    animation: blinkGlow 2s infinite ease-in-out;
}

@keyframes blinkGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.8); }
}

/* GRAND MEDALLION LOGO STAGE */
.brand-logo-stage {
    position: relative;
    width: clamp(320px, 48vw, 520px);
    height: clamp(320px, 48vw, 520px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    perspective: 1000px;
}

/* Concentric Radar Rings & Halos */
.logo-halo-outer {
    position: absolute;
    width: 115%;
    height: 115%;
    border-radius: 50%;
    background: radial-gradient(circle, var(--gold-glow-medium) 0%, var(--bg-surface-glow) 50%, transparent 72%);
    filter: blur(50px);
    animation: auraPulse 6s ease-in-out infinite alternate;
}

.logo-radar-ring {
    position: absolute;
    width: 106%;
    height: 106%;
    border-radius: 50%;
    border: 1.5px dashed var(--border-medium);
    animation: radarRotate 35s linear infinite;
}

.logo-halo-inner {
    position: absolute;
    width: 82%;
    height: 82%;
    border-radius: 50%;
    border: 1.5px solid var(--border-bright);
    background: radial-gradient(circle, var(--gold-glow-subtle) 0%, transparent 75%);
    filter: blur(12px);
    animation: innerSpin 18s linear infinite reverse;
}

@keyframes auraPulse {
    0% { transform: scale(0.92); opacity: 0.65; }
    100% { transform: scale(1.2); opacity: 1; }
}

@keyframes radarRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes innerSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

/* Massive 3D Medallion Emblem */
.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 2;
    filter: 
        drop-shadow(0 25px 50px rgba(0, 0, 0, 0.65))
        drop-shadow(0 0 65px var(--gold-glow-medium));
    animation: masterFloating 5s ease-in-out infinite;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s ease;
    transform-style: preserve-3d;
}

.brand-logo-stage:hover .brand-logo-img {
    transform: scale(1.07) translateY(-6px) rotateY(4deg);
    filter: 
        drop-shadow(0 30px 60px rgba(0, 0, 0, 0.8))
        drop-shadow(0 0 95px var(--gold-glow-laser));
}

@keyframes masterFloating {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* Metallic Shimmering Title */
.brand-title {
    font-family: var(--font-heading);
    font-size: clamp(38px, 7vw, 64px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 8px;
    line-height: 1.1;
    background: var(--title-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 14px;
    filter: drop-shadow(0 6px 30px rgba(0, 0, 0, 0.4));
}

.brand-tagline {
    font-family: var(--font-tech);
    font-size: clamp(12px, 2.5vw, 15px);
    font-weight: 600;
    color: var(--text-gold);
    letter-spacing: 4px;
    text-transform: uppercase;
    opacity: 0.95;
}

.brand-accent-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 20px;
}

.brand-accent-line::before,
.brand-accent-line::after {
    content: '';
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-400), transparent);
}

.brand-accent-line span {
    width: 7px;
    height: 7px;
    background: var(--gold-400);
    transform: rotate(45deg);
    box-shadow: 0 0 12px var(--gold-400);
}

/* =========================================================
   LAUNCHER TOOLS GRID - CONIC LASER CARDS
   ========================================================= */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 34px;
    width: 100%;
    margin-top: 15px;
    perspective: 1200px;
}

/* Master Card Structure with Conic Laser Border */
.tool-card {
    position: relative;
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: var(--radius-lg);
    padding: 48px 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
    box-shadow: var(--shadow-deep);
    transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    transform-style: preserve-3d;
    outline: none;
    border: 1.5px solid var(--border-subtle);
}

/* Conic Border Laser Beam */
.tool-card::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius-lg) + 2px);
    background: conic-gradient(
        from 0deg,
        transparent 0%,
        transparent 25%,
        var(--gold-400) 50%,
        var(--gold-laser) 55%,
        var(--gold-400) 60%,
        transparent 80%,
        transparent 100%
    );
    opacity: 0;
    z-index: 0;
    transition: opacity 0.4s ease;
    animation: rotateLaser 4s linear infinite;
    pointer-events: none;
}

@keyframes rotateLaser {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.tool-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

/* Technical Corner Brackets */
.card-corner {
    position: absolute;
    width: 14px;
    height: 14px;
    border-color: var(--gold-400);
    opacity: 0.35;
    transition: all 0.35s ease;
    pointer-events: none;
    z-index: 3;
}

.corner-tl { top: 14px; left: 14px; border-top: 2px solid; border-left: 2px solid; }
.corner-tr { top: 14px; right: 14px; border-top: 2px solid; border-right: 2px solid; }
.corner-bl { bottom: 14px; left: 14px; border-bottom: 2px solid; border-left: 2px solid; }
.corner-br { bottom: 14px; right: 14px; border-bottom: 2px solid; border-right: 2px solid; }

/* Top Highlight Laser Bar */
.card-glow-bar {
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-400), transparent);
    opacity: 0.4;
    transition: all 0.4s ease;
    z-index: 3;
}

/* Interactive Card Light Sweep Sheen */
.tool-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -150%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        115deg,
        transparent 0%,
        rgba(255, 255, 255, 0.03) 40%,
        var(--gold-glow-medium) 50%,
        rgba(255, 255, 255, 0.03) 60%,
        transparent 100%
    );
    transform: rotate(-15deg);
    transition: left 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    z-index: 1;
}

/* Card Hover States */
.tool-card:hover {
    transform: translateY(-12px) scale(1.02);
    background: var(--bg-card-elevated);
    border-color: transparent;
    box-shadow: var(--shadow-card-hover), 0 0 50px var(--gold-glow-medium);
}

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

.tool-card:hover .card-corner {
    opacity: 1;
    transform: scale(1.2);
    border-color: var(--gold-400);
}

.tool-card:hover .card-glow-bar {
    left: 5%;
    right: 5%;
    opacity: 1;
    height: 3px;
    box-shadow: 0 0 20px var(--gold-400);
}

.tool-card:hover::before {
    left: 150%;
}

/* Tool Index Badge */
.tool-index-tag {
    font-family: var(--font-tech);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2.5px;
    color: var(--text-gold);
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    padding: 5px 16px;
    border-radius: var(--radius-pill);
    margin-bottom: 24px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.tool-card:hover .tool-index-tag {
    border-color: var(--gold-400);
    background: var(--bg-surface-glow);
    box-shadow: 0 0 20px var(--gold-glow-subtle);
    color: var(--text-pure);
}

/* Glowing Dual-Ring Shield */
.tool-icon-shield {
    position: relative;
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.icon-halo {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, var(--gold-glow-medium) 0%, transparent 70%);
    transition: all 0.4s ease;
}

.icon-inner-box {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 22px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    color: var(--gold-400);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.tool-card:hover .icon-inner-box {
    transform: scale(1.14) rotate(4deg);
    background: var(--bg-card-elevated);
    border-color: var(--gold-400);
    color: var(--text-pure);
    box-shadow: 0 0 35px var(--gold-glow-medium);
}

/* Card Typography */
.tool-title-en {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-pure);
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.tool-card:hover .tool-title-en {
    color: var(--gold-400);
    text-shadow: 0 0 25px var(--gold-glow-subtle);
}

.tool-desc {
    font-size: 14.5px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 32px;
    max-width: 330px;
}

/* High-Impact Action Button */
.tool-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 15px 36px;
    border-radius: var(--radius-pill);
    background: var(--bg-input);
    border: 1.5px solid var(--gold-400);
    color: var(--gold-400);
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.35s ease;
    pointer-events: auto;
}

.tool-action-btn i {
    font-size: 13px;
    transition: transform 0.3s ease;
}

.tool-card:hover .tool-action-btn {
    background: linear-gradient(135deg, var(--gold-400) 0%, var(--gold-600) 100%);
    color: #ffffff;
    box-shadow: 0 0 35px var(--gold-glow-medium);
    border-color: transparent;
    transform: translateY(-2px);
}

.tool-card:hover .tool-action-btn i {
    transform: translateX(6px);
}

/* =========================================================
   RTL ADAPTATIONS (ARABIC MODE)
   ========================================================= */
[dir="rtl"] {
    font-family: var(--font-arabic);
}

[dir="rtl"] .lang-toggle-container {
    left: auto;
    right: 28px;
}

[dir="rtl"] .theme-toggle-container {
    right: auto;
    left: 28px;
}

[dir="rtl"] .brand-title {
    font-family: var(--font-arabic);
    letter-spacing: 2px;
    font-weight: 900;
}

[dir="rtl"] .brand-tagline,
[dir="rtl"] .brand-status-badge,
[dir="rtl"] .tool-index-tag,
[dir="rtl"] .food-category-label,
[dir="rtl"] .calc-label,
[dir="rtl"] .stat-item-label,
[dir="rtl"] .macro-name,
[dir="rtl"] .compare-card-badge,
[dir="rtl"] .compare-macro-label,
[dir="rtl"] .result-badge {
    font-family: var(--font-arabic);
    letter-spacing: 0.5px;
}

[dir="rtl"] .tool-title-en,
[dir="rtl"] .calc-title,
[dir="rtl"] .compare-food-name,
[dir="rtl"] .stat-item-val,
[dir="rtl"] .macro-grams,
[dir="rtl"] .compare-macro-val,
[dir="rtl"] .tool-action-btn,
[dir="rtl"] .calc-submit-btn,
[dir="rtl"] .food-type-btn {
    font-family: var(--font-arabic);
    letter-spacing: 0.5px;
}

[dir="rtl"] .tool-card:hover .tool-action-btn i {
    transform: translateX(-6px);
}

[dir="rtl"] .calc-group,
[dir="rtl"] .food-category-label,
[dir="rtl"] .comparison-grid {
    text-align: right;
}

[dir="rtl"] .food-search-input {
    padding: 14px 44px 14px 20px;
}

[dir="rtl"] .food-search-icon {
    left: auto;
    right: 16px;
}

[dir="rtl"] .modal-close-btn {
    right: auto;
    left: 24px;
}

/* =========================================================
   HIGH-TECH MODALS DESIGN SYSTEM
   ========================================================= */
.tool-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 6, 4, 0.88);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.tool-modal-container {
    position: relative;
    width: 100%;
    max-width: 880px;
    max-height: 92vh;
    background: var(--bg-modal);
    border: 1.5px solid var(--border-bright);
    border-radius: 30px;
    box-shadow: 
        0 40px 90px rgba(0, 0, 0, 0.8),
        0 0 70px var(--gold-glow-medium);
    overflow-y: auto;
    padding: 50px 42px;
    transform: scale(0.9) translateY(30px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-modal-overlay.active .tool-modal-container {
    transform: scale(1) translateY(0);
}

/* Modal Close Button */
.modal-close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-cream);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close-btn:hover {
    background: var(--gold-400);
    color: #ffffff;
    transform: rotate(90deg) scale(1.12);
    box-shadow: 0 0 25px var(--gold-glow-medium);
}

/* Modal Header */
.calc-header {
    text-align: center;
    margin-bottom: 34px;
}

.calc-title {
    font-family: var(--font-heading);
    font-size: clamp(28px, 4.5vw, 40px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    background: var(--title-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.calc-subtitle {
    font-size: 14.5px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* Food Categories Segmented Filter Bar */
.food-category-label {
    font-family: var(--font-tech);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-gold);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

.food-category-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.food-type-btn {
    padding: 11px 18px;
    border-radius: var(--radius-pill);
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.food-type-btn:hover {
    border-color: var(--gold-400);
    color: var(--text-pure);
    background: var(--bg-surface-glow);
}

.food-type-btn.active {
    background: linear-gradient(135deg, var(--gold-400) 0%, var(--gold-600) 100%);
    color: #ffffff;
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 0 25px var(--gold-glow-medium);
}

/* Quick Search Filter Bar */
.food-search-box {
    margin-bottom: 20px;
    position: relative;
}

.food-search-input {
    width: 100%;
    padding: 14px 20px 14px 44px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    border: 1.5px solid var(--border-medium);
    color: var(--text-pure);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.food-search-input:focus {
    border-color: var(--gold-400);
    box-shadow: 0 0 20px var(--gold-glow-subtle);
}

.food-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold-400);
    font-size: 14px;
    pointer-events: none;
}

/* Modern Form Controls */
.calc-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
}

.calc-field-full {
    grid-column: span 2;
}

.calc-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.calc-label {
    font-family: var(--font-tech);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-cream);
    display: flex;
    align-items: center;
    gap: 8px;
}

.calc-label i {
    color: var(--gold-400);
    font-size: 14px;
}

.calc-input, .calc-select {
    width: 100%;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    border: 1.5px solid var(--border-subtle);
    color: var(--text-pure);
    font-family: var(--font-body);
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
}

.calc-input:focus, .calc-select:focus {
    border-color: var(--gold-400);
    box-shadow: 0 0 20px var(--gold-glow-subtle);
}

.calc-select option {
    background: var(--bg-input);
    color: var(--text-pure);
    padding: 12px;
}

/* Gender Segmented Switch */
.gender-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.gender-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    border: 1.5px solid var(--border-subtle);
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gender-option input {
    display: none;
}

.gender-option.active {
    background: var(--bg-surface-glow);
    border-color: var(--gold-400);
    color: var(--text-pure);
    box-shadow: 0 0 25px var(--gold-glow-subtle);
}

/* High-Impact Calculate Action Button */
.calc-submit-btn {
    grid-column: span 2;
    margin-top: 14px;
    padding: 20px;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--gold-400) 0%, var(--gold-600) 100%);
    border: none;
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 
        0 18px 40px rgba(0, 0, 0, 0.4),
        0 0 40px var(--gold-glow-medium);
}

.calc-submit-btn:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 24px 50px rgba(0, 0, 0, 0.5),
        0 0 65px var(--gold-glow-laser);
    background: linear-gradient(135deg, var(--gold-300) 0%, var(--gold-500) 100%);
}

.calc-submit-btn:active {
    transform: translateY(-1px);
}

/* =========================================================
   MEDICAL-GRADE RESULT PRESENTATION & SVG RADIAL GAUGE
   ========================================================= */
.calc-result-box {
    margin-top: 38px;
    padding: 40px 32px;
    border-radius: var(--radius-lg);
    background: var(--bg-card-elevated);
    border: 1.5px solid var(--gold-400);
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.5),
        0 0 55px var(--gold-glow-subtle);
    text-align: center;
    animation: resultPop 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes resultPop {
    from { opacity: 0; transform: scale(0.95) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.calc-result-box.hidden {
    display: none;
}

.result-badge {
    display: inline-block;
    padding: 5px 22px;
    border-radius: var(--radius-pill);
    background: var(--bg-input);
    border: 1.5px solid var(--border-bright);
    color: var(--text-gold);
    font-size: 12px;
    font-family: var(--font-tech);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

/* SVG Circular Progress Gauge */
.calorie-gauge-wrapper {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 10px auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calorie-gauge-svg {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.gauge-bg {
    fill: none;
    stroke: var(--border-subtle);
    stroke-width: 8;
}

.gauge-progress {
    fill: none;
    stroke: url(#gaugeGradient);
    stroke-width: 9;
    stroke-linecap: round;
    stroke-dasharray: 565;
    stroke-dashoffset: 565;
    transition: stroke-dashoffset 1.4s cubic-bezier(0.16, 1, 0.3, 1);
    filter: drop-shadow(0 0 8px var(--gold-glow-medium));
}

.gauge-center-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.result-main-number {
    font-family: var(--font-display);
    font-size: clamp(48px, 8vw, 68px);
    color: var(--text-gold);
    line-height: 1;
    margin-bottom: 2px;
    text-shadow: 0 0 30px var(--gold-glow-subtle);
    letter-spacing: 2px;
}

.result-main-unit {
    font-family: var(--font-heading);
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-cream);
}

/* Secondary Stats Matrix */
.result-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
}

.result-stat-item {
    background: var(--bg-input);
    padding: 16px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.stat-item-label {
    font-family: var(--font-tech);
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.stat-item-val {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-pure);
}

/* Macros Breakdown Box & Progress Bars */
.macros-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 20px;
}

.macro-card {
    padding: 18px 14px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    border: 1.5px solid var(--border-bright);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.macro-name {
    font-family: var(--font-tech);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-gold);
}

.macro-grams {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-pure);
}

.macro-bar-track {
    width: 100%;
    height: 5px;
    border-radius: 3px;
    background: var(--border-subtle);
    overflow: hidden;
    margin-top: 4px;
}

.macro-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--gold-400), var(--gold-600));
    width: 0%;
    transition: width 1s ease-out;
}

/* Action Strip for Results */
.result-action-strip {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 26px;
}

.result-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: var(--radius-pill);
    background: var(--bg-input);
    border: 1.5px solid var(--border-medium);
    color: var(--text-gold);
    font-family: var(--font-tech);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
}

.result-pill-btn:hover {
    background: var(--gold-400);
    color: #ffffff;
    box-shadow: 0 0 20px var(--gold-glow-subtle);
}

/* =========================================================
   FOOD ALTERNATIVE COMPARISON DISPLAY
   ========================================================= */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
    text-align: left;
}

.compare-card {
    background: var(--bg-card-elevated);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

.compare-card.alt-card {
    border-color: var(--gold-400);
    box-shadow: 0 0 40px var(--gold-glow-subtle);
}

.compare-card-badge {
    font-family: var(--font-tech);
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
}

.alt-card .compare-card-badge {
    color: var(--text-gold);
}

.compare-food-name {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-pure);
    line-height: 1.2;
}

.compare-food-amount {
    font-family: var(--font-display);
    font-size: 48px;
    color: var(--text-gold);
    letter-spacing: 2px;
    line-height: 1;
}

.compare-amount-unit {
    font-family: var(--font-heading);
    font-size: 16px;
    color: var(--text-cream);
    letter-spacing: 1.5px;
}

.compare-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 4px 0;
}

.compare-macros {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-cream);
}

.compare-macro-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.compare-macro-label {
    font-family: var(--font-tech);
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.compare-macro-val {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-gold);
}

/* =========================================================
   FLOATING TOAST NOTIFICATION
   ========================================================= */
.toast-pill {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card-elevated);
    border: 1.5px solid var(--gold-400);
    color: var(--text-gold);
    padding: 12px 28px;
    border-radius: var(--radius-pill);
    font-family: var(--font-tech);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), 0 0 30px var(--gold-glow-subtle);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-pill.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* =========================================================
   FOOTER
   ========================================================= */
.brand-footer {
    margin-top: 70px;
    font-family: var(--font-tech);
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* =========================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================= */
@media (max-width: 868px) {
    body {
        padding: 80px 16px 40px;
    }

    .lang-toggle-container {
        top: 20px;
        left: 20px;
    }

    .theme-toggle-container {
        top: 20px;
        right: 20px;
    }

    [dir="rtl"] .lang-toggle-container {
        left: auto;
        right: 20px;
    }

    [dir="rtl"] .theme-toggle-container {
        right: auto;
        left: 20px;
    }

    .main-wrapper {
        margin-top: 25px;
    }

    .brand-hero {
        margin-bottom: 40px;
    }

    .brand-logo-stage {
        width: clamp(260px, 70vw, 360px);
        height: clamp(260px, 70vw, 360px);
        margin-bottom: 22px;
    }

    .logo-halo-inner {
        width: 80%;
        height: 80%;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .tool-card {
        padding: 38px 24px;
    }

    .calc-form {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .calc-field-full, .calc-submit-btn {
        grid-column: span 1;
    }

    .result-stats-grid, .macros-grid, .comparison-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .tool-modal-container {
        padding: 36px 20px;
    }

    .food-category-bar {
        gap: 8px;
    }

    .food-type-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
}
