:root {
    --bg-primary: #0a0a0b;
    --bg-secondary: #111113;
    --bg-card: #18181b;
    --bg-card-hover: #1f1f23;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --accent-color: #818cf8;
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow-card: 0 4px 24px -4px rgba(0, 0, 0, 0.4);
    --shadow-card-hover: 0 8px 40px -8px rgba(0, 0, 0, 0.6);
    --radius-lg: 16px;
    --radius-md: 12px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 80px 24px 60px;
    text-align: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 48px;
    padding: 24px;
    margin-top: 40px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Category Filter */
.filter-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 0 24px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 100px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

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

.filter-btn.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
}

/* Widgets Grid */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

.widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* Widget Card */
.widget-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.widget-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.widget-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-4px);
}

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

.widget-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.widget-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.widget-info {
    flex: 1;
    min-width: 0;
}

.widget-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.widget-category {
    font-size: 0.75rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.widget-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.widget-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.widget-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.backend-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(245, 158, 11, 0.15);
    border-radius: 50%;
    font-size: 12px;
    cursor: help;
    position: relative;
}

.backend-indicator::after {
    content: 'Wymaga zewnętrznego API';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f1f23;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 6px;
}

.backend-indicator:hover::after {
    opacity: 1;
}

.widget-tag {
    padding: 4px 10px;
    background: rgba(129, 140, 248, 0.1);
    border-radius: 100px;
    font-size: 0.75rem;
    color: var(--accent-color);
}

.widget-arrow {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.widget-card:hover .widget-arrow {
    background: var(--accent-gradient);
    color: white;
    transform: translateX(4px);
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer a {
    color: var(--accent-color);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 640px) {
    .hero {
        padding: 60px 16px 40px;
    }

    .stats-bar {
        gap: 24px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

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

    .container {
        padding: 0 16px 60px;
    }
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.widget-card {
    animation: fadeInUp 0.5s ease backwards;
}

/* Staggered animation generated by JS */

/* Hidden class for filtering */
.widget-card.hidden {
    display: none;
}

/* Search Section */
.search-container {
    max-width: 600px;
    margin: 0 auto 32px;
    padding: 0 24px;
    position: relative;
}

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

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

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

.search-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.1);
    background: var(--bg-card-hover);
}

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

.no-results {
    text-align: center;
    padding: 40px 0;
    color: var(--text-secondary);
    grid-column: 1 / -1;
    display: none;
}

.no-results.visible {
    display: block;
}

/* Language Switcher */
.lang-switch {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 100px;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
    font-family: inherit;
}

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

.lang-btn.active {
    color: var(--accent-color);
}

.lang-separator {
    color: var(--border-color);
    font-size: 0.75rem;
}