@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Rajdhani:wght@300;400;500;600;700&family=Exo+2:wght@300;400;500;600;700&display=swap');

:root {
    /* Core Colors - Star Atlas Inspired */
    --bg-void: #000000;
    --bg-deep: #050510;
    --bg-space: #0a0a1a;
    --bg-nebula: #0d1025;

    /* Accent Colors */
    --accent-cyan: #00f0ff;
    --accent-cyan-dim: #0693e3;
    --accent-purple: #a855f7;
    --accent-purple-dim: #7c3aed;
    --accent-magenta: #ec4899;
    --accent-gold: #fbbf24;
    --accent-green: #10b981;
    --accent-red: #ef4444;

    /* Glow Colors */
    --glow-cyan: rgba(0, 240, 255, 0.6);
    --glow-purple: rgba(168, 85, 247, 0.5);
    --glow-soft: rgba(0, 240, 255, 0.15);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #b4c6ef;
    --text-muted: #64748b;
    --text-dim: #475569;

    /* Glass Effects */
    --glass-bg: rgba(10, 15, 30, 0.7);
    --glass-bg-solid: rgba(10, 15, 30, 0.9);
    --glass-border: rgba(0, 240, 255, 0.15);
    --glass-highlight: rgba(255, 255, 255, 0.05);

    /* Shadows */
    --shadow-glow: 0 0 60px rgba(0, 240, 255, 0.3);
    --shadow-deep: 0 25px 80px rgba(0, 0, 0, 0.9);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.6);

    /* Timing */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Rajdhani', 'Segoe UI', sans-serif;
    background: var(--bg-void);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 20%, rgba(0, 240, 255, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 30%, rgba(168, 85, 247, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 70% 50% at 50% 80%, rgba(236, 72, 153, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse 100% 100% at 50% 50%, var(--bg-deep) 0%, var(--bg-void) 100%);
    z-index: -2;
    pointer-events: none;
}

/* Grid overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 240, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.02) 1px, transparent 1px);
    background-size: 80px 80px;
    opacity: 0.5;
    z-index: -1;
    pointer-events: none;
}

/* ============================================
   HEADER
   ============================================ */
header {
    background: var(--glass-bg-solid);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-align: center;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 60px rgba(0, 240, 255, 0.5);
}

/* Breadcrumb */
.breadcrumb {
    text-align: center;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: all 0.3s ease;
}

.breadcrumb a:hover {
    color: var(--accent-purple);
    text-shadow: 0 0 20px var(--glow-cyan);
}

/* ============================================
   NAVIGATION TABS
   ============================================ */
.navigation-tabs,
.sub-navigation-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-tab,
.sub-nav-tab {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
    position: relative;
    overflow: hidden;
}

.nav-tab:hover,
.sub-nav-tab:hover {
    border-color: var(--accent-cyan);
    color: var(--text-primary);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.2);
}

.nav-tab.active,
.sub-nav-tab.active {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border-color: transparent;
    color: var(--bg-void);
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.4);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
main {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* Tab Content */
.tab-content,
.subtab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active,
.subtab-content.active {
    display: block;
}

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

/* ============================================
   STATS CARDS
   ============================================ */

/* ============================================
   EXPLORER LAYOUT
   ============================================ */

/* Sidebar */

/* Search Input */

#searchInput,
.search-container input {
    width: 100%;
    padding: 0.85rem 1rem;
    font-family: 'Exo 2', sans-serif;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

#searchInput:focus,
.search-container input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.2);
}

#searchInput::placeholder,
.search-container input::placeholder {
    color: var(--text-muted);
}

/* Filter Sections */

/* Checkbox Container */

/* ============================================
   RESOURCES MAIN AREA
   ============================================ */

/* Item Card */

/* ============================================
   ANALYTICS
   ============================================ */

/* Analysis Grids */
.resource-analysis-grid,
.category-analysis-grid,
.stack-analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* ============================================
   MODAL
   ============================================ */

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   FLOW TABLE
   ============================================ */

.bottleneck-cell {
    color: var(--accent-red);
    font-weight: 600;
}

.demand-score-cell {
    color: var(--accent-red);
    font-weight: 600;
}

/* Pagination */

/* ============================================
   RECIPE USAGE MODAL
   ============================================ */
.recipe-usage-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.recipe-usage-modal {
    background: linear-gradient(135deg, rgba(10, 10, 30, 0.95), rgba(20, 20, 50, 0.95));
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 100px rgba(0, 240, 255, 0.2), var(--shadow-deep);
    animation: modalSlideIn 0.3s var(--ease-out-back);
}

.recipe-usage-modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 24px 24px 0 0;
}

.recipe-usage-modal-header h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent-cyan);
    margin: 0;
}

.close-modal-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-modal-btn:hover {
    background: rgba(0, 240, 255, 0.1);
    color: var(--accent-cyan);
}

.recipe-usage-modal-body {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    flex: 1;
}

.recipe-count-info {
    font-family: 'Exo 2', sans-serif;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.recipe-usage-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recipe-usage-item {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.recipe-usage-item:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.05);
}

.recipe-usage-name {
    font-family: 'Exo 2', sans-serif;
    color: var(--text-primary);
    font-weight: 500;
}

.view-recipe-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border: none;
    border-radius: 100px;
    color: var(--bg-void);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-recipe-btn:hover {
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

/* ============================================
   CHAIN STYLES
   ============================================ */
.chain-categories {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.chain-category {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
}

.chain-category h4 {
    font-family: 'Orbitron', sans-serif;
    color: var(--accent-cyan);
    margin-bottom: 1rem;
}

.chain-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
}

.chain-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chain-card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 240, 255, 0.15);
}

.chain-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.chain-output {
    color: var(--text-primary);
    font-weight: 500;
}

.chain-depth-badge {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(0, 240, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    color: var(--accent-cyan);
}

.chain-path {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.chain-ingredient {
    background: rgba(168, 85, 247, 0.2);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    color: var(--text-secondary);
}

.chain-arrow {
    color: var(--text-muted);
}

.chain-result {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(168, 85, 247, 0.2));
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-magenta));
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    header {
        padding: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    main {
        padding: 1rem;
    }

    

    

    .navigation-tabs,
    .sub-navigation-tabs {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .nav-tab,
    .sub-nav-tab {
        padding: 0.6rem 1rem;
        font-size: 0.7rem;
    }

    

    
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
