/* ===== RESET & ГЛОБАЛЬНЫЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #0a0e1a 0%, #0f172a 50%, #0a0f1f 100%);
    font-family: 'Inter', sans-serif;
    color: #e2e8f0;
    line-height: 1.5;
    min-height: 100vh;
    padding: 2rem 1.5rem;
    position: relative;
}

/* Сетчатый фон (имитация схемы сети) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(56, 189, 248, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ===== ХЕДЕР ===== */
.header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 1.5rem;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(12px);
    border-radius: 2rem;
    border: 1px solid rgba(56, 189, 248, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.badge-group {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.badge {
    background: rgba(56, 189, 248, 0.12);
    padding: 0.4rem 1.2rem;
    border-radius: 40px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #7dd3fc;
    border: 1px solid rgba(56, 189, 248, 0.3);
    backdrop-filter: blur(4px);
}

.badge i {
    margin-right: 6px;
    font-size: 0.8rem;
}

.badge.secondary {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.3);
    color: #a78bfa;
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #94a3f8 40%, #38bdf8 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.glitch-text {
    position: relative;
    display: inline-block;
}

.subtitle {
    font-size: 1rem;
    color: #94a3b8;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ===== ПАНЕЛЬ УПРАВЛЕНИЯ ===== */
.control-panel {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(16px);
    border-radius: 1.5rem;
    padding: 1.2rem 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(71, 85, 105, 0.4);
    transition: all 0.3s;
}

.search-box {
    position: relative;
    margin-bottom: 1.2rem;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #5b6e8c;
    font-size: 1rem;
    pointer-events: none;
}

#searchInput {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #334155;
    border-radius: 2rem;
    padding: 0.8rem 2.5rem 0.8rem 2.8rem;
    font-size: 0.95rem;
    color: #f1f5f9;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.2s;
}

#searchInput:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
    background: rgba(0, 0, 0, 0.6);
}

.clear-btn {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #5b6e8c;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 50%;
    transition: all 0.2s;
    opacity: 0;
    visibility: hidden;
}

.clear-btn.visible {
    opacity: 1;
    visibility: visible;
}

.clear-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.filter-btn {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid #334155;
    padding: 0.5rem 1.2rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #cbd5e6;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.filter-btn i {
    margin-right: 6px;
    font-size: 0.8rem;
}

.filter-btn:hover {
    background: #1e293b;
    border-color: #38bdf8;
    color: #bae6fd;
}

.filter-btn.active {
    background: linear-gradient(135deg, #1e3a5f, #0f172a);
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.stats-info {
    text-align: right;
    font-size: 0.8rem;
    color: #64748b;
    font-family: 'JetBrains Mono', monospace;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(71, 85, 105, 0.3);
}

/* ===== СЕТКА КАРТОЧЕК ===== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Карточка инструмента */
.tool-card {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.8), rgba(15, 23, 42, 0.9));
    backdrop-filter: blur(4px);
    border-radius: 1.5rem;
    padding: 1.3rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(51, 65, 85, 0.5);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #38bdf8, #8b5cf6, #38bdf8);
    opacity: 0;
    transition: opacity 0.3s;
}

.tool-card:hover {
    transform: translateY(-6px);
    border-color: #38bdf8;
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(56, 189, 248, 0.2);
    background: rgba(30, 41, 59, 0.9);
}

.tool-card:hover::before {
    opacity: 1;
}

/* Иконка категории в углу */
.card-category {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #7dd3fc;
    border: 0.5px solid #38bdf855;
    font-family: 'JetBrains Mono', monospace;
}

/* Иконка инструмента */
.tool-icon {
    width: 52px;
    height: 52px;
    background: rgba(56, 189, 248, 0.1);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.8rem;
    color: #7dd3fc;
    transition: all 0.2s;
}

.tool-card:hover .tool-icon {
    background: rgba(56, 189, 248, 0.2);
    transform: scale(1.02);
}

/* Название и описание */
.tool-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tool-desc {
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.45;
    margin-bottom: 1.2rem;
    min-height: 60px;
}

/* Кнопка ссылки */
.tool-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(56, 189, 248, 0.08);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    color: #bae6fd;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid transparent;
    width: fit-content;
}

.tool-link i {
    transition: transform 0.2s;
    font-size: 0.75rem;
}

.tool-link:hover {
    background: #0f172b;
    border-color: #38bdf8;
    color: white;
    gap: 12px;
}

.tool-link:hover i {
    transform: translateX(3px);
}

/* Сообщение "ничего не найдено" */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(8px);
    border-radius: 2rem;
    border: 1px dashed #334155;
}

.no-results i {
    font-size: 3rem;
    color: #475569;
    margin-bottom: 1rem;
}

.no-results h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.reset-btn {
    margin-top: 1rem;
    background: #1e293b;
    border: none;
    padding: 0.6rem 1.3rem;
    border-radius: 2rem;
    color: #bae6fd;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.reset-btn:hover {
    background: #2d3a5e;
    transform: scale(1.02);
}

/* ===== FOOTER ===== */
.footer {
    margin-top: 2.5rem;
    padding: 1.5rem 1rem;
    border-top: 1px solid rgba(51, 65, 85, 0.4);
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.8rem;
    font-size: 0.8rem;
    color: #64748b;
}

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

.tip i {
    font-size: 0.9rem;
    color: #38bdf8;
}

.version {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .filter-tabs {
        justify-content: center;
    }
    
    .filter-btn {
        padding: 0.4rem 1rem;
        font-size: 0.75rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .footer-content {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .badge-group {
        flex-direction: column;
        align-items: center;
    }
    
    .tool-name {
        font-size: 1.1rem;
    }
}

/* Анимация появления карточек */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-card {
    animation: fadeInUp 0.3s ease forwards;
}
