/* ==========================================================================
  * TurboKit Main CSS v1.0tylesheet v1.0
   Consolidated: Design System, Premium UI, SaaS UI, Ultra Premium
   Performance: Mobile First, GPU Accelerated
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIABLES & THEME
   -------------------------------------------------------------------------- */
:root {
    /* Colors - Brand */
    --primary: #6366f1;
    /* Indigo 500 */
    --primary-hover: #4f46e5;
    /* Indigo 600 */
    --secondary: #ec4899;
    /* Pink 500 */
    --accent: #14b8a6;
    /* Teal 500 */

    /* Function Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Backgrounds (Light Default) */
    --bg-body: #ffffff;
    --bg-surface: #f8fafc;
    --bg-surface-hover: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.9);
    --bg-glass-blur: blur(12px);

    /* Text */
    --text-main: #0f172a;
    /* Slate 900 */
    --text-muted: #64748b;
    /* Slate 500 */
    --text-light: #94a3b8;
    /* Slate 400 */
    --text-inverse: #ffffff;

    /* Borders & Shadows */
    --border-light: rgba(0, 0, 0, 0.08);
    --border-medium: rgba(0, 0, 0, 0.12);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.2);

    /* Typography */
    --font-heading: 'Space Grotesk', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --header-height: 70px;
}

/* Dark Mode Overrides */
[data-theme="dark"] {
    --bg-body: #0f172a;
    /* Slate 900 */
    --bg-surface: #1e293b;
    /* Slate 800 */
    --bg-surface-hover: #334155;
    --bg-glass: rgba(15, 23, 42, 0.9);

    --text-main: #f8fafc;
    /* Slate 50 */
    --text-muted: #94a3b8;
    /* Slate 400 */
    --text-light: #64748b;
    /* Slate 500 */

    --border-light: rgba(255, 255, 255, 0.08);
    --border-medium: rgba(255, 255, 255, 0.15);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
}

/* --------------------------------------------------------------------------
   2. RESET & BASE
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
    padding-top: var(--header-height);
    /* Prevent content hiding behind fixed header */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--text-main);
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 700;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --------------------------------------------------------------------------
   3. LAYOUT & UTILITIES
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.text-center {
    text-align: center;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mb-5 {
    margin-bottom: 3rem;
}

/* Grid System */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Responsive Grid */
@media (max-width: 900px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   4. COMPONENTS: BUTTONS
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    /* Combine base transitions for smooth return */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 0.5rem;
    text-align: center;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    /* Isolate button compositing */
    isolation: isolate;
}

.btn:active {
    transform: scale(0.97);
    /* Better click feel */
}

/* Primary Button Base */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Base icon transitions inside buttons */
.btn .icon,
.btn i,
.btn svg,
.btn span.icon-wrapper {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    will-change: transform;
}

/* Base text node transitions */
.btn span:not(.icon) {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    display: inline-block;
}


/* Premium 3D Flight Hover Effect */
.btn-primary:hover {
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
    filter: brightness(1.1);
}

/* Animate Button Content Container on Hover (Push back slightly) */
.btn-primary:hover span:not(.icon) {
    transform: translateX(-5px);
}

/* Animate the Icon (Fly away up and right) */
.btn-primary:hover .icon,
.btn-primary:hover i,
.btn-primary:hover svg {
    /* Translate diagonally and scale slightly for a 3D flying effect */
    transform: translate(6px, -6px) scale(1.1);
    /* Adding a slight rotation creates aerodynamic feel */
    rotate: 15deg;
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--border-medium);
    color: var(--text-main);
}

.btn-secondary:hover {
    border-color: var(--text-muted);
    background: var(--bg-surface-hover);
}

/* Mobile Full Width Buttons */
@media (max-width: 600px) {
    .btn {
        width: 100%;
        display: flex;
    }
}

/* --------------------------------------------------------------------------
   5. COMPONENTS: NAVBAR
   -------------------------------------------------------------------------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-glass);
    backdrop-filter: var(--bg-glass-blur);
    -webkit-backdrop-filter: var(--bg-glass-blur);
    border-bottom: 1px solid var(--border-light);
    z-index: 1000;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.navbar .container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Mobile Menu Toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    padding: 0.5rem;
    cursor: pointer;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-body);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        border-bottom: 1px solid var(--border-light);
        box-shadow: var(--shadow-lg);
        transform: translateY(-150%);
        transition: transform 0.3s ease-in-out;
        z-index: 999;
    }

    .nav-links.active {
        transform: translateY(0);
    }
}

/* --------------------------------------------------------------------------
   6. COMPONENTS: HERO
   -------------------------------------------------------------------------- */
.hero-container {
    padding: 4rem 0;
    text-align: center;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.1) 0%, transparent 60%);
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    background: linear-gradient(135deg, var(--text-main) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
}

.subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

/* Search Box */
.search-box {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 2rem;
    position: relative;
    background: var(--bg-body);
    border: 1px solid var(--border-medium);
    border-radius: 100px;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.search-box:focus-within {
    transform: scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.search-box form {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 1rem;
    font-size: 1.1rem;
    color: var(--text-main);
    outline: none;
}

.search-icon-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary);
}

.hero-cta-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Quick Tools Scroll (Horizontal) */
.quick-tools-section {
    padding: 2rem 0;
    overflow-x: auto;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
}

.quick-tools-scroll {
    display: flex;
    gap: 2rem;
    padding: 0 2rem;
    max-width: 1000px;
    margin: 0 auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* smooth scroll on iOS */
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
}

.quick-tools-scroll::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Chrome/Safari */
}

.quick-tool-card {
    flex: 0 0 auto;
    text-align: center;
    min-width: 80px;
    color: var(--text-muted);
    transition: transform 0.2s ease, color 0.2s ease;
}

.quick-tool-card:hover {
    transform: translateY(-5px);
    color: var(--primary);
}

.quick-tool-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: var(--bg-body);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 0.5rem;
    box-shadow: var(--shadow-sm);
}

.quick-tool-name {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Trending Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* --------------------------------------------------------------------------
   7. COMPONENTS: CARDS
   -------------------------------------------------------------------------- */
/* Base Card Styling */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
    /* Required to clip the spinning border */
    isolation: isolate;
}

/* Base card content needs to be above the effect */
.card>* {
    position: relative;
    z-index: 2;
}

/* Premium Electric Hover Glow */
.card:hover {
    transform: translateY(-5px);
    background: var(--bg-body);
    box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.4), 0 10px 30px -10px rgba(236, 72, 153, 0.4);
}

/* Electric Spinning Neon Beam - High Performance Rotate */
.card::before {
    content: "";
    position: absolute;
    /* Large enough to cover corners while rotating */
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent,
            rgba(99, 102, 241, 0.8),
            transparent 30%,
            transparent 50%,
            var(--secondary) 80%,
            transparent);
    will-change: transform;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -2;
}

/* Inner card mask to carve out the border */
.card::after {
    content: "";
    position: absolute;
    inset: 2px;
    /* Stroke Width */
    background: var(--bg-surface);
    border-radius: calc(var(--radius-lg) - 2px);
    z-index: -1;
    transition: background 0.3s ease;
}

/* Trigger Light on Hover */
.card:hover::before {
    opacity: 1;
    animation: smooth-rotate 4s linear infinite;
}

.card:hover::after {
    background: var(--bg-body);
}

@keyframes smooth-rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.tool-card {
    text-align: center;
}

.tool-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: block;
}

/* 3D Premium Floating Icon Animation on Card Hover */
.tool-icon,
.card>div:first-child {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: block;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), text-shadow 0.3s ease;
    will-change: transform, text-shadow;
    transform-style: preserve-3d;
}

.card:hover .tool-icon,
.card:hover>div:first-child {
    transform: scale(1.2) translateY(-8px) rotate(-5deg);
    text-shadow: 0 10px 20px rgba(99, 102, 241, 0.5), 0 5px 10px rgba(236, 72, 153, 0.4);
}

.tool-name {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.tool-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   8. COMPONENTS: FORMS
   -------------------------------------------------------------------------- */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-main);
    font-family: var(--font-body);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: var(--bg-body);
}

/* Result Box */
.result-box {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    border-top: 4px solid var(--success);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Category Grid (Missing Fix) */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.category-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    background: var(--bg-body);
    color: var(--primary);
}

.category-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: inherit;
    margin: 0;
}

/* Category Hero Styles (New) */
.category-hero {
    text-align: center;
    padding: 3rem 1rem;
    margin-bottom: 2rem;
    background: linear-gradient(to bottom, var(--bg-surface) 0%, transparent 100%);
    border-radius: var(--radius-lg);
}

.category-icon-large {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* --------------------------------------------------------------------------
   9. COMPONENTS: FOOTER
   -------------------------------------------------------------------------- */
footer {
    background: var(--bg-surface);
    padding: 4rem 0 2rem;
    margin-top: 5rem;
    border-top: 1px solid var(--border-light);
    text-align: center;
    color: var(--text-muted);
}

.footer-brand-name {
    font-size: 1.5rem;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    display: flex;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
}

.social-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    border-radius: 50%;
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.social-icon:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 100px;
    transition: all 0.2s ease;
}

.footer-link:hover {
    color: var(--primary);
    background: var(--bg-surface-hover);
    transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   10. PAGE: TOOL LAYOUT
   -------------------------------------------------------------------------- */
.tool-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
}

.tool-content {
    min-width: 0;
}

/* Flex/Grid child overflow fix */
.tool-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 20px);
}

/* Mobile Tool Layout */
@media (max-width: 900px) {
    .tool-layout {
        grid-template-columns: 1fr;
    }

    .tool-sidebar {
        position: static;
        margin-top: 2rem;
    }
}

/* --------------------------------------------------------------------------
   12. CRITICAL MOBILE FIXES & OPTIMIZATIONS
   -------------------------------------------------------------------------- */
/* GLOBAL CONTAINER SYSTEM */
.container,
.hero-content,
.hp-section,
footer .container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

@media (max-width: 600px) {

    .container,
    .hero-content,
    .hp-section,
    footer .container {
        padding-left: 1.25rem;
        /* 20px - Increased from 16px */
        padding-right: 1.25rem;
        /* 20px - Increased from 16px */
    }
}

/* HERO SECTION FIXES */
.hero-container {
    position: relative;
    z-index: 1;
    /* Ensure hero is above background */
    overflow: hidden;
    /* Prevent mesh overflow */
}

/* Ensure content is clickable above any background effects */
.hero-content {
    position: relative;
    z-index: 10;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Mobile Search Bar - Full Width */
@media (max-width: 600px) {
    .hero-container {
        padding: 7rem 1.5rem 4rem;
        /* Increased side padding to 1.5rem (24px) */
        min-height: 85vh;
        display: flex;
        align-items: center;
    }

    .hero-title {
        font-size: 2.5rem;
        /* Responsive H1 */
        line-height: 1.2;
    }

    .search-box {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 1.5rem 0;
        z-index: 20;
        /* Ensure search is clickable */
    }

    .search-box form {
        width: 100%;
    }

    .search-box input {
        width: 100%;
        height: 55px;
        /* Large touch target */
        font-size: 16px;
        /* Prevent iOS zoom */
        padding: 0 1rem;
    }

    .search-icon-btn {
        height: 55px;
        width: 50px;
    }

    /* Fix Explore Tools Button */
    .hero-cta-group {
        width: 100%;
        flex-direction: column;
        gap: 1rem;
        position: relative;
        z-index: 20;
    }

    /* STRICT MARGIN IMPOSITION */
    .hero-title,
    .subtitle,
    .search-box,
    .hero-cta-group {
        width: 100%;
        max-width: 90% !important;
        /* Force 5% margin on each side */
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .btn {
        width: 100%;
        padding: 1rem;
        font-size: 1.1rem;
    }
}

/* ICON TOOL ROW (Quick Tools) - Grid on Mobile */
@media (max-width: 600px) {
    .quick-tools-section {
        overflow: hidden;
        /* Disable horizontal scroll */
        padding: 2rem 1rem;
    }

    .quick-tools-scroll {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        /* 2 Column Mobile */
        gap: 1rem;
        padding: 0;
        overflow: visible;
        flex-wrap: wrap;
        /* Fallback */
    }

    .quick-tool-card {
        width: 100%;
        min-width: 0;
        margin-bottom: 0.5rem;
    }
}

/* NAVBAR FIXES */
.navbar {
    height: 70px;
    /* Fixed height to prevent layout shift */
}

.navbar .container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* TOOL CARDS GRID */
@media (min-width: 1024px) {

    .grid-3,
    .tools-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (max-width: 1023px) and (min-width: 768px) {

    .grid-3,
    .tools-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 767px) {

    .grid-3,
    .tools-grid {
        grid-template-columns: 1fr !important;
    }

    .card {
        height: auto;
    }
}

/* FORMS */
@media (max-width: 600px) {
    .form-group {
        margin-bottom: 1.5rem;
    }

    .tool-layout form button[type="submit"] {
        width: 100%;
        margin-top: 1rem;
        padding: 1rem;
    }
}

/* GLOBAL OVERFLOW FIX */
html,
body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* --------------------------------------------------------------------------
   11. COMPATIBILITY LAYER (Legacy Design System Support)
   -------------------------------------------------------------------------- */
:root {
    /* Spacing Scale (Tailwind-like) */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* Typography Scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;

    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-black: 900;

    /* Variable Mappings */
    --text-primary: var(--text-main);
    --text-secondary: var(--text-muted);
    --text-tertiary: var(--text-light);
    --border-color: var(--border-light);

    /* Legacy Colors */
    --neutral-50: var(--bg-surface);
    --neutral-100: var(--bg-surface-hover);

    --success-light: #dcfce7;
    --success-dark: #166534;

    --info-light: #dbeafe;
    --info-dark: #1e40af;

    --warning-light: #fef3c7;
    --warning-dark: #92400e;

    --danger-light: #fee2e2;
    --danger-dark: #991b1b;
}

[data-theme="dark"] {
    /* Dark Mode Legacy Colors */
    --neutral-50: rgba(255, 255, 255, 0.05);
    --neutral-100: rgba(255, 255, 255, 0.1);

    --success-light: rgba(16, 185, 129, 0.2);
    --success-dark: #34d399;

    --info-light: rgba(59, 130, 246, 0.2);
    --info-dark: #60a5fa;

    --warning-light: rgba(245, 158, 11, 0.2);
    --warning-dark: #fbbf24;

    --danger-light: rgba(239, 68, 68, 0.2);
    --danger-dark: #f87171;
}