/* Ecosystem Specific Styles */
:root {
    --eco-bg: #050a14;
    --eco-primary: #2563eb;
    --eco-accent: #60a5fa;
    --eco-text: #f1f5f9;
    --eco-text-muted: #94a3b8;
    --eco-glow: rgba(37, 99, 235, 0.5);
    --eco-transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

body.ecosystem-page {
    background-color: var(--eco-bg);
    color: var(--eco-text);
    overflow-x: hidden;
    background-image:
        linear-gradient(rgba(37, 99, 235, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--eco-bg);
}
::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--eco-primary);
}

/* --- The Path (SVG Background) --- */
.ecosystem-path-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: visible;
}

.ecosystem-path-base {
    stroke: var(--eco-primary);
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    opacity: 0.15;
}

.ecosystem-path-active {
    stroke: url(#pathGradient);
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    filter: drop-shadow(0 0 10px var(--eco-accent));
    transition: stroke-dashoffset 0.1s linear;
}

/* Ensure Main Content is above the path */
main {
    position: relative;
    z-index: 1;
}

/* --- Nodes & Hubs --- */
.node-wrapper {
    position: relative;
    padding: 6rem 0;
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.central-hub-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60vh;
    width: 100%;
}

.central-hub {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #3b82f6, #1d4ed8);
    box-shadow: 0 0 60px var(--eco-glow), inset 0 0 20px rgba(255,255,255,0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
    animation: pulse 4s infinite ease-in-out;
    z-index: 2;
}

.central-hub:hover {
    transform: scale(1.05);
}

.hub-label {
    font-weight: 800;
    font-size: 1.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 3;
}

/* Orbit Animation */
.orbit-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    pointer-events: none;
}
.orbit-1 { width: 300px; height: 300px; animation: spin 20s linear infinite; }
.orbit-2 { width: 450px; height: 450px; animation: spin-reverse 25s linear infinite; }

.orbit-dot {
    position: absolute;
    top: 0;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--eco-accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--eco-accent);
}

/* --- New Network Map Layout --- */
#network-map {
    padding: 4rem 0;
    position: relative;
    z-index: 2;
}

.network-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.network-branch {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: relative;
}

.category-node {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--eco-primary);
    padding: 1rem 2rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.2);
    align-self: center;
    z-index: 3;
    transition: all 0.3s ease;
}

.category-node i {
    color: var(--eco-accent);
    font-size: 1.5rem;
}

.category-node:hover {
    box-shadow: 0 0 30px var(--eco-glow);
    transform: scale(1.05);
}

.network-leaves {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 2rem;
    z-index: 3;
}

.leaf-node {
    background: rgba(5, 10, 20, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 3px solid var(--eco-primary);
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
}

.leaf-node::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, rgba(37,99,235,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.leaf-node:hover {
    background: rgba(15, 23, 42, 0.95);
    border-color: var(--eco-accent);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 20px rgba(37, 99, 235, 0.1);
    transform: translateY(-5px);
}

.leaf-node:hover::before {
    opacity: 1;
}

.leaf-icon {
    font-size: 2rem;
    color: var(--eco-accent);
    background: rgba(37, 99, 235, 0.1);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.leaf-node:hover .leaf-icon {
    background: rgba(37, 99, 235, 0.2);
    box-shadow: 0 0 15px var(--eco-primary);
    transform: scale(1.1);
}

.leaf-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.leaf-name {
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
}

.leaf-desc {
    color: var(--eco-text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

.status-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.status-badge.live {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.dev {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Origins Footer */
.origin-node {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--eco-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50px;
    transition: all 0.3s ease;
    background: rgba(0,0,0,0.3);
}

.origin-node:hover {
    color: white;
    border-color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.05);
}

/* Desktop Radial/Network Layout Adjustments */
@media (min-width: 992px) {
    .network-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6rem 4rem;
    }

    /* Make the central hub section take up sensible space */
    #hub-section {
        min-height: 60vh;
    }

    /* Push categories outward slightly */
    #branch-education .category-node { align-self: flex-start; }
    #branch-student .category-node { align-self: flex-end; }
    #branch-tech .category-node { align-self: flex-start; }
    #branch-infrastructure .category-node { align-self: flex-end; }
}

/* Modal Enhancements */
#nodeModal .modal-content button:hover {
    color: white;
}

#nodeModal #modalLink:hover {
    background: rgba(37,99,235,0.2) !important;
    box-shadow: 0 0 15px var(--eco-glow);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #cbd5e1;
    font-size: 0.85rem;
}
.feature-item i {
    color: var(--eco-primary);
}


/* Keyframes */
@keyframes pulse {
    0% { box-shadow: 0 0 40px var(--eco-glow); }
    50% { box-shadow: 0 0 80px var(--eco-glow), 0 0 20px var(--eco-primary); }
    100% { box-shadow: 0 0 40px var(--eco-glow); }
}

@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes spin-reverse {
    from { transform: translate(-50%, -50%) rotate(360deg); }
    to { transform: translate(-50%, -50%) rotate(0deg); }
}

/* Flow Animation */
@keyframes dashFlow {
    to {
        stroke-dashoffset: -1000;
    }
}
.ecosystem-path-active {
    stroke-dasharray: 20 15;
    stroke-width: 2;
    opacity: 0.8;
    filter: drop-shadow(0 0 5px var(--eco-accent));
    animation: dashFlow 3s linear infinite;
}

/* Visibility Override */
.category-node.visible, .leaf-node.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}
