@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/Inter/Inter-Regular.woff2?v=3.12") format("woff2"),
    url("fonts/Inter/Inter-Regular.woff?v=3.12") format("woff");
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("fonts/Inter/Inter-Bold.woff2?v=3.12") format("woff2"),
    url("fonts/Inter/Inter-Bold.woff?v=3.12") format("woff");
}

:root {
    --bs-dark: #0b1220;
    --bs-dark-rgb: 11, 18, 32;
    --bs-light: #e2e8f0;
    --bs-light-rgb: 226, 232, 240;
    --bs-primary: #6366f1;
    --bs-primary-rgb: 99, 102, 241;
}

[data-bs-theme="dark"] {
    --bs-body-bg: #0f172a;
    --bs-body-color: #e2e8f0;
    --bs-border-color: #1e293b;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    font-weight: 400;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    overflow-x: hidden;
}

.app {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    position: relative;
}

.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1002;
    background: var(--bs-primary);
    border: none;
    border-radius: 8px;
    width: 44px;
    height: 44px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: #5a5fcf;
    transform: scale(1.05);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(4px);
}

.sidebar {
    background: var(--bs-dark);
    color: var(--bs-light);
    padding: 20px 16px;
    border-right: 1px solid rgba(148, 163, 184, 0.12);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    margin-bottom: 16px;
    position: relative;
}

.brand-logo {
    font-size: 24px;
}

.brand-name {
    font-weight: 700;
    letter-spacing: 0.2px;
    color: var(--bs-light);
    flex: 1;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.sidebar-close:hover {
    color: var(--bs-light);
    background: rgba(148, 163, 184, 0.1);
}

.search {
    position: relative;
    margin: 12px 6px 20px;
}

.search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #94a3b8;
    z-index: 3;
}

.search input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: #0f172a;
    color: var(--bs-light);
    outline: none;
    position: relative;
    z-index: 2;
}

.search input:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.search input::placeholder {
    color: #94a3b8;
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 18px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    display: none;
}

.search-clear:hover {
    color: var(--bs-light);
}

.search input:not(:placeholder-shown)+.search-clear {
    display: flex;
}

.menu {
    display: grid;
}

.nav-section {
    margin-bottom: 4px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 6px 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    user-select: none;
}

.section-header:hover {
    background: rgba(148, 163, 184, 0.05);
    color: var(--bs-light);
}

.section-title {
    flex: 1;
}

.section-arrow {
    transition: transform 0.3s ease;
    color: #64748b;
}

.nav-section.collapsed .section-arrow {
    transform: rotate(-90deg);
}

.nav-section.collapsed .nav {
    display: none;
}

.nav {
    list-style: none;
    padding: 0;
    margin: 0;
    transition: all 0.3s ease;
}

.nav-column {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 8px 16px;
    margin: 1px 0;
    text-decoration: none;
    color: var(--bs-light);
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    font-size: 14px;
    line-height: 1.4;
}

.nav a:hover {
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.14);
    color: var(--bs-light);
    text-decoration: none;
    transform: translateX(2px);
}

.nav a.active {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.12), rgba(99, 102, 241, 0.05));
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2) inset;
    color: var(--bs-light);
    font-weight: 500;
    position: relative;
}

.nav a.active::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--bs-primary);
    border-radius: 2px;
}

.nav-section.active-section .section-header {
    color: var(--bs-primary);
    background: rgba(99, 102, 241, 0.08);
}

.nav-section.active-section .section-arrow {
    color: var(--bs-primary);
}

.sidebar-footer {
    padding: 16px 6px 0;
    margin-top: auto;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content {
    background: var(--bs-body-bg);
    overflow-y: auto;
    min-height: 100vh;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
    margin-bottom: 16px;
}

.breadcrumb {
    margin: 0;
}

.breadcrumb-item a {
    color: var(--bs-primary);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--bs-light);
}

.main {
    padding: 0 24px 24px;
}

.welcome-message {
    text-align: center;
    padding: 4rem 2rem;
    color: #94a3b8;
}

.welcome-message h1 {
    margin-bottom: 1rem;
    color: var(--bs-light);
}

.loading-spinner {
    margin-top: 2rem;
}

.error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
    color: #f8d7da;
    text-align: center;
}

.error h3 {
    margin-bottom: 1rem;
    color: #f8d7da;
}

.retry-btn,
.home-btn {
    margin: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.retry-btn {
    background: var(--bs-primary);
    color: white;
}

.retry-btn:hover {
    background: #5a5fcf;
    color: white;
}

.home-btn {
    background: #64748b;
    color: white;
}

.home-btn:hover {
    background: #475569;
    color: white;
}

.no-results {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
    font-style: italic;
}

mark {
    background: rgba(255, 255, 0, 0.3);
    padding: 0.1em 0.2em;
    border-radius: 2px;
    color: inherit;
}

.content-card {
    background: var(--bs-dark);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.content h1,
.content h2,
.content h3,
.content h4,
.content h5,
.content h6 {
    margin: 1.5em 0 0.5em 0;
    color: var(--bs-light);
}

.content h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0rem;
}

.content h2 {
    font-size: 1.875rem;
    font-weight: 600;
    border-top: 2px solid var(--bs-primary);
    padding-top: 2rem;
}

.content h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

.content h4 {
    font-size: 1.25rem;
    font-weight: 600;
}

.content p {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.content ul,
.content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.content li {
    margin-bottom: 0.5rem;
}

.content code {
    background: rgba(99, 102, 241, 0.1);
    color: var(--bs-primary);
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875em;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.content pre {
    background: var(--bs-dark);
    color: var(--bs-light);
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.content pre code {
    background: none;
    padding: 0;
    border: none;
    color: inherit;
}

.content blockquote {
    border-left: 4px solid var(--bs-primary);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: #94a3b8;
    font-style: italic;
    background: rgba(99, 102, 241, 0.05);
    padding: 1rem 1.5rem;
    border-radius: 0 8px 8px 0;
}

.content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--bs-dark);
    border-radius: 8px;
    overflow: hidden;
}

.content th,
.content td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.content th {
    background: rgba(99, 102, 241, 0.1);
    font-weight: 600;
    color: var(--bs-light);
}

.content-image {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    margin: 24px auto;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.app-card {
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: var(--bs-dark);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.app-header {
    background: rgba(99, 102, 241, 0.1);
    padding: 0.75rem 1rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.app-actions {
    padding: 0.5rem;
}

.action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.25rem;
    font-size: 0.875rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.05);
}

.action:last-child {
    border-bottom: none;
}

.xp {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

.contributors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.contributor-card {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contributor-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
    border-color: var(--bs-primary);
}

.contributor-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bs-border-color);
}

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

.contributor-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0 0 0.25rem 0;
    color: var(--bs-body-color);
}

.contributor-name a {
    color: inherit;
    text-decoration: none;
}

.contributor-name a:hover {
    color: var(--bs-primary);
}

.contributor-stats {
    font-size: 0.9rem;
    color: var(--bs-body-color);
    opacity: 0.7;
    margin: 0;
}

.contributor-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--bs-primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.loading-contributors {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.error-message {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 0.5rem;
    padding: 1.5rem;
    color: #f8d7da;
    margin-top: 2rem;
}

.empty-message {
    text-align: center;
    padding: 3rem;
    color: var(--bs-body-color);
    opacity: 0.7;
}

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

    .mobile-menu-toggle {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 1001;
        border-right: none;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

    .mobile-overlay.active {
        display: block;
    }

    .content {
        margin-left: 0;
        padding-top: 60px;
    }

    .topbar {
        padding: 16px 16px 0;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: var(--bs-body-bg);
        z-index: 999;
        padding-top: 70px;
    }

    .main {
        padding: 80px 16px 16px;
    }

    .welcome-message {
        padding: 2rem 1rem;
    }

    .nav-column {
        gap: 1px;
    }

    .nav a {
        padding: 12px 16px;
        font-size: 15px;
        border-radius: 6px;
        margin: 0;
    }

    .section-header {
        padding: 16px 12px 12px;
        font-size: 13px;
    }
}

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

    .action {
        padding: 0.4rem 0.25rem;
    }

    .region-countries {
        font-size: 0.8rem;
        padding: 0.5rem;
    }

    .content-image {
        max-width: 90%;
        margin: 20px auto;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
    }

    .brand {
        padding: 16px 12px;
    }

    .search {
        margin: 16px 12px 24px;
    }

    .menu {
        padding: 0 8px;
    }

    .content-image {
        max-width: 95%;
        margin: 16px auto;
    }
}

.btn-outline-secondary {
    border-color: #475569;
    color: #94a3b8;
}

.btn-outline-secondary:hover {
    background: #475569;
    border-color: #64748b;
    color: var(--bs-light);
}

.breadcrumb-item+.breadcrumb-item::before {
    color: #64748b;
}

.text-muted {
    color: #64748b !important;
}

.region-countries {
    padding: 0.75rem;
    font-size: 0.95rem;
    color: var(--bs-light);
    line-height: 1.4;
}
