/* ========================================
   ✨ SHOOTING STAR HABIT TRACKER STYLES
   ======================================== */

/* Night Sky Container */
.night-sky {
    width: 100%;
    height: 300px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 20px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
}

/* Gem Row (Current Gems Display) */
.gem-row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    /* Allow wrapping to prevent squishing */
    gap: 12px;
    min-height: 60px;
    padding: 12px;
}

/* Individual Gem and Placeholder Shared Styles */
.gem,
.gem-placeholder {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    flex-shrink: 0;
    border-radius: 50%;
    aspect-ratio: 1 / 1;
}

/* Individual Gem */
.gem {
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: gemFadeIn 0.5s ease-out;
}

.gem-placeholder {
    border: 2px dashed #ddd;
}

.gem:hover {
    transform: scale(1.15) translateY(-4px);
}

/* Gem Colors - Simple solid colors */
.gem-purple {
    background: #9d8df1;
}


/* Gem Tooltip */
.gem-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
    transform: translateY(-100%) translateX(-50%);
    margin-top: -8px;
}

/* Constellation */
.constellation {
    position: absolute;
    transition: opacity 0.3s ease;
}

.constellation:hover {
    opacity: 1 !important;
}

.star {
    width: 2px;
    height: 2px;
    border-radius: 50%;
    position: absolute;
    cursor: pointer;
    background-color: white !important;
    color: white !important;
    transition: all 0.2s ease;
    box-shadow: 0 0 3px rgba(255, 255, 255, 0.5), 0 0 6px rgba(255, 255, 255, 0.2);
    animation: starTwinkle 3s ease-in-out infinite;
}

.star:hover {
    transform: scale(3);
    box-shadow: 0 0 10px rgba(255, 255, 255, 1), 0 0 20px rgba(255, 255, 255, 0.6);
}

/* Shooting Star Animation */
@keyframes shootingStar {
    0% {
        transform: translate(0, 0);
        opacity: 1;
    }

    100% {
        transform: translate(-300px, 300px);
        opacity: 0;
    }
}

.shooting-star {
    animation: shootingStar 2s ease-in forwards;
}

/* Gem Fade In */
@keyframes gemFadeIn {
    from {
        opacity: 0;
        transform: scale(0.5) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Star Twinkle */
@keyframes starTwinkle {

    0%,
    100% {
        opacity: 0.8;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Sparkle Effect (for 10-gem completion) */
@keyframes sparkle {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: scale(2) rotate(180deg);
        opacity: 0;
    }
}

.sparkle {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 70%);
    animation: sparkle 1s ease-out forwards;
    pointer-events: none;
}

/* Color Button Active State */
.gem-color-btn.active {
    border: 3px solid white !important;
    box-shadow: 0 0 0 2px var(--rui-purple), 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

.gem-color-btn:hover {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* History Section */
#history-list {
    transition: max-height 0.3s ease, display 0.3s ease;
}

.history-item {
    padding: 12px;
    margin-bottom: 8px;
    background: #f9f9f9;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-item:hover {
    background: #f0f0f0;
    border-color: var(--rui-purple);
    transform: translateX(4px);
}

.history-item-date {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 4px;
}

.history-item-count {
    font-size: 0.9rem;
    color: var(--rui-purple);
    font-weight: 600;
}

/* Fancy Button State */
.gem-btn-fancy {
    background: linear-gradient(135deg, #f3d07c 0%, #9d8df1 50%, #f37cb9 100%) !important;
    background-size: 200% 200% !important;
    animation: fancyPulse 2s infinite, fancyGlow 3s infinite ease-in-out, rainbowShift 5s infinite linear !important;
    box-shadow: 0 0 15px rgba(243, 208, 124, 0.6), 0 0 30px rgba(157, 141, 241, 0.4) !important;
    transform: scale(1.02);
    border: none !important;
    color: white !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.gem-btn-fancy:hover {
    transform: scale(1.08) !important;
    box-shadow: 0 0 25px rgba(243, 208, 124, 0.8), 0 0 40px rgba(157, 141, 241, 0.6) !important;
}

@keyframes rainbowShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes fancyPulse {
    0% {
        transform: scale(1.02);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1.02);
    }
}

@keyframes fancyGlow {

    0%,
    100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.2);
    }
}