/* Neural Network UI - ThoughtVault.AI
   Cyberpunk neural cluster layout with glowing connections
*/

/* ============================================
   ROOT VARIABLES
   ============================================ */
:root {
    --neural-primary: #0ffefb;
    --neural-secondary: #42c5ff;
    --neural-accent: #ae9fff;
    --neural-glow: rgba(15, 254, 251, 0.5);
    --neural-bg: #0a0e17;
    --neural-card-bg: rgba(10, 14, 23, 0.85);
    --neural-border: rgba(15, 254, 251, 0.3);
    --cluster-personal: #ff6b9d;
    --cluster-professional: #42c5ff;
    --cluster-tools: #0ffefb;
    --cluster-entertainment: #ae9fff;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */
.neural-page {
    min-height: 100vh;
    background: var(--neural-bg);
    overflow-x: hidden;
    position: relative;
}

/* Background with cityscape */
.neural-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    background:
        linear-gradient(to bottom, rgba(10, 14, 23, 0.3) 0%, rgba(10, 14, 23, 0.95) 100%),
        url('mycitybackground2.png') center bottom/cover no-repeat;
    pointer-events: none;
}

/* ============================================
   TOP NAVIGATION
   ============================================ */
.neural-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(10, 14, 23, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--neural-border);
}

.neural-nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.neural-nav-logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--neural-primary), var(--neural-secondary));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.neural-nav-logo-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 1px;
}

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

.neural-nav-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.neural-nav-link:hover {
    color: var(--neural-primary);
}

.neural-nav-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.neural-nav-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.neural-nav-btn.outline {
    background: transparent;
    border: 1px solid var(--neural-primary);
    color: var(--neural-primary);
}

.neural-nav-btn.outline:hover {
    background: rgba(15, 254, 251, 0.1);
}

.neural-nav-btn.filled {
    background: linear-gradient(135deg, var(--neural-primary), var(--neural-secondary));
    border: none;
    color: #000;
    font-weight: 600;
}

.neural-nav-btn.filled:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--neural-glow);
}

/* ============================================
   HERO SECTION
   ============================================ */
.neural-hero {
    position: relative;
    z-index: 10;
    padding: 120px 2rem 40px;
    text-align: center;
}

.neural-hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 4px;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 30px var(--neural-glow);
}

.neural-hero-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
    font-weight: 300;
}

.neural-hero-tagline {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 2rem;
}

/* Search Bar */
.neural-search {
    max-width: 600px;
    margin: 0 auto 3rem;
    position: relative;
}

.neural-search-input {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--neural-border);
    border-radius: 50px;
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.neural-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.neural-search-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--neural-primary);
    box-shadow: 0 0 20px rgba(15, 254, 251, 0.2);
}

.neural-search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 1rem;
}

/* ============================================
   NEURAL CLUSTERS CONTAINER
   ============================================ */
.neural-clusters {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: center;
    gap: 3rem;
    padding: 2rem;
    flex-wrap: wrap;
    max-width: 1600px;
    margin: 0 auto;
}

/* SVG Connection Lines Container */
.neural-connections-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.neural-connection-line {
    stroke: var(--neural-primary);
    stroke-width: 1;
    fill: none;
    opacity: 0.3;
    filter: drop-shadow(0 0 3px var(--neural-primary));
}

.neural-connection-line.active {
    opacity: 0.6;
    stroke-width: 2;
    animation: pulse-line 2s ease-in-out infinite;
}

@keyframes pulse-line {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* ============================================
   INDIVIDUAL CLUSTER
   ============================================ */
.neural-cluster {
    position: relative;
    width: 300px;
    height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Central Hub Node */
.neural-hub {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--neural-card-bg);
    border: 2px solid var(--cluster-color, var(--neural-primary));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 20;
    box-shadow:
        0 0 20px rgba(var(--cluster-rgb, 15, 254, 251), 0.3),
        inset 0 0 20px rgba(var(--cluster-rgb, 15, 254, 251), 0.1);
}

.neural-hub:hover {
    transform: scale(1.1);
    box-shadow:
        0 0 40px rgba(var(--cluster-rgb, 15, 254, 251), 0.5),
        inset 0 0 30px rgba(var(--cluster-rgb, 15, 254, 251), 0.2);
}

.neural-hub-icon {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.neural-hub-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    text-align: center;
    letter-spacing: 1px;
}

/* Cluster color variants */
.neural-cluster[data-cluster="personal"] {
    --cluster-color: var(--cluster-personal);
    --cluster-rgb: 255, 107, 157;
}

.neural-cluster[data-cluster="professional"] {
    --cluster-color: var(--cluster-professional);
    --cluster-rgb: 66, 197, 255;
}

.neural-cluster[data-cluster="tools"] {
    --cluster-color: var(--cluster-tools);
    --cluster-rgb: 15, 254, 251;
}

.neural-cluster[data-cluster="entertainment"] {
    --cluster-color: var(--cluster-entertainment);
    --cluster-rgb: 174, 159, 255;
}

/* Orbiting Nodes Container */
.neural-orbit {
    position: absolute;
    width: 280px;
    height: 280px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Individual Orbiting Node */
.neural-node {
    position: absolute;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--neural-card-bg);
    border: 1px solid var(--cluster-color, var(--neural-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
    box-shadow: 0 0 10px rgba(var(--cluster-rgb, 15, 254, 251), 0.2);
}

.neural-node:hover {
    transform: scale(1.2);
    z-index: 30;
    box-shadow: 0 0 25px rgba(var(--cluster-rgb, 15, 254, 251), 0.5);
}

.neural-node-icon {
    font-size: 1.3rem;
}

/* Node positions (6 nodes in orbit) */
.neural-node:nth-child(1) { top: 0; left: 50%; transform: translateX(-50%); }
.neural-node:nth-child(2) { top: 25%; right: 0; }
.neural-node:nth-child(3) { bottom: 25%; right: 0; }
.neural-node:nth-child(4) { bottom: 0; left: 50%; transform: translateX(-50%); }
.neural-node:nth-child(5) { bottom: 25%; left: 0; }
.neural-node:nth-child(6) { top: 25%; left: 0; }

/* Connection lines within cluster */
.neural-cluster-connections {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10;
}

.neural-cluster-line {
    stroke: var(--cluster-color, var(--neural-primary));
    stroke-width: 1;
    fill: none;
    opacity: 0.25;
}

/* Tooltip for nodes */
.neural-node-tooltip {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 14, 23, 0.95);
    border: 1px solid var(--neural-border);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #fff;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 50;
}

.neural-node:hover .neural-node-tooltip {
    opacity: 1;
}

/* ============================================
   PULSE ANIMATION
   ============================================ */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow:
            0 0 20px rgba(var(--cluster-rgb, 15, 254, 251), 0.3),
            inset 0 0 20px rgba(var(--cluster-rgb, 15, 254, 251), 0.1);
    }
    50% {
        box-shadow:
            0 0 35px rgba(var(--cluster-rgb, 15, 254, 251), 0.5),
            inset 0 0 25px rgba(var(--cluster-rgb, 15, 254, 251), 0.15);
    }
}

.neural-hub {
    animation: pulse-glow 3s ease-in-out infinite;
}

/* ============================================
   INTER-CLUSTER CONNECTIONS
   ============================================ */
.inter-cluster-connections {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.inter-connection {
    stroke: var(--neural-primary);
    stroke-width: 1;
    fill: none;
    opacity: 0.15;
    stroke-dasharray: 5, 10;
    animation: dash-flow 20s linear infinite;
}

@keyframes dash-flow {
    to { stroke-dashoffset: -1000; }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1400px) {
    .neural-clusters {
        gap: 2rem;
    }

    .neural-cluster {
        width: 260px;
        height: 280px;
    }

    .neural-hub {
        width: 100px;
        height: 100px;
    }

    .neural-orbit {
        width: 240px;
        height: 240px;
    }

    .neural-node {
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 1024px) {
    .neural-hero-title {
        font-size: 2.5rem;
    }

    .neural-clusters {
        gap: 1.5rem;
    }

    .neural-nav-links {
        display: none;
    }
}

@media (max-width: 768px) {
    .neural-hero {
        padding: 100px 1rem 30px;
    }

    .neural-hero-title {
        font-size: 1.8rem;
        letter-spacing: 2px;
    }

    .neural-hero-subtitle {
        font-size: 1rem;
    }

    .neural-clusters {
        flex-direction: column;
        align-items: center;
        gap: 3rem;
    }

    .neural-cluster {
        width: 280px;
        height: 300px;
    }

    .neural-nav {
        padding: 0.75rem 1rem;
    }

    .neural-nav-logo-text {
        font-size: 0.9rem;
    }
}

/* ============================================
   LOADING STATE
   ============================================ */
.neural-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--neural-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.neural-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.neural-loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid var(--neural-border);
    border-top-color: var(--neural-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   CATEGORY LABEL BELOW CLUSTER
   ============================================ */
.neural-cluster-label {
    margin-top: auto;
    padding-top: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--cluster-color, var(--neural-primary));
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(var(--cluster-rgb, 15, 254, 251), 0.5);
}
