/* ==========================================================================
   Merodox x Meta Astryx - Ultimate Open Source Design System & Curation UI
   ========================================================================== */

:root {
    /* Astryx Core Theme Tokens (Dark Mode Default) */
    --astryx-bg-base: #06090f;
    --astryx-bg-surface: #0d131f;
    --astryx-bg-surface-hover: #151d2e;
    --astryx-bg-card: #0f1726;
    --astryx-bg-card-hover: #162035;
    --astryx-bg-code: #030508;
    
    --astryx-border: #1e293b;
    --astryx-border-highlight: #334155;
    
    --astryx-text-main: #f1f5f9;
    --astryx-text-muted: #8c9cb6;
    --astryx-text-bright: #ffffff;

    --astryx-accent: #0064e0;
    --astryx-accent-hover: #2694fe;
    --astryx-emerald: #10b981;
    --astryx-emerald-hover: #059669;
    --astryx-warning: #f59e0b;
    --astryx-purple: #8b5cf6;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;

    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="light"] {
    --astryx-bg-base: #f8fafc;
    --astryx-bg-surface: #ffffff;
    --astryx-bg-surface-hover: #f1f5f9;
    --astryx-bg-card: #ffffff;
    --astryx-bg-card-hover: #f8fafc;
    --astryx-bg-code: #0b0f17;
    
    --astryx-border: #e2e8f0;
    --astryx-border-highlight: #cbd5e1;
    
    --astryx-text-main: #0f172a;
    --astryx-text-muted: #64748b;
    --astryx-text-bright: #020617;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: var(--astryx-bg-base);
    color: var(--astryx-text-main);
    font-family: var(--font-family);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

a {
    color: var(--astryx-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    text-decoration: underline;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   Astryx Header / Navigation
   ========================================================================== */

.site-header {
    background-color: rgba(6, 9, 15, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--astryx-border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
}

[data-theme="light"] .site-header {
    background-color: rgba(248, 250, 252, 0.85);
}

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

.brand-logo {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--astryx-text-bright);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.brand-logo:hover {
    text-decoration: none;
}

.logo-badge-dot {
    width: 10px;
    height: 10px;
    background-color: var(--astryx-emerald);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--astryx-emerald);
}

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

.logo-sub {
    color: var(--astryx-text-muted);
    font-weight: 500;
    font-size: 0.85rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.theme-toggle-btn {
    background-color: var(--astryx-bg-surface);
    color: var(--astryx-text-main);
    border: 1px solid var(--astryx-border);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
    background-color: var(--astryx-bg-surface-hover);
    border-color: var(--astryx-border-highlight);
}

[data-theme="dark"] .icon-moon {
    display: none;
}

[data-theme="light"] .icon-sun {
    display: none;
}

.github-nav-btn, .instagram-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--astryx-bg-surface);
    color: var(--astryx-text-main);
    border: 1px solid var(--astryx-border);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.github-nav-btn:hover, .instagram-nav-btn:hover {
    background-color: var(--astryx-bg-surface-hover);
    border-color: var(--astryx-border-highlight);
    text-decoration: none;
    color: var(--astryx-text-bright);
}

/* ==========================================================================
   Astryx Hero Section
   ========================================================================== */

.hero-section {
    padding: 4.5rem 0 3rem;
    text-align: center;
    border-bottom: 1px solid var(--astryx-border);
    background: radial-gradient(circle at top center, rgba(0, 100, 224, 0.1) 0%, rgba(6, 9, 15, 0) 70%);
}

.hero-content {
    max-width: 850px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background-color: rgba(16, 185, 129, 0.12);
    color: var(--astryx-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 0.825rem;
    font-weight: 600;
    padding: 0.35rem 1rem;
    border-radius: var(--radius-full);
    margin-bottom: 1.5rem;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.1);
}

.badge-dot {
    width: 7px;
    height: 7px;
    background-color: var(--astryx-emerald);
    border-radius: 50%;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.2rem;
    color: var(--astryx-text-bright);
    letter-spacing: -0.7px;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--astryx-text-muted);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

/* Search & Filters */
.search-filter-container {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    max-width: 750px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background-color: var(--astryx-bg-card);
    border: 1px solid var(--astryx-border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.25rem;
    transition: all 0.25s ease;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.search-box:focus-within {
    border-color: var(--astryx-accent);
    box-shadow: 0 0 0 3px rgba(0, 100, 224, 0.2);
}

.search-box svg {
    color: var(--astryx-text-muted);
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--astryx-text-bright);
    font-size: 1rem;
    outline: none;
}

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

.category-filters {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.filter-btn {
    background-color: var(--astryx-bg-surface);
    color: var(--astryx-text-muted);
    border: 1px solid var(--astryx-border);
    padding: 0.45rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background-color: var(--astryx-bg-surface-hover);
    color: var(--astryx-text-bright);
    border-color: var(--astryx-border-highlight);
}

.filter-btn.active {
    background-color: var(--astryx-accent);
    color: #ffffff;
    border-color: var(--astryx-accent);
    box-shadow: 0 4px 12px rgba(0, 100, 224, 0.3);
}

/* ==========================================================================
   Main Content & Astryx Repo Grid
   ========================================================================== */

.main-content {
    padding: 3.5rem 1.5rem 6rem;
    flex: 1;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-heading h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--astryx-text-bright);
}

.repo-count-badge {
    background-color: var(--astryx-bg-surface);
    border: 1px solid var(--astryx-border);
    color: var(--astryx-text-muted);
    font-size: 0.825rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
}

.repo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.75rem;
}

/* Astryx Card Spec */
.repo-card {
    background-color: var(--astryx-bg-card);
    border: 1px solid var(--astryx-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.repo-card:hover {
    border-color: var(--astryx-border-highlight);
    transform: translateY(-3px);
    box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.3);
    background-color: var(--astryx-bg-card-hover);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.2rem;
}

.card-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag-category {
    background-color: rgba(0, 100, 224, 0.15);
    color: var(--astryx-accent);
    font-size: 0.775rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
}

.tag-license {
    background-color: var(--astryx-bg-surface);
    color: var(--astryx-text-muted);
    border: 1px solid var(--astryx-border);
    font-size: 0.775rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
}

.star-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--astryx-text-muted);
    font-size: 0.825rem;
    font-weight: 600;
}

.star-badge svg {
    color: var(--astryx-warning);
}

.card-body {
    margin-bottom: 1.75rem;
}

.card-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.card-title a {
    color: var(--astryx-text-bright);
}

.card-title a:hover {
    color: var(--astryx-accent);
}

.card-desc {
    font-size: 0.925rem;
    color: var(--astryx-text-muted);
    line-height: 1.55;
}

.card-footer {
    display: flex;
    gap: 0.85rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--astryx-border);
}

.card-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--astryx-emerald);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-primary:hover {
    background-color: var(--astryx-emerald-hover);
    text-decoration: none;
}

.btn-secondary {
    background-color: var(--astryx-bg-surface);
    color: var(--astryx-text-main);
    border: 1px solid var(--astryx-border);
}

.btn-secondary:hover {
    background-color: var(--astryx-bg-surface-hover);
    border-color: var(--astryx-border-highlight);
    text-decoration: none;
    color: var(--astryx-text-bright);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 5rem 1rem;
    color: var(--astryx-text-muted);
}

.empty-state svg {
    margin-bottom: 1.2rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.3rem;
    color: var(--astryx-text-bright);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.95rem;
    margin-bottom: 1.75rem;
}

.reset-btn {
    background-color: var(--astryx-accent);
    color: #ffffff;
    padding: 0.6rem 1.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
}

/* ==========================================================================
   Astryx Modal / Drawer Spec
   ========================================================================== */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(3, 5, 8, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background-color: var(--astryx-bg-surface);
    border: 1px solid var(--astryx-border-highlight);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

@keyframes slideUp {
    from { transform: translateY(25px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.75rem;
    border-bottom: 1px solid var(--astryx-border);
}

.modal-category-tag {
    font-size: 0.775rem;
    font-weight: 700;
    color: var(--astryx-accent);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0.35rem;
    display: inline-block;
}

.modal-header h3 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--astryx-text-bright);
}

.modal-close-btn {
    background-color: var(--astryx-bg-card);
    color: var(--astryx-text-muted);
    border: 1px solid var(--astryx-border);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background-color: var(--astryx-bg-surface-hover);
    color: var(--astryx-text-bright);
}

.modal-body {
    padding: 1.75rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.modal-desc {
    font-size: 1rem;
    color: var(--astryx-text-main);
    line-height: 1.65;
}

.modal-section h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--astryx-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0.6rem;
}

.code-container {
    background-color: var(--astryx-bg-code);
    border: 1px solid var(--astryx-border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.15rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    overflow-x: auto;
}

.code-container code {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: #60a5fa;
    white-space: nowrap;
}

.prompt-container code {
    color: #34d399;
    white-space: pre-wrap;
    word-break: break-word;
}

.modal-copy-btn {
    background-color: #1e293b;
    color: #f8fafc;
    border: 1px solid var(--astryx-border);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.775rem;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s;
}

.modal-copy-btn:hover {
    background-color: #334155;
}

.modal-copy-btn.copied {
    background-color: var(--astryx-emerald);
    color: #fff;
}

.review-notes-box {
    background-color: rgba(0, 100, 224, 0.05);
    border: 1px solid rgba(0, 100, 224, 0.2);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.review-notes-box ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--astryx-text-muted);
}

.review-notes-box li strong {
    color: var(--astryx-text-bright);
}

.modal-footer {
    padding: 1.25rem 1.75rem;
    border-top: 1px solid var(--astryx-border);
    background-color: var(--astryx-bg-card);
    display: flex;
    justify-content: flex-end;
}

.modal-github-btn {
    background-color: var(--astryx-accent);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.925rem;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s;
}

.modal-github-btn:hover {
    background-color: var(--astryx-accent-hover);
    text-decoration: none;
}

/* ==========================================================================
   Astryx Footer
   ========================================================================== */

.site-footer {
    background-color: var(--astryx-bg-surface);
    border-top: 1px solid var(--astryx-border);
    padding: 3rem 0;
    margin-top: auto;
}

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}

.footer-brand p {
    font-size: 0.9rem;
    color: var(--astryx-text-muted);
    margin-top: 0.4rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
    font-size: 0.925rem;
}

.footer-disclaimer p {
    font-size: 0.8rem;
    color: var(--astryx-text-muted);
    max-width: 700px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

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

    .footer-links {
        flex-direction: column;
        gap: 0.75rem;
    }
}
