/* Custom styles for First Star I See */

/* Starfield Background */
body {
    position: relative;
    overflow-x: hidden;
}

body::before,
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Light mode - subtle stars */
body::before {
    background-image:
        radial-gradient(2px 2px at 20% 30%, rgba(79, 70, 229, 0.3), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(79, 70, 229, 0.3), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(79, 70, 229, 0.4), transparent),
        radial-gradient(1px 1px at 80% 10%, rgba(79, 70, 229, 0.4), transparent),
        radial-gradient(2px 2px at 90% 60%, rgba(79, 70, 229, 0.3), transparent),
        radial-gradient(1px 1px at 33% 80%, rgba(79, 70, 229, 0.4), transparent),
        radial-gradient(1px 1px at 70% 40%, rgba(79, 70, 229, 0.4), transparent);
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: starsScroll 200s linear infinite;
}

body::after {
    background-image:
        radial-gradient(1px 1px at 10% 20%, rgba(79, 70, 229, 0.5), transparent),
        radial-gradient(1px 1px at 40% 60%, rgba(79, 70, 229, 0.5), transparent),
        radial-gradient(1px 1px at 75% 35%, rgba(79, 70, 229, 0.5), transparent),
        radial-gradient(1px 1px at 25% 75%, rgba(79, 70, 229, 0.5), transparent);
    background-repeat: repeat;
    background-size: 300px 300px;
    animation: starsScroll 300s linear infinite;
}

/* Dark mode - brighter stars */
html.dark body::before {
    background-image:
        radial-gradient(2px 2px at 20% 30%, rgba(255, 215, 0, 0.6), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(255, 215, 0, 0.7), transparent),
        radial-gradient(1px 1px at 80% 10%, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(2px 2px at 90% 60%, rgba(255, 215, 0, 0.5), transparent),
        radial-gradient(1px 1px at 33% 80%, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1px 1px at 70% 40%, rgba(255, 215, 0, 0.6), transparent);
}

html.dark body::after {
    background-image:
        radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1px 1px at 40% 60%, rgba(255, 215, 0, 0.7), transparent),
        radial-gradient(1px 1px at 75% 35%, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1px 1px at 25% 75%, rgba(255, 215, 0, 0.8), transparent);
}

@keyframes starsScroll {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-200px);
    }
}

/* Ensure content is above starfield */
nav,
main,
footer {
    position: relative;
    z-index: 1;
}

/* Smooth transitions */
* {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 200ms;
}

/* Constellation card animations */
.constellation-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.constellation-card:hover {
    transform: translateY(-4px);
}

/* Custom scrollbar for dark mode */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

html.dark ::-webkit-scrollbar-track {
    background: #1a1f3a;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

html.dark ::-webkit-scrollbar-thumb {
    background: #4a5568;
}

html.dark ::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

/* Loading animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Card gradient overlay on hover (optional enhancement) */
.constellation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4f46e5, #7c3aed, #ec4899);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.constellation-card:hover::before {
    opacity: 1;
}

/* Ensure cards have relative positioning for the gradient */
.constellation-card {
    position: relative;
}

/* Smooth height transitions for expanding/collapsing hints */
.navigation-hints {
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

/* Constellation SVG Styling */
.constellation-svg-container {
    padding: 1rem 0;
}

.constellation-svg {
    color: #4f46e5; /* Indigo color for light mode */
    filter: drop-shadow(0 0 2px rgba(79, 70, 229, 0.3));
    transition: transform 0.3s ease, filter 0.3s ease;
}

html.dark .constellation-svg {
    color: #ffd700; /* Gold color for dark mode */
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.4));
}

.constellation-card:hover .constellation-svg {
    transform: scale(1.05);
    filter: drop-shadow(0 0 6px rgba(79, 70, 229, 0.5));
}

html.dark .constellation-card:hover .constellation-svg {
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

.constellation-path {
    stroke-width: 1.5;
}

.constellation-star {
    animation: twinkle 2s ease-in-out infinite;
}

/* Stagger the animation for different stars */
.constellation-star:nth-child(2) {
    animation-delay: 0.2s;
}

.constellation-star:nth-child(3) {
    animation-delay: 0.4s;
}

.constellation-star:nth-child(4) {
    animation-delay: 0.6s;
}

.constellation-star:nth-child(5) {
    animation-delay: 0.8s;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Focus styles for accessibility */
button:focus,
select:focus {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

html.dark button:focus,
html.dark select:focus {
    outline-color: #ffd700;
}

/* Found Overlay Styles */
.found-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 0.5rem;
}

html.dark .found-overlay {
    background: rgba(26, 31, 58, 0.95);
}

.found-check-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.found-check-mark {
    color: #10b981; /* Green */
    filter: drop-shadow(0 4px 6px rgba(16, 185, 129, 0.3));
}

html.dark .found-check-mark {
    color: #34d399;
    filter: drop-shadow(0 4px 6px rgba(52, 211, 153, 0.4));
}

.check-circle {
    animation: checkCircleScale 0.5s ease-out;
}

.check-path {
    stroke: white;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: checkPathDraw 0.5s ease-out 0.2s forwards;
}

html.dark .check-path {
    stroke: #0a0e27; /* Dark background color for contrast */
}

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

@keyframes checkPathDraw {
    to {
        stroke-dashoffset: 0;
    }
}

.found-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #10b981;
    animation: fadeInUp 0.5s ease-out 0.4s both;
}

html.dark .found-text {
    color: #34d399;
}

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

.found-animation {
    animation: foundPulse 0.5s ease-out;
}

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

/* Previously seen subtle indicator */
.constellation-card.previously-seen {
    opacity: 0.85;
}

.constellation-card.previously-seen:hover {
    opacity: 1;
}
