/* Custom styles for Interactive Story Game */

/* Fade animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out forwards;
}

.fade-out {
    animation: fadeOut 0.5s ease-in-out forwards;
}

/* Scene transition effects */
.scene-transition {
    transition: all 0.5s ease;
}

/* Custom scrollbar for story text */
.prose::-webkit-scrollbar {
    width: 8px;
}

.prose::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.prose::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5); /* Purple with opacity */
    border-radius: 10px;
}

.dark .prose::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.dark .prose::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.7);
}

/* Typewriter effect for story text */
.typewriter {
    overflow: hidden;
    border-right: 2px solid transparent;
    white-space: nowrap;
    margin: 0;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: #a855f7; }
}

/* Flash animation for intro screen */
@keyframes flash {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.5; }
}

.flash-animation {
    animation: flash 2s ease-in-out;
}

/* Pulse animation for buttons */
@keyframes pulse-button {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse-animation {
    animation: pulse-button 2s infinite;
}

/* Loading bar animation */
@keyframes loading {
    0% { width: 0%; }
    100% { width: 100%; }
}

.loading-animation {
    animation: loading 3s ease-in-out forwards;
}

/* Choice hover effects */
.choice-btn {
    position: relative;
    overflow: hidden;
}

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

.choice-btn:hover::after {
    left: 100%;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .typewriter {
        white-space: normal;
        animation: none;
        border-right: none;
    }
    
    .choice-btn {
        padding: 12px !important;
    }
}

/* Story image styling */
.story-image {
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.dark .story-image {
    box-shadow: 0 4px 6px -1px rgba(255, 255, 255, 0.1), 0 2px 4px -1px rgba(255, 255, 255, 0.06);
}

/* Highlight current choice */
.choice-active {
    border-left-width: 6px !important;
    transform: translateX(4px);
}
