/* =========================================
   1. CORE VARIABLES & BASE STYLES
   ========================================= */
:root {
    --primary-blue: #2563a8;
    --primary-blue-dark: #1e4a7d;
    --primary-blue-light: #3b82f6;
    --secondary-grey: #e5e7eb;
    --secondary-grey-dark: #9ca3af;
    --white: #ffffff;
    --black: #111827;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 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);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background-color: #f9fafb;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* =========================================
   2. HEADER & NAV
   ========================================= */
.header {
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    width: 60px;
    height: 60px;
}

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 0.125rem;
}

.logo-text p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    max-width: 280px;
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.938rem;
    transition: color 0.2s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-blue);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-blue);
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.theme-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* =========================================
   3. HERO SECTION
   ========================================= */
.hero {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: var(--white);
    padding: 3rem 0;
    position: relative;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjUwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0wIDI1aDUwbDEwLTIwIDEwIDQwbDEwLTIwaDUwIiBzdHJva2U9IndoaXRlIiBmaWxsPSJub25lIiBvcGFjaXR5PSIwLjEiLz48L3N2Zz4=');
    background-repeat: repeat-x;
    background-position: center;
    opacity: 0.2;
    mask-image: linear-gradient(to right, transparent, black, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black, transparent);
}

.hero-content {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    opacity: 0.95;
    line-height: 1.7;
    max-width: 700px;
    margin: 0 auto;
}

/* =========================================
   4. TOOLS SECTION & CONTROLS
   ========================================= */
.tools-section {
    padding: 4rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Updated Search Container (Merged New & Old) */
.search-container {
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
}

.search-box {
    position: relative;
    max-width: 600px;
    width: 100%;
    margin: 0 auto 2rem;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 168, 0.1);
}

/* New Controls Row (For Filter Buttons & Tags) */
.controls-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.625rem 1.25rem;
    border: 2px solid var(--border-color);
    background-color: var(--white);
    color: var(--text-primary);
    border-radius: 2rem;
    font-size: 0.938rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.filter-btn.active {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white);
}

/* Tag Select Styling (New) */
.tag-filter-container {
    position: relative;
    min-width: 200px;
}

.tag-select {
    width: 100%;
    padding: 0.625rem 2rem 0.625rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 2rem;
    background-color: var(--white);
    color: var(--text-primary);
    font-size: 0.938rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%232563a8%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 0.65em auto;
    transition: all 0.2s ease;
}

.tag-select:focus, .tag-select:hover {
    border-color: var(--primary-blue);
    outline: none;
}

/* =========================================
   5. TOOL GRIDS & CARDS
   ========================================= */
.tools-grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.category-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin: 2rem 0 1.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
}

.category-section-title::before {
    content: '';
    width: 6px;
    height: 24px;
    background-color: var(--primary-blue);
    border-radius: 3px;
    margin-right: 0.75rem;
}

.tool-card {
    background-color: var(--white);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue-light), var(--primary-blue));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
    z-index: 1;
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -10px rgba(37, 99, 168, 0.3);
    border-color: var(--primary-blue-light);
}

.tool-card.featured {
    border: 2px solid var(--primary-blue);
}

/* BETA Badge */
.beta-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: var(--white);
    padding: 0.375rem 0.75rem;
    border-radius: 1.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(217, 119, 6, 0.3);
    z-index: 5;
    letter-spacing: 0.05em;
}

.tool-card.featured::after {
    content: 'Featured';
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, var(--primary-blue-light) 0%, var(--primary-blue) 100%);
    color: var(--white);
    padding: 0.375rem 1rem;
    border-radius: 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(37, 99, 168, 0.3);
    z-index: 2;
}

.tool-card.featured:has(.beta-badge)::after {
    right: 4.5rem;
    background: rgba(37, 99, 168, 0.1);
    color: var(--primary-blue);
    box-shadow: none;
    border: 1px solid var(--primary-blue);
}

/* Tool Screenshot & Fallbacks */
.tool-screenshot {
    position: relative;
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, rgba(37, 99, 168, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-screenshot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.tool-card:hover .tool-screenshot img {
    transform: scale(1.05);
}

.tool-screenshot-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tool-card:hover .tool-screenshot-overlay {
    opacity: 1;
}

.tool-icon-small {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-blue-light) 0%, var(--primary-blue) 100%);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 99, 168, 0.4);
}

.tool-icon-small svg {
    width: 20px;
    height: 20px;
    color: var(--white);
}

/* Default Fallback */
.tool-screenshot.no-screenshot {
    background: linear-gradient(135deg, var(--primary-blue-light) 0%, var(--primary-blue) 100%);
}

.tool-screenshot.no-screenshot img {
    display: none;
}

/* Category-Specific Fallbacks (New) */
.tool-card[data-category="Live Tools"] .tool-screenshot.no-screenshot {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
}

.tool-card[data-category="Simulation"] .tool-screenshot.no-screenshot {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
}

.tool-card[data-category="Education & Advisory"] .tool-screenshot.no-screenshot {
    background: linear-gradient(135deg, var(--primary-blue-light) 0%, var(--primary-blue) 100%);
}

.tool-screenshot.no-screenshot .tool-screenshot-overlay {
    opacity: 1;
    background: transparent;
    align-items: center;
    justify-content: center;
}

.tool-screenshot.no-screenshot .tool-icon-small {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.tool-card[data-category="Live Tools"] .tool-screenshot.no-screenshot .tool-icon-small {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.4);
}

.tool-screenshot.no-screenshot .tool-icon-small svg {
    width: 30px;
    height: 30px;
}

/* Tool Content */
.tool-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.tool-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.tool-description {
    font-size: 0.938rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.tool-category {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(37, 99, 168, 0.1), rgba(59, 130, 246, 0.1));
    color: var(--primary-blue);
    border-radius: 0.5rem;
    font-size: 0.813rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border: 1px solid rgba(37, 99, 168, 0.2);
}

.tool-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, var(--primary-blue-light) 0%, var(--primary-blue) 100%);
    color: var(--white);
    text-decoration: none;
    border-radius: 0.625rem;
    font-weight: 600;
    font-size: 0.938rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 99, 168, 0.3);
    position: relative;
    overflow: hidden;
}

.tool-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.tool-link:hover::before {
    left: 100%;
}

.tool-link:hover {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 168, 0.4);
}

.tool-link svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.tool-link:hover svg {
    transform: translateX(4px);
}

/* =========================================
   6. MISC SECTIONS (About, Media, Footer)
   ========================================= */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.no-results svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* About Section */
.about-section {
    background-color: var(--white);
    padding: 4rem 0;
}

.about-content {
    max-width: 1100px;
    margin: 0 auto;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.about-card {
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: 0.75rem;
    background-color: #f9fafb;
    transition: all 0.3s ease;
}

.about-card:hover {
    background-color: var(--white);
    box-shadow: var(--shadow-lg);
}

.about-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-blue-light) 0%, var(--primary-blue) 100%);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.about-icon svg {
    color: var(--white);
}

.about-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.about-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Footer */
.footer {
    background-color: var(--primary-blue-dark);
    color: var(--white);
    padding: 3rem 0 1.5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
}

.footer-text {
    font-size: 0.938rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.footer-email-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.footer-email-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.625rem;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.footer-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
}

.governance-section {
    margin-bottom: 1.5rem;
}

.report-issue-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #dc2626;
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(220, 38, 38, 0.2);
}

.report-issue-btn:hover {
    background-color: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(220, 38, 38, 0.3);
}

.disclaimer-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 800px;
    margin: 0 auto 1rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    line-height: 1.5;
}

.footer-bottom p {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* =========================================
   7. MODAL STYLES
   ========================================= */
.tool-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tool-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.tool-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.tool-modal-container {
    position: relative;
    width: 95vw;
    height: 95vh;
    max-width: 1600px;
    background: var(--white);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.tool-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tool-modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tool-modal-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
}

.tool-modal-actions {
    display: flex;
    gap: 0.5rem;
}

.tool-modal-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    color: var(--white);
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.tool-modal-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.tool-modal-btn svg {
    pointer-events: none;
}

.tool-modal-close:hover {
    background: rgba(220, 38, 38, 0.2);
    border-color: rgba(220, 38, 38, 0.4);
}

.tool-modal-content {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #f9fafb;
}

.tool-modal-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--white);
    z-index: 10;
    transition: opacity 0.3s ease;
}

.tool-modal-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(37, 99, 168, 0.1);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.tool-modal-loader p {
    color: var(--text-secondary);
    font-size: 0.938rem;
}

.tool-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: var(--white);
}

/* =========================================
   8. RESPONSIVE DESIGN & DARK MODE
   ========================================= */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        gap: 1rem;
    }

    .logo-text p {
        font-size: 0.688rem;
    }

    .hero {
        padding: 3.5rem 0;
    }

    .hero-title {
        font-size: 2rem;
    }
    
    /* New: Stack controls on mobile */
    .controls-row {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .tag-filter-container {
        width: 100%;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

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

    .tools-grid-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .filter-buttons {
        gap: 0.5rem;
    }

    .filter-btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }

    .tool-modal-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .tool-modal-header {
        padding: 0.875rem 1rem;
    }

    .tool-modal-title {
        font-size: 1rem;
    }

    .tool-modal-btn {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .logo {
        width: 50px;
        height: 50px;
    }

    .logo-text h1 {
        font-size: 1.25rem;
    }

    .hero {
        padding: 2.5rem 0;
    }

    .hero-badge {
        font-size: 0.75rem;
        padding: 0.375rem 1rem;
    }

    .hero-title {
        font-size: 1.625rem;
    }

    .hero-subtitle {
        font-size: 0.938rem;
    }

    .tool-card {
        padding: 1.5rem;
    }

    .tool-name {
        font-size: 1.125rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-card {
    animation: fadeIn 0.5s ease-out;
}

/* Dark Mode Overrides */
body.dark-mode {
    --primary-blue: #3b82f6;
    --primary-blue-dark: #60a5fa;
    --white: #1f2937;
    --black: #f9fafb;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --border-color: #374151;
    background-color: #111827;
}

body.dark-mode .tool-card, 
body.dark-mode .header,
body.dark-mode .tool-modal-container {
    background-color: #1f2937;
    border-color: #374151;
}

body.dark-mode .about-card {
    background-color: #1f2937;
    border-color: #374151;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

body.dark-mode .about-section {
    background-color: #111827;
    border-color: #374151;
}

body.dark-mode .nav-link {
    color: #e5e7eb;
}

body.dark-mode .search-input {
    background-color: #111827;
    color: white;
}

/* Dark mode for new tag selector */
body.dark-mode .tag-select {
    background-color: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}

body.dark-mode .tag-select:focus {
    border-color: var(--primary-blue);
}

body.dark-mode .filter-btn {
    background-color: #1f2937;
    color: #e5e7eb;
}

body.dark-mode .filter-btn:hover {
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

body.dark-mode .filter-btn.active {
    background-color: var(--primary-blue);
    color: white;
}

body.dark-mode .tool-card:hover {
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

body.dark-mode .tool-modal-content,
body.dark-mode .tool-modal-loader,
body.dark-mode .tool-iframe {
    background-color: #111827;
}

body.dark-mode .theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
