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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
}

#app {
    position: relative;
    width: 100vw;
    height: 100vh;
}

/* Welcome Screen */
.welcome-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    transition: all 0.8s ease;
    padding: 60px 40px;
}

.welcome-screen.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}

.welcome-content {
    text-align: center;
    max-width: 600px;
    padding: 0;
}

.welcome-top {
    text-align: center;
    max-width: 600px;
}

.welcome-bottom {
    text-align: center;
    max-width: 600px;
}

.welcome-title {
    font-size: 3.5rem;
    font-weight: 300;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #00ff88, #0099ff, #88ff00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: float 6s ease-in-out infinite;
}

.welcome-subtitle {
    font-size: 1.3rem;
    color: #cccccc;
    margin-bottom: 30px;
    line-height: 1.4;
}

.welcome-description {
    margin-bottom: 40px;
}

.welcome-description p {
    font-size: 1rem;
    color: #aaaaaa;
    line-height: 1.6;
    margin-bottom: 15px;
}

.start-button {
    background: linear-gradient(45deg, #00ff88, #0099ff);
    border: none;
    color: black;
    padding: 18px 40px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(0, 255, 136, 0.3);
    position: relative;
    overflow: hidden;
    max-width: fit-content;
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 255, 136, 0.4);
}

.start-button:active {
    transform: translateY(0);
}

.start-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.start-button:hover::before {
    left: 100%;
}

.button-icon {
    font-size: 1.4rem;
    animation: pulse 2s infinite;
}

.preview-note {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-note p {
    font-size: 0.9rem;
    color: #888888;
    font-style: italic;
}

/* Header */
#header {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
    max-width: 400px;
    transition: all 0.5s ease;
}

#header.hidden {
    opacity: 0;
    transform: translateY(-20px);
}

#header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 10px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(45deg, #00ff88, #0099ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#header p {
    font-size: 1rem;
    color: #aaaaaa;
    margin-bottom: 20px;
}

/* Loading Styles */
.loading {
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.loading-text {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #00ff88;
}

.loading-bar {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #00ff88, #0099ff);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

#loading-status {
    font-size: 0.9rem;
    color: #aaaaaa;
}

/* Visualization Container */
#viz-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#three-canvas {
    display: block;
    cursor: default;
}

/* Info Panel */
.info-panel {
    position: absolute;
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 25px;
    min-width: 220px;
    max-width: 300px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    overflow: visible;
}

.info-panel.collapsed {
    transform: translateY(-50%) translateX(calc(100% - 0px));
}

.info-toggle-btn {
    position: absolute;
    left: -40px;
    top: 20px;
    z-index: 1000;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    color: #00ff88;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-toggle-btn:hover {
    background: rgba(0, 255, 136, 0.2);
    border-color: rgba(0, 255, 136, 0.5);
}

.info-panel.collapsed .info-content {
    opacity: 0;
    pointer-events: none;
}



.toggle-icon {
    transition: transform 0.3s ease;
}

.info-panel.collapsed .toggle-icon {
    transform: rotate(180deg);
}

.info-content {
    padding: 0;
    transition: opacity 0.3s ease;
}

.info-panel.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) translateX(50px);
}

.info-content h3 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: #00ff88;
    word-break: break-word;
}

.site-name-with-link {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.site-name-with-link .site-text {
    transition: all 0.2s ease;
}

.site-name-with-link:hover .site-text {
    color: #88ffaa;
    text-decoration: underline;
}

.site-name-with-link .external-link {
    font-size: 1.2rem;
    color: #00ff88;
    opacity: 0.7;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    vertical-align: baseline;
    line-height: 1;
}

.site-name-with-link:hover .external-link {
    opacity: 1;
    transform: translateX(2px);
    color: #88ffaa;
}

/* Hosted by link styling */
.info-row a {
    color: #00ff88;
    text-decoration: none;
    transition: all 0.2s ease;
}

.info-row a:hover {
    color: #88ffaa;
    text-decoration: underline;
}

.info-row a .external-link {
    font-size: 1rem;
    color: #00ff88;
    opacity: 0.7;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-left: 5px;
    vertical-align: baseline;
    line-height: 1;
}

.info-row a:hover .external-link {
    opacity: 1;
    transform: translateX(2px);
    color: #88ffaa;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.95rem;
    padding: 2px 0;
}

.info-row .label {
    margin-right: 12px;
}

.info-row span:last-child {
    margin-left: 8px;
}

.info-section {
    margin-top: 16px;
    margin-bottom: 8px;
    padding-top: 12px;
    border-top: 1px solid #333;
}

.info-section .info-row {
    margin-bottom: 6px;
}

.info-description {
    font-size: 0.95rem;
    line-height: 1.4;
    color: #b0b0b0;
    margin-top: 2px;
    word-wrap: break-word;
    text-align: left;
    padding-left: 0;
    overflow-wrap: break-word;
    hyphens: auto;
}

.label {
    color: #aaaaaa;
    font-weight: 500;
}

.spark-label {
    color: #00ff88;
    display: flex;
    align-items: center;
    gap: 6px;
}

.spark-icon {
    fill: #00ff88;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.visit-btn {
    background: linear-gradient(45deg, #00ff88, #0099ff);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 15px;
    width: 100%;
    transition: transform 0.2s ease;
}

.visit-btn:hover {
    transform: scale(1.05);
}

/* Controls */
.controls {
    position: absolute;
    bottom: 30px;
    left: 30px;
    z-index: 100;
}

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

.controls button {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    color: #00ff88;
    padding: 8px 16px;
    margin-right: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 400;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.controls button:hover {
    background: rgba(0, 255, 136, 0.15);
    border-color: rgba(0, 255, 136, 0.5);
    color: #00ff88;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 255, 136, 0.1);
}

.controls button:active {
    transform: translateY(0);
    background: rgba(0, 255, 136, 0.2);
}

/* Legend */
.legend {
    margin-top: 15px;
    max-width: 300px;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 1rem;
    color: #aaaaaa;
    font-weight: 300;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
}

.legend-color.green {
    background: #24ff87;
    box-shadow: 0 0 10px rgba(0, 255, 102, 0.5);
}

.legend-color.dark-green {
    background: #073610;
    box-shadow: 0 0 15px rgba(8, 42, 8, 0.8);
    border: 1px solid rgba(5, 26, 5, 0.3);
}

.legend-note {
    font-size: 0.85rem;
    color: #aaaaaa;
    margin-top: 10px;
    font-weight: 300;
    font-style: italic;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    #header {
        max-width: 300px;
    }
    
    #header h1 {
        font-size: 2rem;
    }
    
    .info-panel {
        right: 20px;
        min-width: 200px;
        max-width: 260px;
    }
    
    .controls {
        bottom: 20px;
        left: 20px;
    }
    
    .legend {
        max-width: 250px;
    }
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

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

.floating {
    animation: float 3s ease-in-out infinite;
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

/* Glow effects for particles (will be applied via Three.js)? */
.particle-glow {
    filter: drop-shadow(0 0 10px currentColor);
}
