/* Custom animations and styles */

/* Screen transitions */
.screen {
    animation: fadeSlideIn 0.4s ease-out forwards;
    overflow-x: hidden;
}

.screen-exit {
    animation: fadeSlideOut 0.3s ease-in forwards;
    overflow-x: hidden;
}

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

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

/* Button press effect */
.btn-press {
    transition: all 0.15s ease;
}

.btn-press:active {
    transform: scale(0.97);
}

/* Card hover/tap effect */
.card-interactive {
    transition: all 0.2s ease;
}

.card-interactive:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px -10px rgba(127, 90, 240, 0.5);
}

.card-interactive:active {
    transform: scale(0.98);
}

/* Question reveal animation */
.question-reveal {
    animation: revealPulse 0.6s ease-out forwards;
}

@keyframes revealPulse {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Vote button animation */
.vote-btn {
    transition: all 0.2s ease;
}

.vote-btn:hover {
    background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
    transform: scale(1.02);
}

.vote-btn.selected {
    background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
    box-shadow: 0 0 30px rgba(233, 69, 96, 0.5);
}

/* Progress bar animation */
.progress-fill {
    transition: width 0.5s ease-out;
}

/* Stagger animation for lists */
.stagger-item {
    opacity: 0;
    animation: staggerIn 0.4s ease-out forwards;
}

@keyframes staggerIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Floating animation for decorative elements */
.float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Pulse glow effect */
.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(127, 90, 240, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(127, 90, 240, 0.7);
    }
}

/* Expand/collapse for saved rounds */
.expandable-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.expandable-content.expanded {
    max-height: 500px;
    padding-top: 1rem;
}

/* Drag and drop styles */
.cursor-move {
    cursor: move;
    cursor: grab;
    user-select: none;
    -webkit-user-drag: element;
}

.cursor-move:active {
    cursor: grabbing !important;
}

.player-item {
    transition: all 0.2s ease;
    touch-action: pan-y;
}

.player-item:hover {
    transform: translateX(4px);
}

/* Allow scrolling in player list */
#players-list {
    touch-action: pan-y;
}

.player-item[draggable="true"] {
    cursor: grab;
}

.player-item[draggable="true"]:active {
    cursor: grabbing !important;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 161, 178, 0.5);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(127, 90, 240, 0.7);
}

/* Input focus styles */
input:focus, textarea:focus, select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(127, 90, 240, 0.3);
}

/* Number input hide arrows */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Bar chart animation */
.bar-fill {
    animation: barGrow 0.8s ease-out forwards;
    transform-origin: left;
}

@keyframes barGrow {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

/* Confetti-like celebration */
.celebrate {
    position: relative;
}

.celebrate::before {
    content: '🎉';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    animation: celebrateBounce 0.6s ease-out;
}

@keyframes celebrateBounce {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px) scale(0);
    }
    50% {
        transform: translateX(-50%) translateY(-10px) scale(1.2);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

