/* ===== TOOLS PAGE STYLES ===== */

html, body { height: 100%; overflow: hidden; }

/* ===== LAYOUT ===== */
.app-container {
    position: relative; z-index: 1;
    display: flex; height: calc(100vh - var(--nav-h));
    margin-top: var(--nav-h);
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-w); min-width: var(--sidebar-w);
    height: 100%; display: flex; flex-direction: column;
    background: rgba(255, 255, 255, 0.03);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 300ms var(--ease-out-expo);
}

.sidebar-header {
    padding: 1.2rem 1.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-title {
    font-family: var(--font-display); font-size: 0.7rem; font-weight: 700;
    letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted);
}

.sidebar-search {
    margin-top: 10px; width: 100%; padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px; outline: none; color: var(--white);
    font-family: var(--font-body); font-size: 0.82rem;
    transition: border-color 200ms ease, background 200ms ease;
}
.sidebar-search::placeholder { color: rgba(154,143,181,0.4); }
.sidebar-search:focus { border-color: rgba(166,110,247,0.3); background: rgba(255,255,255,0.08); }

.cat-list { flex: 1; overflow-y: auto; padding: 0.6rem; display: flex; flex-direction: column; gap: 2px; }
.cat-group { margin-bottom: 4px; }

.cat-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: 10px; cursor: pointer;
    border: 1px solid transparent; font-family: var(--font-body);
    transition: background 200ms ease, border-color 200ms ease; user-select: none;
}
.cat-item:hover { background: rgba(255, 255, 255, 0.04); }
.cat-item.active {
    background: linear-gradient(135deg, rgba(166,110,247,0.18), rgba(92,200,223,0.1));
    border-color: rgba(255, 255, 255, 0.1);
}

.cat-icon {
    width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 0.9rem;
}

.cat-name { font-size: 0.82rem; font-weight: 600; color: var(--white); flex: 1; }

.cat-count {
    font-size: 0.68rem; color: var(--muted); font-weight: 500;
    padding: 1px 8px; border-radius: 8px; background: rgba(255,255,255,0.04);
}

.cat-arrow { color: var(--muted); font-size: 0.7rem; transition: transform 250ms ease; }
.cat-item.expanded .cat-arrow { transform: rotate(90deg); }

.sub-list {
    max-height: 0; overflow: hidden;
    transition: max-height 300ms var(--ease-out-expo); padding-left: 20px;
}
.sub-list.show { max-height: 400px; }

.sub-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: 8px; cursor: pointer;
    transition: background 200ms ease, color 200ms ease;
    color: var(--muted); font-size: 0.78rem; font-weight: 500;
}
.sub-item:hover { background: rgba(255,255,255,0.04); color: var(--white); }
.sub-item.active { color: var(--neon-cyan); background: rgba(92,200,223,0.08); }
.sub-dot {
    width: 4px; height: 4px; border-radius: 50%;
    background: var(--muted); flex-shrink: 0; transition: background 200ms ease;
}
.sub-item.active .sub-dot { background: var(--neon-cyan); }

/* ===== CONTENT AREA ===== */
.content-area {
    flex: 1; display: flex; flex-direction: column; height: 100%; min-width: 0;
    overflow-y: auto;
}

.content-header { padding: 1.5rem 2rem 0; flex-shrink: 0; }

.content-breadcrumb {
    font-size: 0.72rem; color: var(--muted); margin-bottom: 0.5rem;
    display: flex; align-items: center; gap: 6px;
}
.content-breadcrumb span { color: var(--neon-purple); }

.content-title-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.3rem;
}

.content-title {
    font-family: var(--font-display); font-size: 1.2rem; font-weight: 800;
    letter-spacing: 0.04em;
}

.tools-count {
    font-size: 0.78rem; color: var(--muted); font-weight: 500;
    padding: 4px 14px; border-radius: 10px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
}

.content-desc {
    font-size: 0.88rem; color: var(--muted); line-height: 1.6;
    max-width: 600px; margin-bottom: 1.2rem;
}

/* ===== TOOL CARDS GRID ===== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem; padding: 0 2rem 2rem;
}

.tool-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px; padding: 1.4rem;
    display: flex; flex-direction: column; gap: 12px; cursor: default;
    transition: border-color 300ms ease, transform 300ms var(--ease-spring), background 300ms ease;
}

.tool-card:hover {
    border-color: rgba(255, 255, 255, 0.15); transform: translateY(-4px);
    background: linear-gradient(135deg, rgba(255,255,255,0.09), rgba(255,255,255,0.03));
}

.tool-top { display: flex; align-items: flex-start; gap: 14px; }

.tool-icon {
    width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}

.tool-icon-0 { background: linear-gradient(135deg, rgba(166,110,247,0.35), rgba(92,200,223,0.2)); }
.tool-icon-1 { background: linear-gradient(135deg, rgba(224,96,154,0.35), rgba(166,110,247,0.2)); }
.tool-icon-2 { background: linear-gradient(135deg, rgba(74,222,128,0.35), rgba(92,200,223,0.2)); }
.tool-icon-3 { background: linear-gradient(135deg, rgba(240,208,96,0.35), rgba(224,96,154,0.2)); }
.tool-icon-4 { background: linear-gradient(135deg, rgba(92,200,223,0.35), rgba(166,110,247,0.2)); }
.tool-icon-5 { background: linear-gradient(135deg, rgba(224,150,80,0.35), rgba(240,208,96,0.2)); }

.tool-head { flex: 1; min-width: 0; }

.tool-name {
    font-family: var(--font-display); font-size: 0.78rem; font-weight: 700;
    letter-spacing: 0.04em; margin-bottom: 4px;
}

.tool-tags { display: flex; gap: 5px; flex-wrap: wrap; }

.tool-tag {
    font-size: 0.6rem; font-weight: 600; padding: 2px 8px;
    border-radius: 6px; letter-spacing: 0.04em;
}
.tag-free { background: rgba(74,222,128,0.15); color: var(--neon-green); }
.tag-official { background: rgba(166,110,247,0.15); color: var(--neon-purple); }
.tag-hot { background: rgba(224,96,154,0.15); color: var(--neon-pink); }
.tag-new { background: rgba(92,200,223,0.15); color: var(--neon-cyan); }
.tag-pro { background: rgba(240,208,96,0.15); color: var(--neon-yellow); }

.tool-desc { font-size: 0.84rem; color: var(--muted); line-height: 1.6; }

.tool-meta {
    display: flex; align-items: center; gap: 1rem;
    font-size: 0.7rem; color: rgba(154,143,181,0.6);
}

.tool-meta-item { display: flex; align-items: center; gap: 4px; }
.tool-meta-item svg { width: 12px; height: 12px; opacity: 0.5; }

.tool-bottom {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.04);
}

.tool-size { font-size: 0.72rem; color: var(--muted); font-weight: 500; }

.tool-dl-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 20px; border: none; border-radius: 12px; cursor: pointer;
    background: linear-gradient(135deg, rgba(166,110,247,0.35), rgba(92,200,223,0.25));
    color: var(--white); font-family: var(--font-display);
    font-size: 0.65rem; font-weight: 700; letter-spacing: 0.06em;
    transition: background 250ms ease, transform 200ms var(--ease-spring), box-shadow 250ms ease;
}

.tool-dl-btn:hover {
    background: linear-gradient(135deg, rgba(166,110,247,0.5), rgba(92,200,223,0.4));
    transform: translateY(-1px); box-shadow: 0 4px 16px rgba(166,110,247,0.2);
}
.tool-dl-btn:active { transform: scale(0.95); }
.tool-dl-btn svg { width: 14px; height: 14px; }

.tool-rating { display: flex; align-items: center; gap: 3px; }
.star { width: 12px; height: 12px; }
.star-on { color: var(--neon-yellow); }
.star-off { color: rgba(255,255,255,0.08); }

/* Mobile sidebar toggle */
.sidebar-toggle {
    display: none; background: none; border: none; cursor: pointer;
    color: var(--muted); padding: 4px; transition: color 200ms ease;
}
.sidebar-toggle:hover { color: var(--white); }
.sidebar-toggle svg { width: 20px; height: 20px; }

.sidebar-backdrop {
    display: none; position: fixed; inset: 0; z-index: 49;
    background: rgba(0,0,0,0.5); opacity: 0; pointer-events: none;
    transition: opacity 300ms ease;
}

/* ===== SCROLLBAR ===== */
.content-area::-webkit-scrollbar, .cat-list::-webkit-scrollbar { width: 3px; }
.content-area::-webkit-scrollbar-track, .cat-list::-webkit-scrollbar-track { background: transparent; }
.content-area::-webkit-scrollbar-thumb, .cat-list::-webkit-scrollbar-thumb { background: rgba(166,110,247,0.3); border-radius: 4px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed; left: 0; top: var(--nav-h); bottom: 0;
        z-index: 50; transform: translateX(-100%);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-backdrop { display: block; }
    .sidebar-backdrop.show { opacity: 1; pointer-events: all; }
    .sidebar-toggle { display: flex; }
    .content-header { padding: 1.2rem 1.2rem 0; }
    .tools-grid { grid-template-columns: 1fr; padding: 0 1.2rem 1.5rem; }
}

@media (max-width: 480px) {
    .tool-card { padding: 1.1rem; }
    .content-title { font-size: 1rem; }
}
