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

:root {
    --bg: #020617;
    --bg-elevated: #020817;
    --bg-card: #020617;
    --border-subtle: rgba(148, 163, 184, 0.25);
    --primary: #22c55e;
    --primary-soft: rgba(34, 197, 94, 0.08);
    --primary-strong: rgba(34, 197, 94, 0.6);
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --accent: #22c55e;
    --danger: #fb7185;
    --radius-lg: 16px;
    --radius-full: 999px;
    --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.7);
    --sidebar-width: 170px;
}

html,
body {
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at top, rgba(34, 197, 94, 0.16), transparent 55%),
        radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.18), transparent 55%),
        #020617;
    display: flex;
}

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

/* Layout */
.sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: var(--sidebar-width);
    padding: 20px 14px 18px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.96));
    border-inline-end: 1px solid rgba(30, 64, 175, 0.4);
    box-shadow: 8px 0 40px rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    gap: 18px;
    z-index: 10;
}

.sidebar-logo {
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 0.01em;
    padding-inline: 8px;
    background: linear-gradient(120deg, #e5e7eb, #22c55e, #4ade80);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-section {
    margin-top: 8px;
}

.sidebar-title {
    padding-inline: 8px;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li + li {
    margin-top: 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    margin-inline: 4px;
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 13px;
    transition: background 0.18s ease-out, color 0.18s ease-out, box-shadow 0.18s ease-out, transform 0.08s ease-out;
}

.sidebar-nav a .icon {
    width: 22px;
    text-align: center;
}

.sidebar-nav a:hover {
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-main);
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.55);
    transform: translateY(-1px);
}

.sidebar-nav a.active {
    background: var(--primary-soft);
    color: var(--text-main);
    box-shadow: 0 0 0 1px var(--primary-strong), 0 0 30px rgba(34, 197, 94, 0.25);
}

.main {
    margin-inline-start: var(--sidebar-width);
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 18px 32px 18px;
    backdrop-filter: blur(18px);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.7), transparent);
    border-bottom: 1px solid rgba(30, 64, 175, 0.4);
}

.topbar-title {
    font-size: 20px;
    font-weight: 650;
}

.topbar-subtitle {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
}

.hero-search {
    padding: 20px 32px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.hero-search-tabs {
    display: inline-flex;
    padding: 4px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(55, 65, 81, 0.9);
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.9);
}

.hero-tab {
    border: none;
    outline: none;
    border-radius: 999px;
    padding: 6px 18px;
    font-size: 13px;
    color: var(--text-muted);
    background: transparent;
    cursor: pointer;
    transition: background 0.16s ease-out, color 0.16s ease-out, transform 0.08s ease-out;
}

.hero-tab-active {
    background: radial-gradient(circle at top left, #22c55e, #4ade80);
    color: #020617;
    transform: translateY(-1px);
}

.hero-search-box {
    margin-top: 4px;
    max-width: 640px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 6px 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(55, 65, 81, 0.9);
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 1), rgba(15, 23, 42, 0.96));
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.9);
}

.hero-search-box input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-main);
    font-size: 14px;
    padding: 6px 4px;
}

.hero-search-box input::placeholder {
    color: rgba(148, 163, 184, 0.75);
}

.hero-search-box button {
    border: none;
    outline: none;
    border-radius: 999px;
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 600;
    background: radial-gradient(circle at top left, #22c55e, #4ade80);
    color: #020617;
    cursor: pointer;
    box-shadow: 0 14px 36px rgba(34, 197, 94, 0.6);
    transition: transform 0.08s ease-out, box-shadow 0.14s ease-out, filter 0.12s ease-out;
}

.hero-search-box button:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 18px 44px rgba(34, 197, 94, 0.75);
}

.hero-search-hint {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

.hero-links {
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.hero-links-label {
    opacity: 0.8;
}

.hero-links-hidden {
    display: none;
}

.hero-link {
    border: none;
    outline: none;
    padding: 3px 9px;
    border-radius: 999px;
    background: transparent;
    color: #a5b4fc;
    cursor: pointer;
    transition: background 0.14s ease-out, color 0.14s ease-out;
}

.hero-link:hover {
    color: #c4b5fd;
    background: rgba(15, 23, 42, 0.7);
}

.hero-link-active {
    background: rgba(30, 64, 175, 0.7);
    color: #e5e7eb;
}

.search-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 1), rgba(15, 23, 42, 0.92));
    border-radius: 999px;
    border: 1px solid rgba(55, 65, 81, 0.85);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9);
}

.search-inline input {
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-main);
    font-size: 13px;
    padding: 6px 10px;
    min-width: 230px;
}

.search-inline input::placeholder {
    color: rgba(148, 163, 184, 0.7);
}

.search-inline button {
    border: none;
    outline: none;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: radial-gradient(circle at top left, #22c55e, #4ade80);
    color: #020617;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(34, 197, 94, 0.45);
    transition: transform 0.08s ease-out, box-shadow 0.12s ease-out, filter 0.12s ease-out;
}

.search-inline button:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 16px 40px rgba(34, 197, 94, 0.6);
}

.search-inline button:active {
    transform: translateY(0);
    box-shadow: 0 8px 26px rgba(34, 197, 94, 0.45);
}

.chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 32px 6px;
}

.chip {
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
    border: 1px solid rgba(55, 65, 81, 0.9);
    background: rgba(15, 23, 42, 0.85);
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.16s ease-out, color 0.16s ease-out, border-color 0.16s ease-out, transform 0.08s ease-out;
}

.chip:hover {
    border-color: rgba(148, 163, 184, 0.9);
    color: var(--text-main);
    transform: translateY(-1px);
}

.chip-filled {
    background: var(--primary-soft);
    border-color: var(--primary-strong);
    color: var(--text-main);
}

.section {
    padding: 10px 32px 28px;
    flex: 1;
}

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

.section-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.section-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.tool-card {
    position: relative;
    border-radius: var(--radius-lg);
    padding: 14px 14px 12px;
    background:
        radial-gradient(circle at top left, rgba(15, 23, 42, 1), rgba(15, 23, 42, 0.98)),
        linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.98));
    border: 1px solid rgba(55, 65, 81, 0.9);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transform-origin: center;
    transition: transform 0.14s ease-out, box-shadow 0.16s ease-out, border-color 0.16s ease-out, background 0.16s ease-out;
}

.tool-card:hover {
    transform: translateY(-4px) translateZ(0);
    border-color: var(--primary-strong);
    background:
        radial-gradient(circle at top left, rgba(34, 197, 94, 0.15), rgba(15, 23, 42, 0.98)),
        linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 1));
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.95), 0 0 0 1px rgba(15, 23, 42, 0.9);
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tool-logo {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background:
        radial-gradient(circle at top, rgba(34, 197, 94, 0.32), transparent 60%),
        linear-gradient(145deg, #0f172a, #020617);
    border: 1px solid rgba(55, 65, 81, 0.8);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 1);
}

.tool-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.tool-name {
    font-size: 15px;
    font-weight: 600;
}

.tool-category-pill {
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 11px;
    color: var(--text-muted);
    border: 1px solid rgba(55, 65, 81, 0.9);
    background: rgba(15, 23, 42, 0.85);
}

.tool-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

.tool-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.tool-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-pill {
    border-radius: 999px;
    border: none;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.08s ease-out, box-shadow 0.16s ease-out, filter 0.12s ease-out, background 0.16s ease-out;
}

.btn-primary {
    background: radial-gradient(circle at top left, #22c55e, #4ade80);
    color: #020617;
    box-shadow: 0 14px 36px rgba(34, 197, 94, 0.6);
}

.btn-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 18px 48px rgba(34, 197, 94, 0.75);
}

.btn-ghost {
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-muted);
    border: 1px solid rgba(55, 65, 81, 0.9);
}

.btn-ghost:hover {
    background: rgba(15, 23, 42, 0.96);
    color: var(--text-main);
    border-color: rgba(148, 163, 184, 0.9);
    transform: translateY(-1px);
}

.favorite-active {
    color: #fbbf24;
    border-color: rgba(250, 204, 21, 0.85);
    background: radial-gradient(circle at top, rgba(234, 179, 8, 0.12), rgba(15, 23, 42, 0.96));
}

.favorite-active:hover {
    box-shadow: 0 12px 34px rgba(250, 204, 21, 0.5);
}

.badge-pill {
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(55, 65, 81, 0.9);
    color: var(--text-muted);
}

.badge-featured {
    border-color: rgba(34, 197, 94, 0.85);
    color: #bbf7d0;
    background: rgba(22, 163, 74, 0.18);
}

.footer {
    border-top: 1px solid rgba(30, 64, 175, 0.4);
    padding: 10px 32px 14px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Detail & utility layouts */
.detail-main {
    margin-inline-start: var(--sidebar-width);
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
    display: flex;
    flex-direction: column;
    padding: 26px 32px 28px;
}

.breadcrumb {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.breadcrumb a {
    color: var(--text-muted);
}

.breadcrumb a:hover {
    color: var(--text-main);
}

.detail-shell {
    max-width: 780px;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.detail-heading {
    font-size: 22px;
    font-weight: 650;
}

.detail-meta-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.detail-description {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.detail-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 22px;
}

.detail-section-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.detail-section-body {
    font-size: 13px;
    color: var(--text-muted);
}

.empty-state {
    padding: 42px 28px;
    border-radius: var(--radius-lg);
    border: 1px dashed rgba(55, 65, 81, 0.9);
    background: rgba(15, 23, 42, 0.9);
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* Search */
.search-page-header {
    padding: 22px 32px 10px;
}

.search-input-large {
    margin-top: 12px;
    padding: 9px 16px;
    width: 100%;
    max-width: 520px;
    border-radius: 999px;
    border: 1px solid rgba(55, 65, 81, 0.9);
    background: rgba(15, 23, 42, 0.92);
    color: var(--text-main);
    font-size: 14px;
}

.search-input-large::placeholder {
    color: rgba(148, 163, 184, 0.7);
}

.search-summary {
    padding: 0 32px 8px;
    font-size: 12px;
    color: var(--text-muted);
}

@media (max-width: 900px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        display: none;
    }

    .main,
    .detail-main {
        margin-inline-start: 0;
        width: 100%;
    }

    .topbar {
        padding-inline: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .hero-search,
    .chips-row,
    .section,
    .footer,
    .detail-main,
    .search-page-header,
    .search-summary {
        padding-inline: 16px;
    }

    .search-inline input {
        min-width: 0;
        width: 150px;
    }
}

