/**
 * Mobile-First Responsive Styles - Professional Design
 * Only applies to screens max-width: 768px
 * Desktop styles are in desktop.css to ensure no conflicts
 */

/* ============================================
   MOBILE BASE STYLES (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    
    /* ========== BODY & HTML ========== */
    html {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        overflow-x: hidden;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    
    body {
        font-size: 15px;
        line-height: 1.7;
        overflow-x: hidden;
        max-width: 100vw;
        padding-bottom: 0;
        background: #f5f5f5;
    }
    
    body.menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
    
    /* ========== CONTAINER ========== */
    .container {
        padding: 0 12px;
        max-width: 100%;
    }
    
    /* ========== HEADER - MOBILE ========== */
    .site-header {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: #fff;
        box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    }
    
    .header-top {
        padding: 12px 0;
        position: relative;
        padding-right: 60px;
        border-bottom: 1px solid #e8e8e8;
    }
    
    .header-top-right {
        display: none;
    }
    
    .site-logo .logo-image {
        height: 48px !important;
        max-width: 200px !important;
    }
    
    .header-banner {
        display: none;
    }
    
    /* ========== MOBILE MENU TOGGLE BUTTON - PREMIUM ========== */
    .mobile-menu-toggle {
        display: flex !important;
        position: fixed;
        top: 14px;
        right: 14px;
        z-index: 1002;
        width: 50px;
        height: 50px;
        background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
        border: none;
        border-radius: 12px;
        padding: 0;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3),
                    0 2px 4px rgba(0, 0, 0, 0.1),
                    inset 0 1px 0 rgba(255, 255, 255, 0.2);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        align-items: center;
        justify-content: center;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        user-select: none;
    }
    
    .mobile-menu-toggle:active {
        transform: scale(0.94);
        box-shadow: 0 2px 8px rgba(46, 125, 50, 0.35);
    }
    
    .mobile-menu-toggle.active {
        background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
        box-shadow: 0 4px 16px rgba(211, 47, 47, 0.4),
                    0 2px 4px rgba(0, 0, 0, 0.1);
        transform: rotate(90deg);
    }
    
    .hamburger-icon {
        width: 26px;
        height: 22px;
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .hamburger-icon span {
        display: block;
        height: 3px;
        width: 100%;
        background: #fff;
        border-radius: 2px;
        transition: all 0.35s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        transform-origin: center;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-menu-toggle.active .hamburger-icon span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }
    
    .mobile-menu-toggle.active .hamburger-icon span:nth-child(2) {
        opacity: 0;
        transform: scale(0);
        width: 0;
    }
    
    .mobile-menu-toggle.active .hamburger-icon span:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px);
    }
    
    /* ========== MOBILE NAVIGATION MENU - PREMIUM ========== */
    .main-navigation {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 340px;
        height: 100vh;
        background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
        z-index: 1001;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        overflow-x: hidden;
        box-shadow: -8px 0 32px rgba(0,0,0,0.2),
                    inset 1px 0 0 rgba(255,255,255,0.1);
        -webkit-overflow-scrolling: touch;
    }
    
    .main-navigation.active {
        right: 0;
    }
    
    .main-navigation .container {
        padding: 0;
    }
    
    /* Mobile Menu Header */
    .main-navigation::before {
        content: '';
        position: sticky;
        top: 0;
        left: 0;
        right: 0;
        height: 70px;
        background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
        z-index: 10;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .nav-menu {
        flex-direction: column;
        padding: 0;
        margin: 0;
        gap: 0;
        list-style: none;
        padding-top: 70px;
    }
    
    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        position: relative;
        overflow: hidden;
    }
    
    .nav-menu li:first-child {
        border-top: none;
    }
    
    .nav-menu a {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 20px 24px;
        font-size: 16px;
        font-weight: 600;
        color: #2c3e50;
        text-decoration: none;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        min-height: 64px;
        position: relative;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .nav-menu a .menu-icon {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-menu a .menu-icon svg {
        width: 100%;
        height: 100%;
        fill: none;
        stroke: currentColor;
        stroke-width: 2.5;
        stroke-linecap: round;
        stroke-linejoin: round;
        opacity: 0.9;
    }
    
    .nav-menu a .menu-text {
        flex: 1;
    }
    
    /* Left accent bar */
    .nav-menu a::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 5px;
        background: linear-gradient(180deg, #2e7d32 0%, #1b5e20 100%);
        transform: scaleY(0);
        transform-origin: top;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 2px 0 8px rgba(46, 125, 50, 0.3);
    }
    
    /* Background hover effect */
    .nav-menu a::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(90deg, 
            rgba(46, 125, 50, 0.08) 0%, 
            rgba(46, 125, 50, 0.04) 100%);
        opacity: 0;
        transition: opacity 0.25s ease;
        z-index: -1;
    }
    
    .nav-menu a:active {
        background: rgba(46, 125, 50, 0.1);
        transform: translateX(4px);
    }
    
    .nav-menu .current-menu-item > a,
    .nav-menu li:active > a {
        background: rgba(46, 125, 50, 0.08);
        color: #1b5e20;
        font-weight: 700;
    }
    
    .nav-menu .current-menu-item > a::before,
    .nav-menu li:active > a::before {
        transform: scaleY(1);
    }
    
    .nav-menu .current-menu-item > a::after,
    .nav-menu li:active > a::after {
        opacity: 1;
    }
    
    /* Touch-friendly hover for mobile */
    @media (hover: hover) {
        .nav-menu li:hover > a {
            background: rgba(46, 125, 50, 0.08);
            color: #1b5e20;
        }
        
        .nav-menu li:hover > a::before {
            transform: scaleY(1);
        }
        
        .nav-menu li:hover > a::after {
            opacity: 1;
        }
    }
    
    .nav-menu a .live-play-icon {
        width: 16px;
        height: 16px;
        fill: currentColor;
        opacity: 0.95;
        flex-shrink: 0;
        margin-right: 8px;
    }
    
    .nav-menu a .live-icon-wrapper {
        width: auto;
        height: auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        margin-left: 5px;
        margin-right: 10px;
        position: relative;
    }
    
    .nav-menu a .live-icon-wrapper .live-icon {
        width: 10px;
        height: 10px;
        background: #ff4444;
        border-radius: 50%;
        animation: livePulse 0.8s ease-in-out infinite;
        box-shadow: 0 0 8px rgba(255, 68, 68, 0.7);
        flex-shrink: 0;
        display: inline-block;
    }
    
    .menu-item-live .live-icon {
        margin-right: 0;
        width: 10px;
        height: 10px;
        flex-shrink: 0;
    }
    
    /* ========== MOBILE MENU OVERLAY - PREMIUM ========== */
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        z-index: 1000;
        opacity: 0;
        transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }
    
    .mobile-menu-overlay.active {
        display: block;
        opacity: 1;
    }
    
    /* ========== CONTENT LAYOUT ========== */
    .site-content {
        padding: 15px 0 20px;
        min-height: calc(100vh - 200px);
    }
    
    .content-wrapper {
        flex-direction: column;
        gap: 15px;
    }
    
    .main-content-area {
        width: 100%;
        order: 1;
        background: #fff;
        padding: 16px 14px;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }
    
    .sidebar {
        width: 100%;
        order: 2;
        background: #f8f9fa;
        padding: 16px 14px;
        border-radius: 12px;
        display: none;
    }
    
    .sidebar:not(.collapsed) {
        display: block !important;
    }
    
    .sidebar.collapsed {
        display: none !important;
    }
    
    /* ========== SIDEBAR TOGGLE BUTTON ========== */
    .sidebar-toggle-mobile {
        display: block;
        width: 100%;
        padding: 16px 18px;
        background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
        color: #fff;
        border: none;
        border-radius: 10px;
        font-weight: 600;
        font-size: 15px;
        margin-bottom: 16px;
        cursor: pointer;
        text-align: center;
        box-shadow: 0 3px 10px rgba(46, 125, 50, 0.25);
        transition: all 0.3s ease;
        min-height: 50px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        letter-spacing: 0.3px;
    }
    
    .sidebar-toggle-mobile:active {
        transform: scale(0.97);
        box-shadow: 0 2px 6px rgba(46, 125, 50, 0.3);
    }
    
    /* ========== SIDEBAR WIDGETS ========== */
    .sidebar-widget {
        margin-bottom: 16px;
        background: #fff;
        border-radius: 10px;
        overflow: hidden;
        box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    }
    
    .hot-leagues-title {
        font-size: 15px;
        padding: 16px 18px;
        font-weight: 700;
        background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
        color: #fff;
        margin: 0;
        border-radius: 10px 10px 0 0;
    }
    
    .category-title {
        font-size: 14px;
        padding: 14px 18px;
        font-weight: 600;
        background: #f0f7f1;
        color: #2e7d32;
        margin: 0;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .league-link {
        padding: 14px 18px;
        font-size: 14px;
        min-height: 50px;
        display: flex;
        align-items: center;
        transition: background 0.2s ease;
    }
    
    .league-link:active {
        background: #f5f5f5;
    }
    
    /* ========== FOOTER ========== */
    .site-footer {
        margin-top: 40px;
        background: #1a1a1a;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 35px 18px;
    }
    
    .footer-section {
        margin-bottom: 28px;
    }
    
    .footer-section:last-child {
        margin-bottom: 0;
    }
    
    .footer-logo-img {
        height: 52px !important;
        max-width: 210px !important;
    }
    
    .footer-social {
        justify-content: center;
        margin-top: 18px;
        gap: 14px;
    }
    
    .footer-menu {
        flex-direction: column;
        gap: 10px;
    }
    
    .footer-menu a {
        padding: 12px 0;
        font-size: 14px;
        color: #e0e0e0;
        transition: color 0.2s ease;
    }
    
    .footer-menu a:active {
        color: #2e7d32;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
        gap: 16px;
        padding: 22px 18px;
    }
    
    .footer-legal {
        flex-direction: column;
        gap: 12px;
    }
    
    .footer-legal .separator {
        display: none;
    }
    
    .newsletter-form {
        flex-direction: column;
        gap: 12px;
    }
    
    .newsletter-form input,
    .newsletter-form button {
        width: 100%;
        min-height: 50px;
        font-size: 16px;
        border-radius: 8px;
    }
    
    /* ========== TABLES ========== */
    table {
        width: 100%;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 12px;
    }
    
    /* ========== FORMS ========== */
    input, select, textarea {
        font-size: 16px;
        min-height: 50px;
        padding: 14px 16px;
        border-radius: 8px;
        border: 1px solid #ddd;
    }
    
    /* ========== BUTTONS ========== */
    button, .button, a.button {
        min-height: 50px;
        min-width: 50px;
        padding: 14px 22px;
        font-size: 15px;
        touch-action: manipulation;
        border-radius: 8px;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* ========== PLUGIN CONTAINERS ========== */
    #scrollIframe,
    #rate_iframe,
    .game-rate,
    .match-detail {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* ========== UTILITY CLASSES ========== */
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }
    
    /* ========== RANKING WIDGET ========== */
    .ranking-widget {
        margin-top: 16px;
        border-radius: 10px;
        overflow: hidden;
    }
    
    .ranking-widget .widget-title {
        font-size: 15px;
        padding: 16px 18px;
    }
    
    /* ========== TYPOGRAPHY ========== */
    h1 {
        font-size: 26px;
        line-height: 1.3;
        margin-bottom: 16px;
        font-weight: 700;
    }
    
    h2 {
        font-size: 22px;
        line-height: 1.3;
        margin-bottom: 14px;
        font-weight: 700;
    }
    
    h3 {
        font-size: 19px;
        line-height: 1.3;
        margin-bottom: 12px;
        font-weight: 600;
    }
    
    h4, h5, h6 {
        font-size: 17px;
        line-height: 1.3;
        margin-bottom: 10px;
        font-weight: 600;
    }
    
    p {
        margin-bottom: 14px;
    }
    
    /* ========== PREVENT TEXT SELECTION ON BUTTONS ========== */
    button, .button {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* ========== TOUCH HIGHLIGHT ========== */
    a, button {
        -webkit-tap-highlight-color: rgba(46, 125, 50, 0.15);
    }
    
    /* ========== SMOOTH ANIMATIONS ========== */
    * {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ============================================
   SMALL MOBILE (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .site-logo .logo-image {
        height: 42px !important;
        max-width: 170px !important;
    }
    
    .mobile-menu-toggle {
        width: 42px;
        height: 42px;
        top: 12px;
        right: 12px;
    }
    
    .main-navigation {
        width: 90%;
        max-width: 280px;
    }
    
    .nav-menu {
        padding: 70px 0 20px;
    }
    
    .nav-menu a {
        padding: 16px 20px;
        font-size: 15px;
    }
    
    .main-content-area {
        padding: 14px 12px;
    }
    
    .sidebar {
        padding: 14px 12px;
    }
    
    .sidebar-toggle-mobile {
        padding: 14px 16px;
        font-size: 14px;
    }
    
    .hot-leagues-title {
        font-size: 14px;
        padding: 14px 16px;
    }
    
    .category-title {
        font-size: 13px;
        padding: 12px 16px;
    }
    
    .league-link {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .footer-content {
        padding: 30px 15px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    h3 {
        font-size: 18px;
    }
}
