/* ================================
   ABYSS NEXUS LAB — Complete Layout
================================ */

:root {
    --bg: #07070a;
    --bg-soft: #0e0e14;
    --card: #12121a;
    --card-hover: #181824;

    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(57, 137, 255, 0.35);

    --text: #f8f8fc;
    --muted: #a1a1aa; /* High contrast for mobile paragraph legibility */

    --accent: #3989ff;
    --accent-light: #8dc9ff;

    --max-width: 1200px;

    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: radial-gradient(circle at 50% -10%, rgba(28, 108, 235, 0.16), transparent 50%), var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

button, input {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

.background-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    top: -300px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(126, 76, 255, 0.09);
    filter: blur(120px);
    pointer-events: none;
    z-index: -1;
}

/* Navbar */
.navbar {
    width: min(var(--max-width), calc(100% - 32px));
    margin: auto;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-symbol {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--accent-light);
    font-size: 20px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-main {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1.8px;
}

.brand-sub {
    font-size: 9px;
    color: var(--accent-light);
    letter-spacing: 3px;
}

.nav-links {
    display: flex;
    gap: 28px;
}

.nav-links a {
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text);
}

.menu-button {
    display: none;
    border: 0;
    background: none;
    color: var(--text);
    font-size: 24px;
}

/* Hero Section */
.hero {
    width: min(840px, calc(100% - 32px));
    margin: 80px auto 60px;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 15px;
    border: 1px solid var(--border);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--accent-light);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #76ffae;
    box-shadow: 0 0 10px rgba(118,255,174,0.8);
}

.hero h1 {
    margin-top: 22px;
    font-size: clamp(38px, 6vw, 68px);
    line-height: 1.05;
    letter-spacing: -2px;
    font-weight: 850;
}

.hero h1 span {
    color: var(--accent-light);
}

.hero p {
    max-width: 580px;
    margin: 20px auto 30px;
    color: var(--muted);
    font-size: 16px;
}

.search-box {
    width: min(620px, 100%);
    height: 56px;
    margin: auto;
    display: flex;
    align-items: center;
    padding: 0 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
    transition: border-color 0.25s, box-shadow 0.25s;
}

.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(57, 137, 255, 0.15);
}

.search-icon {
    color: var(--muted);
    font-size: 20px;
    margin-right: 12px;
}

.search-box input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 15px;
}

.search-box input::placeholder {
    color: #71717a;
}

.search-box kbd {
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted);
    font-size: 11px;
}

/* Sections & Tabs */
.section {
    width: min(var(--max-width), calc(100% - 32px));
    margin: 0 auto 80px;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-label {
    display: block;
    margin-bottom: 4px;
    color: var(--accent-light);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
}

.section-heading h2 {
    font-size: 26px;
    letter-spacing: -0.5px;
}

.tool-counter {
    font-size: 18px;
    color: var(--muted);
    font-weight: 500;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.filter-btn {
    padding: 6px 16px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    transition: 0.2s;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--card-hover);
    color: var(--text);
}

.filter-btn.active {
    border: 1px solid var(--border-hover);
    color: var(--accent-light);
}

/* Category Grid & Cards Alignment Fixes */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.category-card {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
    text-align: left;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card);
    transition: transform 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
    width: 100%;
}

.category-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    margin-left: 14px;
    flex: 1;
}

.category-info h3 {
    margin-top: 0;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
}

.category-info p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
}

.category-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(57, 137, 255, 0.12);
    color: var(--accent-light);
    font-size: 19px;
    font-weight: 700;
}

/* Additional SVG & Icon Polish */
.tool-icon svg, 
.category-icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--accent-light);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brand-symbol img {
    display: block;
    border-radius: 6px;
}

/* Category card active highlight state */
.category-card {
    transition: all 0.25s ease;
}

.arrow {
    position: absolute;
    right: 18px;
    top: 18px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 15px;
    transition: color 0.2s, transform 0.2s;
}

.category-card:hover {
    transform: translateY(-3px);
    background: var(--card-hover);
    border-color: var(--border-hover);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

.category-card:hover .arrow {
    color: var(--accent-light);
    transform: translate(2px, -2px);
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.tool-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 22px;
    text-align: left;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card);
    transition: transform 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.tool-card:hover {
    transform: translateY(-3px);
    background: var(--card-hover);
    border-color: var(--border-hover);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

.tool-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(57, 137, 255, 0.12);
    color: var(--accent-light);
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 16px;
}

.tool-icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--accent-light);
}

.tool-category {
    color: var(--accent-light);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.tool-content h3 {
    margin-top: 4px;
    font-size: 16px;
    font-weight: 600;
}

.tool-content p {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.tool-arrow {
    position: absolute;
    right: 18px;
    top: 18px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 15px;
    transition: color 0.2s, transform 0.2s;
}

.tool-card:hover .tool-arrow {
    color: var(--accent-light);
    transform: translate(2px, -2px);
}

/* Load More & Utilities */
.load-more-container {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.load-more-btn {
    padding: 12px 28px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    color: var(--accent-light);
    font-weight: 600;
    font-size: 14px;
    transition: 0.2s;
}

.load-more-btn:hover {
    background: var(--card-hover);
    border-color: var(--border-hover);
}

.no-results {
    display: none;
    padding: 50px 0;
    text-align: center;
    color: var(--muted);
    font-size: 15px;
}

/* About & Footer */
.about-section {
    width: min(var(--max-width), calc(100% - 32px));
    margin: 0 auto 80px;
    padding: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: radial-gradient(circle at 80% 50%, rgba(57,137,255,0.08), transparent 45%), var(--card);
}

.about-content h2 {
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.1;
    letter-spacing: -1.5px;
}

.about-content h2 span {
    color: var(--accent-light);
}

.about-content p {
    margin-top: 16px;
    color: var(--muted);
    font-size: 14px;
}

.about-stats {
    display: flex;
    gap: 36px;
}

.about-stats div {
    display: flex;
    flex-direction: column;
}

.about-stats strong {
    font-size: 32px;
    color: var(--accent-light);
    line-height: 1;
}

.about-stats span {
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
}

/* ================================
   Notice & Bug Report Section
================================ */
.notice-section {
    width: min(var(--max-width), calc(100% - 32px));
    margin: -40px auto 80px; /* Pulls slightly closer to About section */
    padding: 28px 36px;
    border: 1px solid rgba(57, 137, 255, 0.2);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(57, 137, 255, 0.05) 0%, rgba(18, 18, 26, 0.8) 100%);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.notice-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-light);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(57, 137, 255, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(57, 137, 255, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(57, 137, 255, 0); }
}

.notice-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.notice-text h3 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.notice-text p {
    margin-top: 6px;
    color: var(--muted);
    font-size: 14px;
    max-width: 720px;
    line-height: 1.5;
}

.report-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    border: 1px solid var(--border-hover);
    border-radius: 12px;
    background: rgba(57, 137, 255, 0.1);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.25s ease;
}

.report-btn:hover {
    background: var(--accent);
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(57, 137, 255, 0.3);
}

.btn-icon {
    font-size: 16px;
}

/* Updated SVG icon styling */
.report-btn .btn-icon {
    width: 16px;
    height: 16px;
    stroke: var(--accent-light); /* Sets default icon color to UI accent theme */
    transition: stroke 0.25s ease;
}

/* Adapts icon color to dark text when button is hovered */
.report-btn:hover .btn-icon {
    stroke: #000000;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .notice-section {
        margin-top: -50px;
        padding: 24px;
    }

    .notice-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .report-btn {
        width: 100%;
        justify-content: center;
    }
}

footer {
    width: min(var(--max-width), calc(100% - 32px));
    margin: auto;
    padding: 30px 0 40px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-brand .brand-symbol {
    width: 32px;
    height: 32px;
    font-size: 16px;
}

.footer-brand strong {
    font-size: 11px;
    letter-spacing: 1px;
}

.footer-brand span {
    color: var(--muted);
    font-size: 10px;
}

.footer-links {
    display: flex;
    gap: 22px;
}

.footer-links a,
.copyright {
    color: var(--muted);
    font-size: 12px;
}

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

/* Responsive Breakpoints */
@media (min-width: 1200px) {
    .tools-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .about-section {
        flex-direction: column;
        align-items: flex-start;
        padding: 32px;
    }
}

@media (max-width: 600px) {
    .navbar {
        height: 64px;
    }

    .menu-button {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 64px;
        left: 16px;
        right: 16px;
        display: none;
        flex-direction: column;
        padding: 8px;
        border: 1px solid var(--border);
        border-radius: 13px;
        background: #0d0d12;
        z-index: 10;
    }

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

    .nav-links a {
        padding: 12px;
    }

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

    .category-card {
        padding: 16px;
    }

    footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==================================================================
   ULTRA NATIVE MOBILE APP MODE (@media max-width: 768px)
   ================================================================== */

/* Hide mobile-only components on desktop */
.mobile-bottom-nav,
.mobile-app-sheet-backdrop {
    display: none;
}

@media (max-width: 768px) {

    /* Lock down background & overflow for app-like viewport */
    html {
        background: #08080c;
        overscroll-behavior-y: none;
    }

    body {
        padding-top: 60px;
        padding-bottom: 70px;
        background: #08080c;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        -webkit-touch-callout: none;
    }

    /* Top App Header Bar */
    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 56px;
        padding: 0 16px;
        background: rgba(10, 10, 15, 0.88);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        z-index: 1000;
        width: 100%;
    }

    .menu-button, 
    .nav-links,
    footer {
        display: none !important; /* Hides website footer & desktop menu on mobile */
    }

    /* Hero Section Refinement */
    .hero {
        width: calc(100% - 24px);
        margin: 12px auto 20px;
        padding: 18px 16px;
        border-radius: 18px;
        background: linear-gradient(180deg, rgba(57, 137, 255, 0.1) 0%, rgba(18, 18, 26, 0.5) 100%);
        border: 1px solid rgba(255, 255, 255, 0.08);
        text-align: left;
    }

    .hero-badge {
        font-size: 8.5px;
        padding: 4px 10px;
    }

    .hero h1 {
        font-size: 26px;
        letter-spacing: -0.8px;
        margin-top: 12px;
        line-height: 1.15;
    }

    .hero p {
        font-size: 12.5px;
        margin: 8px 0 16px;
    }

    /* App Sticky Search Bar */
    .search-box {
        position: sticky;
        top: 64px;
        z-index: 900;
        height: 46px;
        border-radius: 12px;
        background: rgba(22, 22, 32, 0.95);
        border: 1px solid rgba(57, 137, 255, 0.25);
        backdrop-filter: blur(12px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    }

    .search-box kbd {
        display: none;
    }

    /* Section Headers & Horizontal Tabs */
    .section {
        width: calc(100% - 24px);
        margin: 0 auto 28px;
    }

    .section-heading h2 {
        font-size: 18px;
    }

    .filter-tabs {
        width: 100%;
        overflow-x: auto;
        padding: 3px;
        border-radius: 10px;
        scrollbar-width: none;
    }

    .filter-tabs::-webkit-scrollbar {
        display: none;
    }

    /* App Cards (2-Column Compact Grid) */
    .category-grid,
    .tools-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .category-card,
    .tool-card {
        padding: 12px;
        border-radius: 14px;
        background: #12121a;
        border: 1px solid rgba(255, 255, 255, 0.06);
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        min-height: 115px;
        transition: transform 0.12s ease, background 0.12s ease;
    }

    .category-card:active,
    .tool-card:active {
        transform: scale(0.95);
        background: #1a1a26;
        border-color: var(--accent);
    }

    .category-icon,
    .tool-icon {
        width: 34px;
        height: 34px;
        border-radius: 8px;
        margin-bottom: 6px;
    }

    .category-info,
    .tool-content {
        display: flex;
        flex-direction: column;
    }

    .category-info h3,
    .tool-content h3 {
        font-size: 12.5px;
        font-weight: 700;
        line-height: 1.2;
    }

    .category-info p,
    .tool-content p {
        font-size: 10.5px;
        line-height: 1.3;
        margin-top: 3px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .arrow, .tool-arrow {
        display: none;
    }

    /* Hide redundant long web sections on mobile app view */
    .about-section,
    .notice-section {
        display: none !important;
    }

    /* Fixed Native Bottom Bar */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: rgba(12, 12, 18, 0.94);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        display: flex;
        align-items: center;
        justify-content: space-around;
        padding-bottom: max(0px, env(safe-area-inset-bottom));
        z-index: 1000;
    }

    .mobile-bottom-nav .nav-item {
        background: none;
        border: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: #71717a;
        font-size: 9.5px;
        font-weight: 600;
        width: 25%;
        height: 100%;
        transition: color 0.15s ease, transform 0.15s ease;
    }

    .mobile-bottom-nav .nav-item:active {
        transform: scale(0.9);
    }

    .mobile-bottom-nav .nav-item.active {
        color: var(--accent-light);
    }

    .mobile-bottom-nav .nav-item.active svg {
        stroke: var(--accent-light);
    }

    /* Native Mobile Slide-Up App Sheet (Replaces Web Footer) */
    .mobile-app-sheet-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.65);
        backdrop-filter: blur(6px);
        z-index: 2000;
        display: flex;
        align-items: flex-end;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .mobile-app-sheet-backdrop.active {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-app-sheet {
        width: 100%;
        background: #12121a;
        border-radius: 24px 24px 0 0;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        padding: 12px 20px 32px;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .mobile-app-sheet-backdrop.active .mobile-app-sheet {
        transform: translateY(0);
    }

    .sheet-drag-handle {
        width: 36px;
        height: 4px;
        border-radius: 2px;
        background: rgba(255, 255, 255, 0.2);
        margin: 0 auto 14px;
    }

    .sheet-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 20px;
    }

    .sheet-close-btn {
        background: rgba(255, 255, 255, 0.08);
        border: 0;
        color: var(--text);
        width: 30px;
        height: 30px;
        border-radius: 50%;
        font-size: 14px;
    }

    .app-info-card {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 16px;
        padding: 16px;
        margin-bottom: 16px;
    }

    .app-info-card h4 {
        font-size: 15px;
        margin: 4px 0 6px;
    }

    .app-info-card p {
        font-size: 12px;
        color: var(--muted);
        line-height: 1.4;
    }

    .app-metrics {
        display: flex;
        justify-content: space-between;
        margin-top: 14px;
        padding-top: 12px;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }

    .app-metrics strong {
        display: block;
        font-size: 16px;
        color: var(--accent-light);
    }

    .app-metrics span {
        font-size: 10px;
        color: var(--muted);
    }

    .sheet-action-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 14px;
        border-radius: 14px;
        background: var(--accent);
        color: #000;
        font-size: 13.5px;
        font-weight: 700;
        text-align: center;
    }

    .sheet-copyright {
        text-align: center;
        margin-top: 18px;
        font-size: 11px;
        color: var(--muted);
    }
}
