/* Game Provider Gallery - Frontend Styles */

.gpg-gallery-wrapper {
    display: flex;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Sidebar (Menu ด้านซ้าย) */
.gpg-sidebar {
    width: 140px;
    flex-shrink: 0;
}

/* Popular Categories Section (Square Icons) */
.gpg-popular-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.gpg-popular-title {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
    padding: 8px;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    border-radius: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.gpg-popular-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.gpg-popular-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px;
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border: 2px solid #2471a3;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.gpg-popular-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #2980b9 0%, #2471a3 100%);
}

.gpg-popular-btn.active {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    border-color: #d35400;
    transform: scale(1.05);
}

.gpg-popular-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.gpg-popular-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gpg-popular-name {
    color: #fff;
    font-weight: 600;
    font-size: 11px;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
    max-width: 100%;
    word-break: break-word;
}

.gpg-categories-menu {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gpg-category-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 10px;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    border: 3px solid #229954;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    min-height: 90px;
}

.gpg-category-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
}

.gpg-category-btn.active {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    border-color: #d35400;
    transform: scale(1.05);
}

.gpg-category-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    overflow: hidden;
}

.gpg-category-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gpg-category-icon span {
    font-size: 28px;
}

.gpg-category-name {
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

/* Main Content (Gallery ด้านขวา) */
.gpg-main-content {
    flex: 1;
}

.gpg-providers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    background: transparent;
}

.gpg-provider-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Square mode for Popular Categories */
.gpg-providers-grid.square-mode .gpg-provider-image,
.gpg-providers-grid.square-mode .gpg-provider-placeholder {
    aspect-ratio: 1 / 1;
}

.gpg-provider-image:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.gpg-provider-image.hidden {
    display: none;
}

.gpg-provider-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
}

.gpg-provider-placeholder span {
    color: #fff;
    font-weight: bold;
    font-size: 18px;
    text-align: center;
    padding: 10px;
}

/* No Providers Message */
.gpg-no-providers {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.gpg-no-providers p {
    margin: 10px 0;
    font-size: 16px;
}

/* Tablet */
@media (min-width: 768px) {
    .gpg-providers-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .gpg-sidebar {
        width: 160px;
    }

    .gpg-category-btn {
        min-height: 100px;
    }

    .gpg-category-name {
        font-size: 15px;
    }

    /* Popular Section - Tablet */
    .gpg-popular-grid {
        gap: 10px;
    }

    .gpg-popular-icon {
        width: 55px;
        height: 55px;
    }

    .gpg-popular-name {
        font-size: 12px;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .gpg-providers-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .gpg-sidebar {
        width: 180px;
    }

    .gpg-category-btn {
        min-height: 110px;
        padding: 18px 12px;
    }

    .gpg-category-icon {
        width: 55px;
        height: 55px;
    }

    .gpg-category-name {
        font-size: 16px;
    }

    /* Popular Section - Desktop */
    .gpg-popular-section {
        margin-bottom: 25px;
        padding-bottom: 20px;
    }

    .gpg-popular-title {
        font-size: 15px;
        padding: 10px;
    }

    .gpg-popular-grid {
        gap: 12px;
    }

    .gpg-popular-btn {
        padding: 10px;
        gap: 6px;
    }

    .gpg-popular-icon {
        width: 60px;
        height: 60px;
    }

    .gpg-popular-name {
        font-size: 13px;
    }
}

/* Large Desktop */
@media (min-width: 1280px) {
    .gpg-providers-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Extra Large Desktop */
@media (min-width: 1600px) {
    .gpg-providers-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Mobile - Keep Sidebar on Left */
@media (max-width: 640px) {
    .gpg-gallery-wrapper {
        gap: 10px;
        padding: 10px;
    }

    .gpg-sidebar {
        width: 80px;
        flex-shrink: 0;
    }

    /* Popular Section - Mobile */
    .gpg-popular-section {
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    .gpg-popular-title {
        font-size: 11px;
        padding: 5px;
        margin-bottom: 8px;
    }

    .gpg-popular-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }

    .gpg-popular-btn {
        padding: 5px;
        gap: 3px;
        border-radius: 8px;
    }

    .gpg-popular-icon {
        width: 32px;
        height: 32px;
        border-radius: 6px;
    }

    .gpg-popular-name {
        font-size: 8px;
    }

    .gpg-categories-menu {
        gap: 8px;
    }

    .gpg-category-btn {
        min-height: 75px;
        padding: 8px 4px;
        gap: 3px;
    }

    .gpg-category-icon {
        width: 36px;
        height: 36px;
    }

    .gpg-category-icon span {
        font-size: 20px;
    }

    /* แสดง label ใต้ไอคอนในมือถือ */
    .gpg-category-name {
        display: block;
        font-size: 10px;
        line-height: 1.1;
        word-break: break-word;
        max-width: 100%;
    }

    .gpg-providers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .gpg-provider-image {
        border-radius: 8px;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gpg-provider-image {
    animation: fadeIn 0.3s ease-in-out;
}
