/* 📱 Mobile Skillbar Swipe Enhancement CSS */

/* Page Indicators */
.mobile-page-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 8px 0 4px 0;
    padding: 0 4px;
}

.page-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.page-indicator.active {
    background: #3498db;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.6);
    transform: scale(1.2);
    border-color: #3498db;
}

.page-indicator:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.page-indicator.active:hover {
    background: #2980b9;
}

/* Swipe Hint Text - Only shows on long press */
.swipe-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.7em;
    font-style: italic;
    text-shadow: none;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.swipe-hint.show {
    opacity: 1;
}

.swipe-hint.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Skill Container Transition Effects */
.skill-shortcuts {
    transition: transform 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

.skill-shortcuts.transitioning-next {
    animation: slideLeft 0.3s ease-out;
}

.skill-shortcuts.transitioning-previous {
    animation: slideRight 0.3s ease-out;
}

@keyframes slideLeft {
    0% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-20px);
    }
    100% {
        transform: translateX(0);
    }
}

@keyframes slideRight {
    0% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(20px);
    }
    100% {
        transform: translateX(0);
    }
}

/* Enhanced Mobile Skillbar */
@media (max-width: 768px) {
    .skill-shortcuts {
        position: relative;
        user-select: none;
        -webkit-user-select: none;
        touch-action: pan-y; /* Allow vertical scrolling but handle horizontal swipes */
    }
    
    /* Hidden slots on mobile */
    .shortcut-slot.mobile-hidden {
        display: none !important;
    }
    
    /* Make sure visible slots are properly spaced */
    .shortcut-slot:not(.mobile-hidden) {
        flex: 1;
        min-width: 0; /* Allow shrinking */
    }
    
    /* Page indicators only show on mobile */
    .mobile-page-indicators {
        display: flex;
    }
    
    /* Swipe hint positioned relative to skill container */
    .skill-shortcuts {
        position: relative;
    }
    
    /* Improve touch target size for mobile */
    .page-indicator {
        width: 12px;
        height: 12px;
        margin: 2px;
    }
    
    /* Better visual feedback on touch */
    .skill-shortcuts:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* Swipe hint animation removed - now triggered by long press */
}

/* Desktop - hide mobile indicators */
@media (min-width: 769px) {
    .mobile-page-indicators,
    .swipe-hint {
        display: none;
    }
    
    .shortcut-slot.mobile-hidden {
        display: flex !important;
    }
}

/* Accessibility improvements */
.page-indicator:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Touch feedback */
.page-indicator:active {
    transform: scale(0.9);
}

/* Smooth transitions for show/hide */
.shortcut-slot {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.shortcut-slot.mobile-hidden {
    opacity: 0;
    transform: scale(0.8);
}

/* Loading state for smooth initialization */
.skill-shortcuts.initializing .shortcut-slot {
    opacity: 0;
    transform: translateY(10px);
}

.skill-shortcuts.initialized .shortcut-slot {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Page transition effects */
.skill-shortcuts.page-changing {
    pointer-events: none; /* Prevent double-taps during transition */
}

/* Improve visual hierarchy */
.mobile-page-indicators {
    z-index: 10;
    position: relative;
}

/* Better spacing on very small screens */
@media (max-width: 480px) {
    .mobile-page-indicators {
        gap: 6px;
        margin: 6px 0 2px 0;
    }
    
    .page-indicator {
        width: 10px;
        height: 10px;
    }
    
    .swipe-hint {
        font-size: 0.65em;
        margin: 2px 0 6px 0;
    }
}

/* 📱 Fixed Game Text Scrolling for Mobile */
@media (max-width: 768px) {
    /* Ensure game text has consistent fixed height and smooth scrolling */
    .game-text {
        /* Touch scrolling optimizations */
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        
        /* Prevent rubber band effect at top/bottom */
        overscroll-behavior: contain;
        
        /* Improve touch interaction */
        touch-action: pan-y;
        
        /* Custom scrollbar hidden but functional */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .game-text::-webkit-scrollbar {
        display: none;
    }
    
    /* Scroll indicator for better UX */
    .game-text::after {
        content: '';
        position: absolute;
        top: 8px;
        right: 8px;
        width: 4px;
        height: 20px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }
    
    .game-text:hover::after,
    .game-text:focus::after {
        opacity: 1;
    }
    
    /* Fade effect at top and bottom to indicate scrollability */
    .game-text::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 10px;
        background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
        pointer-events: none;
        z-index: 1;
    }
}
