/* ==========================================
   TeleBotsHub — Dark Theme
   ========================================== */

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-card: #16161f;
    --bg-card-hover: #1c1c28;
    --bg-input: #1a1a25;
    --border: #2a2a3a;
    --border-hover: #3a3a50;
    --text-primary: #e8e8f0;
    --text-secondary: #9898a8;
    --text-muted: #686878;
    --accent: #6c5ce7;
    --accent-light: #a29bfe;
    --accent-glow: rgba(108, 92, 231, 0.3);
    --green: #00d4aa;
    --green-glow: rgba(0, 212, 170, 0.2);
    --pink: #e84393;
    --orange: #fd7014;
    --blue: #0984e3;
    --yellow: #fdcb6e;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --transition: 0.2s ease;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

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

/* ==========================================
   Header
   ========================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    transition: var(--transition);
}

.logo:hover {
    opacity: 0.85;
}

.logo-icon {
    font-size: 1.5rem;
}

.logo-accent {
    color: var(--accent-light);
}

.nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

/* ==========================================
   Hero
   ========================================== */
.hero {
    padding: 140px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-light), var(--green), var(--blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 36px;
    line-height: 1.7;
}

/* ==========================================
   Search
   ========================================== */
.search-wrapper {
    max-width: 600px;
    margin: 0 auto 48px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 18px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 16px 52px 16px 52px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow);
}

.search-kbd {
    position: absolute;
    right: 16px;
    padding: 4px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: inherit;
    pointer-events: none;
}

/* ==========================================
   Stats
   ========================================== */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ==========================================
   Section
   ========================================== */
.section {
    padding: 80px 0;
}

.section--dark {
    background: var(--bg-secondary);
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.section-subtitle {
    color: var(--text-secondary);
    margin-bottom: 36px;
}

/* ==========================================
   Categories
   ========================================== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.category-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.category-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.category-card.active {
    border-color: var(--accent);
    background: rgba(108, 92, 231, 0.08);
}

.category-icon {
    font-size: 2rem;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.category-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.category-info p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ==========================================
   Catalog
   ========================================== */
.catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
    gap: 20px;
    flex-wrap: wrap;
}

.catalog-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

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

.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ==========================================
   Bot Cards
   ========================================== */
.bots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.bot-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.bot-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--green));
    opacity: 0;
    transition: var(--transition);
}

.bot-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

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

.bot-top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bot-avatar {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-primary);
}

.bot-meta {
    flex: 1;
    min-width: 0;
}

.bot-name {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bot-category-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 100px;
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-light);
}

.bot-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bot-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bot-tag {
    font-size: 0.72rem;
    padding: 3px 10px;
    background: var(--bg-primary);
    border-radius: 100px;
    color: var(--text-muted);
    font-weight: 500;
}

.bot-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.bot-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.bot-stars {
    color: var(--yellow);
    letter-spacing: 1px;
}

.bot-users {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.bot-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    background: var(--accent);
    border-radius: 100px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
}

.bot-link:hover {
    background: var(--accent-light);
    transform: scale(1.03);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.bot-link svg {
    width: 14px;
    height: 14px;
}

/* ==========================================
   No Results
   ========================================== */
.no-results {
    text-align: center;
    padding: 80px 20px;
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

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

.no-results p {
    color: var(--text-secondary);
}

/* ==========================================
   About
   ========================================== */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.about-card {
    padding: 32px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: var(--transition);
}

.about-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.about-icon {
    font-size: 2.2rem;
    margin-bottom: 16px;
}

.about-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.about-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==========================================
   Footer
   ========================================== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 300px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.footer-links a {
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: var(--transition);
}

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

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-bottom p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
}

.footer-bottom a {
    font-size: 0.82rem;
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s;
}

.footer-bottom a:hover {
    opacity: 0.7;
}

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

.bot-card {
    animation: fadeInUp 0.4s ease both;
}

.bot-card:nth-child(2) { animation-delay: 0.05s; }
.bot-card:nth-child(3) { animation-delay: 0.1s; }
.bot-card:nth-child(4) { animation-delay: 0.15s; }
.bot-card:nth-child(5) { animation-delay: 0.2s; }
.bot-card:nth-child(6) { animation-delay: 0.25s; }

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .hero {
        padding: 120px 0 60px;
    }

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

    .hero-stats {
        gap: 24px;
    }

    .bots-grid {
        grid-template-columns: 1fr;
    }

    .categories-grid {
        grid-template-columns: 1fr 1fr;
    }

    .catalog-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }

    .hero-stats {
        flex-direction: column;
        gap: 16px;
    }

    .search-kbd {
        display: none;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* Selection */
::selection {
    background: var(--accent);
    color: #fff;
}
