/* ============================================
   RONDANINI UNIVERSE - Dark Theme Styles
   ============================================ */

/* CSS Custom Properties */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    --accent-cyan: #00f5ff;
    --accent-glow: rgba(0, 245, 255, 0.3);

    /* Category Colors */
    --cat-consulting: #ffd700;
    --cat-publishing: #00ff88;
    --cat-multimedia: #ff4444;
    --cat-blogs: #88ff00;
    --cat-music: #bf00ff;
    --cat-podcasts: #00ffcc;
    --cat-tools: #0088ff;
    --cat-ai: #ff0088;
    --cat-education: #ff8800;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Typography */
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Borders */
    --border-subtle: 1px solid rgba(255, 255, 255, 0.1);
    --border-glow: 1px solid rgba(0, 245, 255, 0.3);

    /* Shadows */
    --shadow-glow: 0 0 30px rgba(0, 245, 255, 0.2);
    --shadow-panel: 0 25px 50px rgba(0, 0, 0, 0.5);
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Canvas Container */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#canvas-container canvas {
    display: block;
}

/* ============================================
   LOADER
   ============================================ */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    text-align: center;
}

.loader-logo {
    margin-bottom: var(--space-xl);
}

.loader-img {
    width: 80px;
    height: 80px;
    animation: pulse 2s ease-in-out infinite;
}

.loader-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.loader-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    color: var(--accent-cyan);
    text-shadow: 0 0 20px var(--accent-glow);
}

.loader-bar {
    width: 200px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.loader-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--cat-music));
    border-radius: 2px;
    transition: width 0.3s ease;
}

.loader-status {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

/* ============================================
   HEADER
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: var(--space-lg) var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(10, 10, 15, 0.9), transparent);
    pointer-events: none;
}

.header > * {
    pointer-events: auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.header-logo {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.header-brand {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--text-primary);
}

.brand-tagline {
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.4em;
    color: var(--accent-cyan);
    text-shadow: 0 0 10px var(--accent-glow);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.nav-link:hover {
    color: var(--accent-cyan);
}

.nav-btn {
    width: 40px;
    height: 40px;
    border: var(--border-subtle);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.nav-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: var(--shadow-glow);
}

/* ============================================
   INSTRUCTIONS
   ============================================ */
.instructions {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-slow);
}

.instructions.visible {
    opacity: 1;
}

.instructions-content {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: rgba(0, 0, 0, 0.6);
    border: var(--border-subtle);
    border-radius: 50px;
    backdrop-filter: blur(10px);
}

.instructions-icon {
    color: var(--accent-cyan);
}

.instructions-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* ============================================
   STATS DISPLAY
   ============================================ */
.stats-display {
    position: fixed;
    top: var(--space-xl);
    right: var(--space-xl);
    display: flex;
    gap: var(--space-xl);
    z-index: 100;
    pointer-events: none;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-cyan);
    text-shadow: 0 0 20px var(--accent-glow);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ============================================
   CATEGORY FILTER
   ============================================ */
.category-filter {
    position: fixed;
    bottom: var(--space-xl);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--space-xs);
    padding: var(--space-sm);
    background: rgba(0, 0, 0, 0.6);
    border: var(--border-subtle);
    border-radius: 50px;
    backdrop-filter: blur(10px);
    z-index: 100;
    max-width: calc(100% - var(--space-xl) * 2);
    overflow-x: auto;
    scrollbar-width: none;
}

.category-filter::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border: none;
    border-radius: 50px;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.filter-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.filter-btn.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.filter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.filter-label {
    display: none;
}

@media (min-width: 768px) {
    .filter-label {
        display: inline;
    }
}

/* ============================================
   DETAIL PANEL
   ============================================ */
.detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 100%;
    height: 100%;
    background: var(--bg-secondary);
    border-left: var(--border-subtle);
    z-index: 200;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.detail-panel.open {
    transform: translateX(0);
}

.panel-close {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    width: 44px;
    height: 44px;
    border: var(--border-subtle);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 10;
}

.panel-close:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.panel-content {
    padding: var(--space-2xl);
    padding-top: calc(var(--space-2xl) + 44px);
    overflow-y: auto;
    flex: 1;
}

.panel-category {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.category-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
}

.category-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.panel-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    line-height: 1.3;
}

.panel-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-xl);
}

.panel-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.panel-tag {
    padding: var(--space-xs) var(--space-md);
    background: rgba(255, 255, 255, 0.05);
    border: var(--border-subtle);
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.panel-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: var(--accent-cyan);
    color: var(--bg-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 50px;
    transition: all var(--transition-fast);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    min-height: 50px;
    min-width: 150px;
}

.panel-cta:hover {
    background: var(--text-primary);
    box-shadow: 0 0 30px var(--accent-glow);
    transform: translateX(5px);
}

.panel-cta svg {
    transition: transform var(--transition-fast);
}

.panel-cta:hover svg {
    transform: translateX(5px);
}

/* ============================================
   SEARCH OVERLAY
   ============================================ */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    z-index: 300;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.search-overlay.open {
    opacity: 1;
    visibility: visible;
}

.search-container {
    width: 100%;
    max-width: 600px;
    padding: 0 var(--space-xl);
}

.search-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.search-input {
    flex: 1;
    padding: var(--space-lg);
    background: var(--bg-tertiary);
    border: var(--border-subtle);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1.2rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    border-color: var(--accent-cyan);
}

.search-close {
    width: 50px;
    height: 50px;
    border: var(--border-subtle);
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.search-close:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-height: 50vh;
    overflow-y: auto;
}

.search-result {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-tertiary);
    border: var(--border-subtle);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.search-result:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 245, 255, 0.05);
}

.search-result-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
}

.search-result-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.search-result-category {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.search-no-results {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-muted);
}

/* ============================================
   TOUCH HINT (Mobile)
   ============================================ */
.touch-hint {
    position: fixed;
    bottom: calc(var(--space-xl) + 70px);
    left: 50%;
    transform: translateX(-50%);
    display: none;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-muted);
    z-index: 50;
    opacity: 0;
    transition: opacity var(--transition-slow);
    pointer-events: none;
}

.touch-hint.visible {
    opacity: 1;
}

.touch-hint span {
    font-size: 0.8rem;
    letter-spacing: 0.1em;
}

@media (max-width: 768px) {
    .touch-hint {
        display: flex;
    }
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-md) var(--space-xl);
    background: linear-gradient(to top, rgba(10, 10, 15, 0.9), transparent);
    z-index: 50;
    pointer-events: none;
}

.footer > * {
    pointer-events: auto;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
}

.footer-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: var(--space-lg);
}

.footer-links a {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent-cyan);
}

/* ============================================
   NODE LABEL (3D Overlay)
   ============================================ */
.node-label {
    position: fixed;
    padding: var(--space-xs) var(--space-md);
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(0, 245, 255, 0.3);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    pointer-events: none;
    z-index: 150;
    transform: translate(-50%, -100%) translateY(-15px);
    opacity: 0;
    transition: opacity var(--transition-fast);
    white-space: nowrap;
}

.node-label.visible {
    opacity: 1;
}

.node-label::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(0, 245, 255, 0.3);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    .header {
        padding: var(--space-md);
    }

    .header-logo {
        width: 32px;
        height: 32px;
    }

    .brand-name {
        font-size: 0.85rem;
    }

    .brand-tagline {
        font-size: 0.55rem;
    }

    .stats-display {
        top: var(--space-md);
        right: var(--space-md);
        gap: var(--space-md);
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .category-filter {
        bottom: var(--space-md);
        padding: var(--space-xs);
    }

    .filter-btn {
        padding: var(--space-xs) var(--space-sm);
    }

    .detail-panel {
        width: 100%;
        height: auto;
        max-height: 70vh;
        top: auto;
        bottom: 0;
        border-left: none;
        border-top: var(--border-subtle);
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
    }

    .detail-panel.open {
        transform: translateY(0);
    }

    .panel-content {
        padding: var(--space-xl);
        padding-top: var(--space-lg);
    }

    .panel-close {
        top: var(--space-md);
        right: var(--space-md);
        width: 36px;
        height: 36px;
    }

    .panel-title {
        font-size: 1.25rem;
        padding-right: 50px;
    }

    .panel-cta {
        width: 100%;
        min-height: 56px;
        font-size: 1.1rem;
    }

    .footer {
        display: none;
    }
}

@media (max-width: 480px) {
    .instructions-content {
        padding: var(--space-xs) var(--space-md);
    }

    .instructions-text {
        font-size: 0.8rem;
    }

    .search-input {
        font-size: 1rem;
        padding: var(--space-md);
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
    display: none !important;
}

.no-scroll {
    overflow: hidden;
}

/* Smooth scroll for supported browsers */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}
