/* 2025 Year in Review - Constellation Visualization */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000011;
    color: #ffffff;
    overflow: hidden;
}

/* Three.js Canvas Container */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

/* Stats Overlay - Top Left */
#stats-overlay {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
    background: rgba(0, 0, 20, 0.7);
    backdrop-filter: blur(10px);
    padding: 20px 25px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#stats-overlay h1 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #4FC3F7, #AB47BC, #FFA726);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(79, 195, 247, 0.5);
}

.stat-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Constellation Legend - Bottom Left */
#constellation-legend {
    position: fixed;
    bottom: 60px;
    left: 20px;
    z-index: 100;
    background: rgba(0, 0, 20, 0.7);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.legend-item:hover {
    transform: translateX(5px);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
}

.legend-item[data-constellation="education"] .legend-color {
    background: #4FC3F7;
    color: #4FC3F7;
}

.legend-item[data-constellation="agents"] .legend-color {
    background: #AB47BC;
    color: #AB47BC;
}

.legend-item[data-constellation="research"] .legend-color {
    background: #66BB6A;
    color: #66BB6A;
}

.legend-item[data-constellation="webapps"] .legend-color {
    background: #FFA726;
    color: #FFA726;
}

.legend-item[data-constellation="tools"] .legend-color {
    background: #EF5350;
    color: #EF5350;
}

.legend-name {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Info Panel - Right Side */
#info-panel {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%) translateX(0);
    z-index: 100;
    width: 320px;
    background: rgba(0, 0, 20, 0.9);
    backdrop-filter: blur(20px);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

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

#close-panel {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

#close-panel:hover {
    color: #ffffff;
}

#project-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    padding-right: 30px;
}

#project-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    margin-bottom: 20px;
}

.project-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.project-stat {
    display: flex;
    flex-direction: column;
}

.project-stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #4FC3F7;
}

.project-stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

#ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #AB47BC, #4FC3F7);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 15px;
}

#ai-badge.hidden {
    display: none;
}

#article-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FFD700, #FFA726);
    color: #000011;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 15px;
}

#article-badge.hidden {
    display: none;
}

#read-link {
    background: linear-gradient(135deg, #FFD700, #FFA726) !important;
    color: #000011 !important;
    font-weight: 600;
}

#related-repos {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#related-repos.hidden {
    display: none;
}

.related-label {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.related-repo {
    display: inline-block;
    background: rgba(79, 195, 247, 0.2);
    color: #4FC3F7;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin: 2px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.related-repo:hover {
    background: rgba(79, 195, 247, 0.4);
    transform: translateY(-1px);
}

/* Writing Galaxy legend - diamond marker */
.legend-item[data-constellation="writing"] .legend-color {
    background: #FFD700;
    color: #FFD700;
    transform: rotate(45deg);
    border-radius: 2px;
}

#github-link {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.link-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.link-buttons a {
    display: inline-block;
    color: #ffffff;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

#website-link {
    background: rgba(255, 255, 255, 0.1);
}

#github-link {
    background: rgba(255, 255, 255, 0.1);
}

#article-link {
    background: rgba(255, 255, 255, 0.1);
}

.link-buttons a:hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
}

.link-buttons a.hidden,
#github-link.hidden,
#website-link.hidden,
#article-link.hidden,
#read-link.hidden {
    display: none !important;
}

/* Tour Narration - Center Bottom */
#tour-narration {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: 90%;
    max-width: 600px;
    background: rgba(0, 0, 20, 0.9);
    backdrop-filter: blur(20px);
    padding: 25px 30px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    text-align: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#tour-narration.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}

#tour-text {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

#tour-text strong {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: #4FC3F7;
}

.tour-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.tour-controls button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 10px 25px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tour-controls button:hover {
    background: rgba(255, 255, 255, 0.2);
}

#next-tour {
    background: linear-gradient(135deg, #4FC3F7, #AB47BC);
    border: none;
}

#next-tour:hover {
    filter: brightness(1.1);
}

/* Loading Screen */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    background: #000011;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #4FC3F7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

#loading p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* Instructions Hint */
#instructions {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    text-align: center;
}

#instructions.hidden {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    #stats-overlay {
        top: 10px;
        left: 10px;
        padding: 15px;
    }

    #stats-overlay h1 {
        font-size: 1.1rem;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    #constellation-legend {
        bottom: 50px;
        left: 10px;
        padding: 10px 15px;
    }

    #info-panel {
        width: calc(100vw - 40px);
        right: 20px;
        max-height: 50vh;
        overflow-y: auto;
    }

    #tour-narration {
        bottom: 60px;
        padding: 20px;
    }
}
