/* ============================================
   DESIGN TOKENS & GLOBAL VARIABLES
   ============================================ */
:root {
    --bg: #f0f4ff;
    --surface: #ffffff;
    --surface-2: #f8faff;
    --text-primary: #0d1117;
    --text-secondary: #5a6478;
    --text-muted: #8a94a6;
    --primary: #4f6ef7;
    --primary-dark: #3856e8;
    --primary-light: rgba(79, 110, 247, 0.1);
    --purple: #8b5cf6;
    --pink: #ec4899;
    --green: #10b981;
    --amber: #f59e0b;
    --border: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.06);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg: #060d1f;
    --surface: #0f1a2e;
    --surface-2: #182238;
    --text-primary: #eef2ff;
    --text-secondary: #8397b8;
    --text-muted: #5a6f8e;
    --border: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* ============================================
   BASE RESET
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    transition: background-color 0.35s, color 0.35s;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 2.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

[data-theme="dark"] .navbar {
    background: rgba(6, 13, 31, 0.85);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(79, 110, 247, 0.4);
}

.logo span {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.search-bar {
    flex: 1;
    max-width: 480px;
    display: flex;
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 0.65rem 1.25rem;
    gap: 0.75rem;
    transition: var(--transition);
}

.search-bar:focus-within {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(79, 110, 247, 0.12);
}

.search-bar i {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.theme-toggle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.05);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    position: relative;
    min-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 5rem 2.5rem;
}

/* Animated blob backgrounds */
.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    pointer-events: none;
    animation: blobFloat 12s ease-in-out infinite alternate;
}

[data-theme="dark"] .bg-blob {
    opacity: 0.22;
}

.blob-1 {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(79, 110, 247, 0.6), transparent 70%);
    top: -200px;
    left: -150px;
    animation-delay: 0s;
}

.blob-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.7), transparent 70%);
    bottom: -200px;
    right: -100px;
    animation-delay: -4s;
}

.blob-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.5), transparent 70%);
    top: 50%;
    right: 25%;
    animation-delay: -8s;
}

@keyframes blobFloat {
    0% {
        transform: translate(0px, 0px) scale(1);
    }

    100% {
        transform: translate(30px, -30px) scale(1.12);
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 640px;
    text-align: center;
}

.badge-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(79, 110, 247, 0.1);
    border: 1px solid rgba(79, 110, 247, 0.3);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1.2rem;
    border-radius: 99px;
    margin-bottom: 1.75rem;
    backdrop-filter: blur(4px);
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    line-height: 1.12;
    letter-spacing: -2px;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--purple), var(--pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 520px;
    margin: 0 auto 2.5rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: white;
    padding: 0.9rem 2rem;
    border-radius: 99px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(79, 110, 247, 0.4);
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(79, 110, 247, 0.5);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--surface);
    color: var(--text-primary);
    padding: 0.9rem 2rem;
    border-radius: 99px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    border: 1px solid var(--border);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

/* Floating Cards in Hero */
.hero-visual {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

.float-card {
    position: absolute;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(8px);
    white-space: nowrap;
    animation: floatUp 6s ease-in-out infinite;
}

[data-theme="dark"] .float-card {
    background: rgba(15, 26, 46, 0.8);
}

.float-card i {
    font-size: 1.1rem;
    color: var(--primary);
}

.fc-1 {
    top: 10%;
    left: 3%;
    animation-delay: 0s;
}

.fc-2 {
    top: 25%;
    right: 4%;
    animation-delay: -1.5s;
}

.fc-3 {
    bottom: 22%;
    left: 4%;
    animation-delay: -2s;
}

.fc-4 {
    bottom: 12%;
    right: 6%;
    animation-delay: -3s;
}

.fc-5 {
    top: 50%;
    left: 2%;
    animation-delay: -4s;
}

.fc-6 {
    top: 60%;
    right: 2%;
    animation-delay: -0.5s;
}

@keyframes floatUp {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-14px);
    }
}

/* ============================================
   STATS SECTION
   ============================================ */
.stats-section {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
}

.stat-item {
    flex: 1;
    min-width: 160px;
    text-align: center;
    padding: 2.5rem 2rem;
}

.stat-number {
    font-size: 2.75rem;
    font-weight: 900;
    letter-spacing: -1.5px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 0.25rem;
}

.stat-divider {
    width: 1px;
    height: 60px;
    background: var(--border);
    flex-shrink: 0;
}

/* ============================================
   SECTION HEADINGS
   ============================================ */
.section-heading {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-heading h2 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

.section-heading p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ============================================
   CATEGORY SHOWCASE CARDS
   ============================================ */
.categories-showcase {
    padding: 5rem 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.category-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cat-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.cat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: var(--transition);
}

.cat-card:hover {
    transform: translateX(6px);
    box-shadow: var(--shadow-md);
}

.cat-card:hover::before {
    opacity: 1;
}

/* Category-specific accent colors */
.cat-text .cat-icon {
    background: rgba(79, 110, 247, 0.12);
    color: #4f6ef7;
}

.cat-text:hover {
    border-color: #4f6ef7;
}

.cat-math .cat-icon {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.cat-math:hover {
    border-color: #10b981;
}

.cat-dev .cat-icon {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.cat-dev:hover {
    border-color: #f59e0b;
}

.cat-social .cat-icon {
    background: rgba(236, 72, 153, 0.12);
    color: #ec4899;
}

.cat-social:hover {
    border-color: #ec4899;
}

.cat-daily .cat-icon {
    background: rgba(139, 92, 246, 0.12);
    color: #8b5cf6;
}

.cat-daily:hover {
    border-color: #8b5cf6;
}

.cat-icon {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.cat-info {
    flex: 1;
}

.cat-info h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.cat-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.cat-arrow {
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.cat-card:hover .cat-arrow {
    color: var(--text-primary);
    transform: translateX(4px);
}

/* ============================================
   TOOLS SECTION
   ============================================ */
.tools-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 5rem 2.5rem;
}

/* Filter Tabs */
.categories-filter {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    margin-bottom: 2.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.categories-filter::-webkit-scrollbar {
    height: 4px;
}

.categories-filter::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 10px;
}

.filter-btn {
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.65rem 1.35rem;
    border-radius: 99px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    font-family: inherit;
    box-shadow: var(--shadow-sm);
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(79, 110, 247, 0.35);
}

/* Tool Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1.25rem;
}

/* Tool Card */
.tool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.tool-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--purple));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(79, 110, 247, 0.3);
}

.tool-card:hover::after {
    transform: scaleX(1);
}

.tool-header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tool-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.tool-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.3rem 0.8rem;
    border-radius: 99px;
    background: var(--surface-2);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.tool-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
}

.tool-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    flex-grow: 1;
}

.tool-cta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    text-align: center;
    padding: 3rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.75rem;
}

.footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--surface);
    width: 100%;
    max-width: 540px;
    border-radius: var(--radius-xl);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.25);
    transform: translateY(30px) scale(0.96);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    border: 1px solid var(--border);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.modal-title-text h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.modal-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.close-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.close-btn:hover {
    background: var(--border);
    transform: rotate(90deg);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
}

.modal-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.input-group {
    margin-bottom: 1.1rem;
}

.input-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.85rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
}

textarea.form-control {
    resize: vertical;
    min-height: 110px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(79, 110, 247, 0.12);
}

.result-box {
    margin-top: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
    display: none;
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-box.active {
    display: block;
}

.result-label {
    padding: 0.65rem 1.1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.result-content {
    padding: 1.25rem;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 280px;
    overflow-y: auto;
    background: var(--surface);
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.action-btn {
    padding: 0.9rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
}

.generate-btn {
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: white;
    box-shadow: 0 4px 16px rgba(79, 110, 247, 0.35);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 110, 247, 0.45);
}

.generate-btn:active {
    transform: translateY(0);
}

.result-actions {
    display: flex;
    gap: 0.75rem;
}

.secondary-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    flex: 1;
}

.secondary-btn:hover {
    background: var(--surface-2);
    border-color: var(--text-muted);
}

/* ============================================
   TOAST
   ============================================ */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 0.9rem 2rem;
    border-radius: 99px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ============================================
   HTML LIVE COMPILER
   ============================================ */

/* Widen the modal for compiler */
.modal-overlay:has(#comp-preview) .modal-content {
    max-width: 700px;
}

.compiler-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    background: var(--surface-2);
    padding: 0.4rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.comp-tab {
    flex: 1;
    padding: 0.55rem 0.75rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.comp-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(79, 110, 247, 0.3);
}

.comp-tab:not(.active):hover {
    background: var(--surface);
    color: var(--text-primary);
}

.compiler-area {
    min-height: 150px;
    max-height: 200px;
    font-family: 'Courier New', 'Fira Code', monospace !important;
    font-size: 0.88rem !important;
    line-height: 1.7;
    background: #0d1117 !important;
    color: #c9d1d9 !important;
    border-color: #30363d !important;
    border-radius: var(--radius-md) !important;
    padding: 1rem !important;
    resize: vertical;
}

.compiler-area:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.15) !important;
    background: #0d1117 !important;
}

.compiler-preview-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin: 1rem 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.compiler-preview-label::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 4px var(--green);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.compiler-preview {
    width: 100%;
    height: 220px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: white;
    display: block;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .navbar {
        padding: 0.85rem 1.25rem;
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .search-bar {
        order: 3;
        max-width: 100%;
    }

    .hero-section {
        padding: 4rem 1.25rem;
        min-height: 70vh;
    }

    .hero-title {
        letter-spacing: -1px;
    }

    .fc-1,
    .fc-3,
    .fc-5 {
        display: none;
    }

    .fc-2 {
        top: 8%;
        right: 2%;
    }

    .fc-4 {
        bottom: 8%;
        right: 2%;
    }

    .fc-6 {
        bottom: 30%;
        right: 2%;
    }

    .stat-divider {
        display: none;
    }

    .stats-section {
        gap: 0;
    }

    .stat-item {
        min-width: 50%;
        border: 1px solid var(--border);
    }

    .categories-showcase {
        padding: 2.5rem 1.25rem;
    }

    .cat-card {
        padding: 1.1rem 1.25rem;
    }

    .tools-section {
        padding: 2.5rem 1rem;
    }

    .modal-content {
        max-height: 100%;
        border-radius: var(--radius-lg);
    }

    .modal-footer {
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }
}

@media (max-width: 480px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}