/* Local History UI Component Styles */

/* Outer container with padding and background */
.local-history-container {
    width: 100%;
    max-width: 100%;
    padding: 20px 0;
    background-color: var(--color-dark);
    position: relative;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Scroll arrows */
.local-history-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--color-light);
    border-radius: 50%;
    color: var(--text-color);
    font-size: 16px;
    cursor: pointer;
    z-index: 1000; /* Higher than game icon preview (969) to stay on top */
    display: none; /* Hidden by default, shown by JavaScript when needed */
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease-in-out;
    backdrop-filter: blur(4px);
}

.local-history-arrow:hover {
    background-color: rgba(0, 0, 0, 0.8);
    border-color: var(--highlight-color);
    transform: translateY(-50%) scale(1.1);
}

.local-history-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.local-history-arrow-left {
    left: 10px;
}

.local-history-arrow-right {
    right: 10px;
}

/* Show arrows when they have the 'visible' class */
.local-history-arrow.visible {
    display: flex;
}

/* Horizontal scrolling container */
.local-history-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 20px;
    scroll-behavior: smooth;
    user-select: none; /* Prevent text selection while dragging */
}

/* Dragging state */
.local-history-scroll.dragging {
    scroll-behavior: auto; /* Disable smooth scroll while dragging for better responsiveness */
}

.local-history-scroll.dragging .local-history-item {
    pointer-events: none; /* Prevent hover effects while dragging */
}

/* Individual game item - half size of _GameBoxSmall */
.local-history-item {
    flex-shrink: 0;
    width: 120px;
    aspect-ratio: 35 / 21;
    position: relative;
    border-radius: 14px;
    border: 2px solid transparent;
    transition: border-color 0.3s ease-in-out;
    cursor: pointer;
}

.local-history-item:hover {
    border-color: var(--highlight-color);
    z-index: 10;
}

/* Game thumbnail image */
.local-history-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
    transition: transform 0.3s ease-in-out;
}

.local-history-item:hover .local-history-thumbnail {
    transform: scale(1.05);
}

/* Game title overlay */
.local-history-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    color: var(--text-color);
    padding: 8px 6px;
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    border-radius: 0 0 14px 14px;
    pointer-events: none;
}

.local-history-item:hover .local-history-title {
    opacity: 1;
}

/* Minimal scrollbar styling */
.local-history-scroll::-webkit-scrollbar {
    height: 6px;
}

.local-history-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.local-history-scroll::-webkit-scrollbar-thumb {
    background: var(--color-light);
    border-radius: 3px;
}

.local-history-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--highlight-color);
}

/* Responsive adjustments for mobile devices */
@media (max-width: 768px) {
    .local-history-container {
        padding: 15px 0;
    }

    .local-history-scroll {
        gap: 10px;
        padding: 0 15px;
    }

    .local-history-item {
        width: 100px;
    }

    .local-history-title {
        font-size: 10px;
        padding: 6px 4px;
    }

    /* Smaller arrows on tablet */
    .local-history-arrow {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .local-history-arrow-left {
        left: 8px;
    }

    .local-history-arrow-right {
        right: 8px;
    }
}

@media (max-width: 480px) {
    .local-history-container {
        padding: 10px 0;
    }

    .local-history-scroll {
        gap: 8px;
        padding: 0 10px;
    }

    .local-history-item {
        width: 90px;
    }

    .local-history-title {
        font-size: 9px;
        padding: 5px 3px;
    }

    /* Even smaller arrows on mobile */
    .local-history-arrow {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .local-history-arrow-left {
        left: 5px;
    }

    .local-history-arrow-right {
        right: 5px;
    }
}
