/* ===== GENERAL STYLES ===== */
body {
    background-color: #000000;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    padding-bottom: 70px;
    color: var(--font-color);
}

.bg-index {
    background-image: url('img/backdrop.webp');
    background-position: center;
    background-size: cover;
    overflow: hidden;
    max-width: var(--main-bg-size);
    margin: 0 auto;
}

.main-container {
    width: 100%;
    /* height: 100%; */
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== CONTENT STYLES ===== */
/* Game Categories Styling */
.game-categories {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    margin-bottom: 100px;
    position: relative;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    padding: 15px 0;
    background-image: linear-gradient(to bottom, #1a1a3a, #000000);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.game-categories::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 215, 0, 0.5), transparent);
}

.categories-column {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 15px;
    overflow-x: scroll;
    padding: 15px 20px;
    width: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    position: relative;
    z-index: 1;
}

.categories-column::-webkit-scrollbar {
    display: none;
}

#allType {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 20px;
    width: 100%;
    padding-left: 10px;
}

.category-item {
    width: 420px;
    height: 460px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: all 0.3s ease;
    padding: 15px;
    color: white;
    margin-left: 0;
    background: linear-gradient(145deg, #1e1e3a, #0a0a1a);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3), 
                inset 0 1px 1px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.category-item::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.category-item:hover::after {
    opacity: 1;
}

.category-item:first-child {
    margin-left: 5px;
}

.category-item img {
    max-width: 90%;
    max-height: 80%;
    margin-bottom: 10px;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.category-item span {
    font-size: 20px;
    font-weight: 500;
    margin-top: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    background: linear-gradient(to right, #ffffff, #ffc107);
    /* -webkit-background-clip: text; */
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    z-index: 2;
}

.category-item:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4), 
                0 0 15px rgba(255, 193, 7, 0.2);
    border-color: rgba(255, 193, 7, 0.3);
}

.category-item:hover img {
    transform: translateY(-5px);
    filter: drop-shadow(0 8px 15px rgba(0, 0, 0, 0.6)) brightness(1.1);
}

/* Progress bar styling for game cards */
.progress {
    width: 90%;
    margin: 5px auto 10px;
    border-radius: 10px;
    background-color: rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(to right, #ffc107, #ff9800);
    transition: width 0.5s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    font-weight: bold;
}

/* ===== FOOTER STYLES ===== */
.footer-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to right, #0a0a4a, #1a1a8a, #0a0a4a);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    padding: 5px 0;
}

.footer-nav ul {
    display: flex;
    justify-content: space-around;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-nav li {
    text-align: center;
}

.footer-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    text-decoration: none;
    padding: 3px;
    transition: all 0.3s ease;
}

.footer-nav a:hover {
    color: #ffc107;
    transform: translateY(-3px);
}

.footer-nav i {
    font-size: 20px;
    margin-bottom: 3px;
}

.footer-nav span {
    font-size: 10px;
}

/* ===== GAME CATEGORY GRID STYLES ===== */
.game-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    padding: 30px 15px;
    width: 100%;
    height: 100%;
    max-width: 1200px;
    margin: 140px auto 0;
    background-color: rgba(20, 10, 50, 0.7);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.game-grid-item {
    width: 240px;
    height: 270px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 25px;
    transition: all 0.3s ease;
    padding: 15px;
    color: white;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.game-grid-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.3), transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.game-grid-item img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    margin-bottom: 15px;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.7));
    transition: transform 0.3s ease, filter 0.3s ease;
    position: relative;
    z-index: 2;
}

.game-grid-item span {
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    color: #ffffff;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.game-grid-item:hover {
    transform: translateY(-7px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.3);
}

.game-grid-item:hover img {
    transform: scale(1.15);
    filter: drop-shadow(0 8px 20px rgba(255, 255, 255, 0.3)) brightness(1.2);
}

.game-grid-item:hover span {
    color: #ffd700;
    transform: scale(1.1);
}

/* Game category flag icons */
.game-flag {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
    z-index: 3;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.game-flag img {
    width: 25px;
    height: 25px;
    object-fit: contain;
    margin: 0;
}

/* Different color variations for game categories */
.game-grid-item.green {
    background: linear-gradient(135deg, #00c853, #009624);
    box-shadow: 0 10px 20px rgba(0, 200, 83, 0.3), inset 0 2px 5px rgba(255, 255, 255, 0.2);
}

.game-grid-item.pink {
    background: linear-gradient(135deg, #ff4081, #c60055);
    box-shadow: 0 10px 20px rgba(255, 64, 129, 0.3), inset 0 2px 5px rgba(255, 255, 255, 0.2);
}

.game-grid-item.purple {
    background: linear-gradient(135deg, #aa00ff, #7200ca);
    box-shadow: 0 10px 20px rgba(170, 0, 255, 0.3), inset 0 2px 5px rgba(255, 255, 255, 0.2);
}

.game-grid-item.blue {
    background: linear-gradient(135deg, #2979ff, #004ecb);
    box-shadow: 0 10px 20px rgba(41, 121, 255, 0.3), inset 0 2px 5px rgba(255, 255, 255, 0.2);
}

.game-grid-item.orange {
    background: linear-gradient(135deg, #ff9100, #c56200);
    box-shadow: 0 10px 20px rgba(255, 145, 0, 0.3), inset 0 2px 5px rgba(255, 255, 255, 0.2);
}

.game-grid-item.red {
    background: linear-gradient(135deg, #ff1744, #c4001d);
    box-shadow: 0 10px 20px rgba(255, 23, 68, 0.3), inset 0 2px 5px rgba(255, 255, 255, 0.2);
}

.game-grid-item.yellow {
    background: linear-gradient(135deg, #ffea00, #c7b800);
    box-shadow: 0 10px 20px rgba(255, 234, 0, 0.3), inset 0 2px 5px rgba(255, 255, 255, 0.2);
}

.game-grid-item.teal {
    background: linear-gradient(135deg, #1de9b6, #00b686);
    box-shadow: 0 10px 20px rgba(29, 233, 182, 0.3), inset 0 2px 5px rgba(255, 255, 255, 0.2);
}

.game-grid-item.cyan {
    background: linear-gradient(135deg, #00e5ff, #00b2cc);
    box-shadow: 0 10px 20px rgba(0, 229, 255, 0.3), inset 0 2px 5px rgba(255, 255, 255, 0.2);
}

.game-grid-item.amber {
    background: linear-gradient(135deg, #ffab00, #c67c00);
    box-shadow: 0 10px 20px rgba(255, 171, 0, 0.3), inset 0 2px 5px rgba(255, 255, 255, 0.2);
}

.game-grid-item.lime {
    background: linear-gradient(135deg, #c6ff00, #92cc00);
    box-shadow: 0 10px 20px rgba(198, 255, 0, 0.3), inset 0 2px 5px rgba(255, 255, 255, 0.2);
}

.game-grid-item.indigo {
    background: linear-gradient(135deg, #3d5afe, #0031ca);
    box-shadow: 0 10px 20px rgba(61, 90, 254, 0.3), inset 0 2px 5px rgba(255, 255, 255, 0.2);
}

.game-grid-item.deep-purple {
    background: linear-gradient(135deg, #651fff, #4615b2);
    box-shadow: 0 10px 20px rgba(101, 31, 255, 0.3), inset 0 2px 5px rgba(255, 255, 255, 0.2);
}

.game-grid-item.deep-orange {
    background: linear-gradient(135deg, #ff6d00, #c43c00);
    box-shadow: 0 10px 20px rgba(255, 109, 0, 0.3), inset 0 2px 5px rgba(255, 255, 255, 0.2);
}

/* เพิ่มเอฟเฟกต์เรืองแสงเมื่อโฮเวอร์ */
.game-grid-item:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.8), transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
    pointer-events: none;
}

.game-grid-item:hover:after {
    opacity: 0.15;
}

/* ===== SLOT PAGE STYLES ===== */
.slot-container {
    width: 100%;
    padding: 110px 0 0;
}

/* Header Styles */
.slot-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 0 15px 10px;
    background-color: rgba(0, 0, 0, 0.8);
}

.back-button {
    flex: 0 0 auto;
    margin-right: 15px;
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(145deg, #1e1e3a, #0a0a1a);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.back-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.back-button:hover {
    transform: translateX(-5px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.6), 0 0 10px rgba(255, 193, 7, 0.3);
    border-color: rgba(255, 193, 7, 0.3);
}

.back-button:hover::before {
    opacity: 1;
}

.back-button i {
    font-size: 22px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
}

.back-button:hover i {
    color: #ffc107;
    transform: scale(1.1);
    text-shadow: 0 0 8px rgba(255, 193, 7, 0.6);
}

.page-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title span {
    font-size: 30px;
    font-weight: bold;
    color: #ffffff;
}

.empty-space {
    display: none;
}

/* Search Bar Styles */
.search-bar {
    padding: 20px 15px;
    background-color: rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease;
}

.search-bar.primary-search {
    animation: fadeIn 0.5s ease;
}

.search-bar.secondary-search {
    position: relative;
}

.search-bar.hidden {
    display: none;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background-color: #2a2a2a;
    border-radius: 25px;
    padding: 0 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.search-icon {
    display: flex;
    align-items: center;
    color: #aaaaaa;
    padding-right: 10px;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #ffffff;
    padding: 12px 0;
    font-size: 16px;
    outline: none;
    width: 100%;
}

.search-input::placeholder {
    color: #888888;
}

.search-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-header .search-input-wrapper {
    flex: 1;
}

.search-header .back-button {
    flex: 0 0 auto;
}

/* Fixed positioning for scrolled search bars */
.search-bar.fixed-top-center {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1030;
    width: 100%;
    max-width: 686px;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.9);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.search-bar.m100 {
    margin-top: 60px;
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== MEDIA QUERIES ===== */
@media screen and (min-width: 1200px) {
    .footer-nav ul {
        justify-content: space-around;
        padding: 0 100px;
    }
    
    .footer-nav i {
        font-size: 32px;
    }
    
    .footer-nav span {
        font-size: 16px;
    }
}

@media screen and (max-width: 768px) {
    /* Game Grid */
    .game-grid {
        gap: 15px;
        padding: 20px 10px;
    }
    
    .game-grid-item {
        width: 140px;
        height: 170px;
    }
    
    .game-grid-item img {
        width: 70px;
        height: 70px;
    }
    
    .game-grid-item span {
        font-size: 18px;
    }
    
    /* Category Item */
    .category-item {
        width: 100%;
        max-width: 320px;
        height: 340px;
        margin: 5px auto;
        padding: 15px;
        box-sizing: border-box;
    }
    
    .category-item span {
        font-size: 18px;
        margin-top: 5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100px;
    }
    
    .category-item img {
        max-width: 95%;
        max-height: 70%;
    }

    #allType {
        gap: 15px;
        padding: 0;
        justify-content: center;
        display: flex;
        flex-wrap: nowrap;
    }
    
    /* Footer */
    .footer-nav i {
        font-size: 28px;
    }
    
    .footer-nav span {
        font-size: 14px;
    }

    /* Page Title */
    .page-title span {
        font-size: 18px;
    }
    
    /* Search */
    .search-input {
        font-size: 14px;
    }
}

@media screen and (max-width: 426px) {
    /* Slot Container */
    .slot-container {
        width: 100%;
        padding: 180px 0 0;
    }
    /* Game Grid */
    .game-grid {
        gap: 20px;
        padding: 80px 5px;
    }
    
    .game-grid-item {
        width: 120px;
        height: 150px;
        padding: 10px;
    }
    
    .game-grid-item img {
        width: 60px;
        height: 60px;
        margin-bottom: 10px;
    }
    
    .game-grid-item span {
        font-size: 16px;
    }
    
    .game-flag {
        width: 30px;
        height: 30px;
        top: 5px;
        left: 5px;
    }
    
    .game-flag img {
        width: 20px;
        height: 20px;
    }
    
    /* Category Item */
    .category-item {
        width: 100%;
        max-width: 360px;
        height: 380px;
        margin: 5px auto;
        padding: 15px;
        box-sizing: border-box;
    }
    
    .category-item span {
        font-size: 18px;
        margin-top: 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 300px;
        padding: 0 15px;
    }
    
    .category-item img {
        max-width: 95%;
        max-height: 80%;
        margin-bottom: 15px;
    }
    
    .progress {
        width: 95%;
        margin: 5px auto 10px;
        height: 18px !important;
    }
    
    .progress-bar {
        font-size: 14px;
    }
    
    #allType {
        gap: 15px;
        padding: 0;
        justify-content: center;
        display: flex;
        flex-wrap: nowrap;
    }
    
    .categories-column {
        padding: 10px 5px;
        gap: 10px;
        justify-content: center;
    }
    
    .game-categories {
        padding: 15px 0;
        width: 100%;
    }
    
    .main-container {
        padding: 0 5px;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background: linear-gradient(135deg, #1a1c1f 0%, #29323c 100%);
    margin: 10% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
    background: linear-gradient(135deg, #24272b 0%, #2d353f 100%);
    color: #fff;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h2 i {
    color: #00ff88;
}

.close {
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close:hover {
    color: #00ff88;
    transform: scale(1.1);
}

.modal-body {
    padding: 20px;
    color: #fff;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: #fff;
    font-weight: 500;
    font-size: 1.1rem;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 1.1rem;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.form-group input:focus {
    border-color: #00ff88;
    outline: none;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.modal-footer {
    padding: 20px;
    text-align: right;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.modal .btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.modal .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.modal .btn-primary {
    background: linear-gradient(135deg, #00ff88 0%, #00b8ff 100%);
    color: #000;
}

.modal .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal .btn-primary:hover {
    background: linear-gradient(135deg, #00ff88 0%, #00b8ff 70%);
}