/* ========== Additional Enhancements for MTY Website ========== */

/* Smooth Page Load Animation */
body {
    animation: fadeInBody 0.6s ease-in;
}

@keyframes fadeInBody {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Enhanced Carousel Indicators */
.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 5px;
    background-color: rgba(255, 255, 255, 0.5);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.carousel-indicators button.active {
    background-color: #c20000;
    border-color: #ffffff;
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(194, 0, 0, 0.5);
}

.carousel-indicators button:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.1);
}

/* Enhanced Form Controls */
.form-control-custom {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(194, 0, 0, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.form-control-custom:focus {
    background: #ffffff;
    border-color: #c20000;
    box-shadow: 0 0 0 0.2rem rgba(194, 0, 0, 0.25), inset 0 2px 5px rgba(194, 0, 0, 0.1);
    outline: none;
}

.form-control-custom::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

/* Partner Logo Grid Enhancements */
.partner-list {
    animation: fadeInUp 1s ease;
}

.partner-list li {
    display: inline-block;
    margin: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.partner-list li img {
    max-width: 100px;
    height: auto;
    display: block;
}

/* Reward Images Enhancement */
.footer-custom img {
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.footer-custom img:hover {
    transform: translateY(-5px) scale(1.05);
    filter: drop-shadow(0 5px 15px rgba(194, 0, 0, 0.4));
}

/* Match Card Enhancements */
.match-root-bg {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.match-root-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(194, 0, 0, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.match-root-bg:hover::before {
    opacity: 1;
}

.match-root-bg:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* Live Badge Animation */
@keyframes pulse-red {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 4, 2, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(255, 4, 2, 0);
    }
}

.match-root-bg [style*="background-color: #FF0402"] {
    animation: pulse-red 2s infinite;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #1b0007 0%, #0a0003 100%);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #c20000 0%, #8a0000 100%);
    border-radius: 6px;
    border: 2px solid rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ff0000 0%, #c20000 100%);
}

/* Loading Spinner for Images - Faster animation */
img[loading="lazy"] {
    background: linear-gradient(90deg, rgba(194, 0, 0, 0.05) 0%, rgba(194, 0, 0, 0.15) 50%, rgba(194, 0, 0, 0.05) 100%);
    background-size: 200% 100%;
    animation: shimmer 1s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Z-index Fix for Navigation Elements */
.navbar.fixed-top {
    z-index: 1030 !important;
}

.bg-custom {
    z-index: 1030 !important;
}

/* Tab Bar Mobile - Higher than navbar */
.tab-bar-mobile {
    z-index: 9998 !important;
    overflow: visible !important;
    pointer-events: auto !important;
}

.tab-bar-mobile .tab-control {
    overflow: visible !important;
    pointer-events: auto !important;
}

.tab-bar-mobile .tab-list {
    overflow: visible !important;
    pointer-events: auto !important;
    cursor: pointer;
}

.tab-bar-mobile .tab-list a,
.tab-bar-mobile .tab-list > div {
    pointer-events: auto !important;
    cursor: pointer;
    position: relative;
    z-index: 10;
}

.tab-bar-mobile .btn-group {
    position: relative;
    z-index: 10;
    overflow: visible !important;
    pointer-events: auto !important;
}

.tab-bar-mobile .dropup {
    position: relative;
    z-index: 10;
    overflow: visible !important;
    pointer-events: auto !important;
}

.tab-bar-mobile [data-bs-toggle] {
    cursor: pointer;
    pointer-events: auto !important;
}

/* Dropdown Menu Fix - Always on top */
.dropdown-menu {
    z-index: 9999 !important;
    position: absolute !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5) !important;
}

.dropdown-menu-profile {
    z-index: 9999 !important;
    position: absolute !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5) !important;
}

.dropup .dropdown-menu {
    z-index: 9999 !important;
    position: absolute !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5) !important;
}

.tab-bar-mobile .dropdown-menu {
    z-index: 9999 !important;
    position: absolute !important;
    bottom: 100% !important;
    margin-bottom: 0.5rem !important;
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.5) !important;
}

.tab-bar-mobile .dropup .dropdown-menu {
    bottom: 100% !important;
    top: auto !important;
}

.tab-bar-mobile .dropdown-menu.show {
    opacity: 1 !important;
    visibility: visible !important;
    animation: dropdownSlideUp 0.3s ease;
}

@keyframes dropdownSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ensure dropdown items are clickable */
.dropdown-item-profile {
    position: relative;
    z-index: 10;
    transition: all 0.3s ease;
    pointer-events: auto !important;
    cursor: pointer !important;
}

.dropdown-item-profile:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    transform: translateX(5px);
}

/* Remove any pseudo elements that might block clicks */
.tab-bar-mobile *::before,
.tab-bar-mobile *::after {
    pointer-events: none !important;
}

/* Ensure images don't block clicks */
.tab-bar-mobile img {
    pointer-events: none !important;
    user-select: none;
}

/* Make sure all overlays don't block mobile tab bar */
.main-content-owl::before,
.content-partner::before,
.footer-custom::before,
*::before,
*::after {
    pointer-events: none !important;
}

/* But allow normal clickable elements */
a, button, input, select, textarea,
[onclick], [data-bs-toggle], .clickable {
    pointer-events: auto !important;
}

/* Fix touch scrolling on mobile for carousels */
/* .owl-carousel {
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch;
}

.owl-stage-outer {
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch;
}

.owl-stage {
    touch-action: pan-x pan-y !important;
}

.owl-item {
    touch-action: pan-x pan-y !important;
}

/* Prevent body scroll when touching carousel on mobile */
@media (max-width: 767px) {
    .owl-carousel {
        touch-action: pan-x !important;
    }
    
    .owl-stage-outer {
        touch-action: pan-x !important;
    }
    
    /* Disable parallax on mobile */
    .main-content-owl {
        background-attachment: scroll !important;
    }
} */

/* Enhanced Modal Transitions */
.modal.show {
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Floating Animation for Special Elements */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.btn-main:not(:hover) {
    animation: float 3s ease-in-out infinite;
}

/* Grid Layout Animation - Faster version */
.grid-gameall-container > * {
    animation: fadeInUp 0.3s ease forwards;
    opacity: 0;
}

.grid-gameall-container > *:nth-child(1) { animation-delay: 0.02s; }
.grid-gameall-container > *:nth-child(2) { animation-delay: 0.04s; }
.grid-gameall-container > *:nth-child(3) { animation-delay: 0.06s; }
.grid-gameall-container > *:nth-child(4) { animation-delay: 0.08s; }
.grid-gameall-container > *:nth-child(5) { animation-delay: 0.09s; }
.grid-gameall-container > *:nth-child(6) { animation-delay: 0.09s; }
.grid-gameall-container > *:nth-child(7) { animation-delay: 0.10s; }
.grid-gameall-container > *:nth-child(8) { animation-delay: 0.11s; }
.grid-gameall-container > *:nth-child(9) { animation-delay: 0.12s; }
.grid-gameall-container > *:nth-child(10) { animation-delay: 0.2s; }
.grid-gameall-container > *:nth-child(n+11) { animation-delay: 0.2s; }
html, body {
    background-color: #1f0202;
}
/* Responsive Enhancements */
@media (max-width: 991px) {
    .grid-gameall-container {
        grid-template-columns: repeat(3, 1fr);
        grid-gap: 15px;
    }
    
    .tab-game-container {
        grid-gap: 10px;
    }
    
    .partner-list li img {
        max-width: 80px;
    }
}

@media (max-width: 767px) {
    .grid-gameall-container {
        grid-template-columns: repeat(2, 1fr);
        grid-gap: 10px;
    }
    
    .title-header h2 {
        font-size: 1.5rem;
    }
    
    .title-header div {
        font-size: 0.85rem;
    }
    
    .partner-list li {
        margin: 5px;
        padding: 5px;
    }
    
    .partner-list li img {
        max-width: 60px;
    }
    
    .btn-main {
        font-size: 12px;
        padding: 8px 20px;
    }
}

/* Glass Morphism Effect for Cards */
.hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: 15px;
}

.hover:hover::after {
    opacity: 1;
}

/* Text Selection Styling */
::selection {
    background-color: #c20000;
    color: #ffffff;
}

::-moz-selection {
    background-color: #c20000;
    color: #ffffff;
}

/* Enhanced Focus States for Accessibility */
a:focus, button:focus, input:focus {
    outline: 2px solid #c20000;
    outline-offset: 2px;
}

/* Smooth Transitions for All Interactive Elements */
a, button, input, select, textarea, .tab-list, .item, .hover {
    -webkit-tap-highlight-color: transparent;
}

/* Performance Optimization */
.hover img, .carousel-item img {
    will-change: transform;
}

/* Dark Overlay for Modals */
.modal-backdrop {
    animation: fadeIn 0.3s ease;
}

/* Enhanced Typography */
.title-header h2 {
    position: relative;
    display: inline-block;
}

.title-header h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #c20000 0%, transparent 100%);
    transition: width 0.6s ease;
}

.game-list:hover .title-header h2::after {
    width: 100%;
}

/* Preloader Enhancement (if needed) */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1b0007 0%, #0a0003 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(194, 0, 0, 0.3);
    border-top-color: #c20000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Back to Top Button (Optional Enhancement) */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #c20000 0%, #8a0000 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(194, 0, 0, 0.4);
    z-index: 9997;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: linear-gradient(135deg, #ff0000 0%, #c20000 100%);
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(194, 0, 0, 0.6);
}

/* Adjust position on mobile to avoid footer bar */
@media (max-width: 991px) {
    .back-to-top {
        bottom: 90px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

@media (max-width: 767px) {
    .back-to-top {
        bottom: 80px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

