/**
 * Mobile Fixes & Button Click Improvements
 * Fixes double-click issues and improves mobile responsiveness
 */

/* ===== FIX DOUBLE CLICK ISSUE ===== */
/* Remove hover effects on touch devices */
@media (hover: none) and (pointer: coarse) {
    * {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* Disable hover effects on buttons */
    .btn:hover,
    button:hover,
    a:hover {
        transform: none !important;
    }
}

/* Improve button click responsiveness */
.btn,
button,
a[href],
.clickable {
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(255, 0, 0, 0.2);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

/* Prevent double-click delay on iOS */
button,
.btn,
a {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
}

/* Fast click for all interactive elements */
a, button, input, select, textarea, label {
    touch-action: manipulation;
}

/* ===== MOBILE RESPONSIVE IMPROVEMENTS ===== */

/* About Section - Mobile Optimization */
@media (max-width: 768px) {
    /* About Our IPTV Service Section */
    .about-section {
        padding: 40px 15px !important;
    }
    
    .about-section .section-title {
        font-size: 1.8rem !important;
        margin-bottom: 15px !important;
    }
    
    .about-section .section-subtitle {
        font-size: 0.95rem !important;
        margin-bottom: 30px !important;
    }
    
    /* About Cards Grid - Better Mobile Layout */
    .about-grid,
    .features-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        padding: 0 !important;
    }
    
    /* About Cards - Compact Design */
    .about-card,
    .feature-card {
        padding: 20px 15px !important;
        border-radius: 12px !important;
        min-height: auto !important;
        height: auto !important;
    }
    
    .about-card .card-icon,
    .feature-card .card-icon {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.3rem !important;
        margin-bottom: 12px !important;
    }
    
    .about-card h3,
    .feature-card h3 {
        font-size: 1.1rem !important;
        margin-bottom: 8px !important;
    }
    
    .about-card p,
    .feature-card p {
        font-size: 0.85rem !important;
        line-height: 1.5 !important;
        margin: 0 !important;
    }
    
    /* Why Choose Super IPTV Section */
    .why-choose-section {
        padding: 40px 15px !important;
    }
    
    .why-choose-section .section-title {
        font-size: 1.8rem !important;
        margin-bottom: 15px !important;
    }
    
    /* Why Choose Cards - 2 Column Layout on Mobile */
    .why-choose-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        padding: 0 !important;
    }
    
    .why-card {
        padding: 15px 10px !important;
        border-radius: 10px !important;
        text-align: center !important;
    }
    
    .why-card .icon {
        width: 45px !important;
        height: 45px !important;
        font-size: 1.2rem !important;
        margin: 0 auto 10px !important;
    }
    
    .why-card h4 {
        font-size: 0.9rem !important;
        margin-bottom: 5px !important;
    }
    
    .why-card p {
        font-size: 0.75rem !important;
        line-height: 1.4 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }
}

/* Extra Small Devices (< 480px) */
@media (max-width: 480px) {
    .about-section,
    .why-choose-section {
        padding: 30px 10px !important;
    }
    
    .section-title {
        font-size: 1.5rem !important;
    }
    
    .section-subtitle {
        font-size: 0.85rem !important;
    }
    
    /* Single column for very small screens */
    .why-choose-grid {
        grid-template-columns: 1fr !important;
    }
    
    .why-card {
        padding: 15px !important;
    }
}

/* ===== PRICING SECTION MOBILE ===== */
@media (max-width: 768px) {
    .pricing-section {
        padding: 40px 15px !important;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        max-width: 400px !important;
        margin: 0 auto !important;
    }
    
    .pricing-card {
        padding: 25px 20px !important;
    }
    
    .device-tabs {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        justify-content: center !important;
        margin-bottom: 25px !important;
    }
    
    .device-tab {
        padding: 8px 15px !important;
        font-size: 0.85rem !important;
        flex: 0 0 auto !important;
        min-width: 80px !important;
    }
}

/* ===== HERO SECTION MOBILE ===== */
@media (max-width: 768px) {
    .hero-section {
        min-height: 500px !important;
        padding: 80px 15px 40px !important;
    }
    
    .hero-content h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }
    
    .hero-content p {
        font-size: 1rem !important;
        margin: 15px 0 25px !important;
    }
    
    .hero-buttons {
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
    }
    
    .hero-buttons .btn {
        width: 100% !important;
        max-width: 300px !important;
        margin: 0 auto !important;
    }
}

/* ===== CHANNELS SECTION MOBILE ===== */
@media (max-width: 768px) {
    .channels-section {
        padding: 40px 15px !important;
    }
    
    .channels-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
    
    .channel-card {
        padding: 15px 10px !important;
    }
    
    .channel-card .icon {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.5rem !important;
    }
    
    .channel-card h3 {
        font-size: 0.9rem !important;
    }
    
    .channel-card p {
        font-size: 0.75rem !important;
    }
}

/* ===== FAQ SECTION MOBILE ===== */
@media (max-width: 768px) {
    .faq-section {
        padding: 40px 15px !important;
    }
    
    .faq-item {
        padding: 15px !important;
    }
    
    .faq-question {
        font-size: 0.95rem !important;
        padding-right: 30px !important;
    }
    
    .faq-answer {
        font-size: 0.85rem !important;
        padding-top: 12px !important;
    }
}

/* ===== FOOTER MOBILE ===== */
@media (max-width: 768px) {
    .footer {
        padding: 30px 15px 20px !important;
    }
    
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 25px !important;
        text-align: center !important;
    }
    
    .footer-column h4 {
        font-size: 1rem !important;
        margin-bottom: 12px !important;
    }
    
    .footer-column ul li {
        margin-bottom: 8px !important;
    }
    
    .footer-column ul li a {
        font-size: 0.85rem !important;
    }
}

/* ===== NAVIGATION MOBILE ===== */
@media (max-width: 992px) {
    .navbar {
        padding: 12px 15px !important;
    }
    
    /* Hide Sign In button on mobile header */
    .nav-actions .btn-outline,
    .nav-actions a[href*="login"],
    .nav-actions a[href*="sign-in"],
    .nav-actions a[href*="account"],
    .header-actions .btn-outline,
    .header-actions a[href*="login"],
    .header-actions a[href*="sign-in"],
    .header-actions a[href*="account"] {
        display: none !important;
    }
    
    /* Keep only Get Started button visible */
    .nav-actions .btn-primary,
    .header-actions .btn-primary {
        display: inline-flex !important;
    }
    
    /* Optimize header layout */
    .navbar-container,
    .nav-container {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
    }
    
    /* Logo section */
    .logo-area,
    .navbar-brand {
        flex-shrink: 0 !important;
    }
    
    /* Actions section - compact */
    .nav-actions,
    .header-actions {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        flex-shrink: 0 !important;
    }
    
    /* Menu toggle button */
    .menu-toggle,
    .hamburger,
    .mobile-menu-btn {
        width: 40px !important;
        height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border-radius: 8px !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        cursor: pointer !important;
        flex-shrink: 0 !important;
    }
    
    .nav-menu {
        position: fixed !important;
        top: 60px !important;
        left: 0 !important;
        right: 0 !important;
        background: rgba(10, 10, 10, 0.98) !important;
        backdrop-filter: blur(10px) !important;
        padding: 20px !important;
        max-height: calc(100vh - 60px) !important;
        overflow-y: auto !important;
    }
    
    .nav-menu.active {
        display: block !important;
    }
    
    .nav-links {
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    .nav-link {
        padding: 12px 15px !important;
        width: 100% !important;
        text-align: center !important;
        border-radius: 8px !important;
        background: rgba(255, 255, 255, 0.05) !important;
    }
}

/* Tablet size - show Sign In but smaller */
@media (min-width: 768px) and (max-width: 992px) {
    .nav-actions .btn-outline,
    .header-actions .btn-outline {
        display: inline-flex !important;
        padding: 8px 16px !important;
        font-size: 0.85rem !important;
    }
}

/* Extra small devices - optimize header further */
@media (max-width: 480px) {
    .navbar {
        padding: 10px 12px !important;
    }
    
    /* Make logo smaller on very small screens */
    .logo-text {
        font-size: 1.1rem !important;
    }
    
    .logo-text .plus {
        font-size: 0.9rem !important;
    }
    
    /* Optimize Get Started button */
    .nav-actions .btn-primary,
    .header-actions .btn-primary {
        padding: 8px 16px !important;
        font-size: 0.85rem !important;
        white-space: nowrap !important;
    }
    
    /* Compact language switcher */
    .lang-switcher {
        margin-left: 5px !important;
    }
    
    .lang-btn {
        padding: 6px 10px !important;
        font-size: 0.8rem !important;
    }
    
    /* Menu toggle smaller */
    .menu-toggle,
    .hamburger,
    .mobile-menu-btn {
        width: 36px !important;
        height: 36px !important;
    }
}

/* ===== IMPROVE TOUCH TARGETS ===== */
@media (max-width: 768px) {
    /* Minimum touch target size: 44x44px */
    .btn,
    button,
    a.btn,
    .nav-link,
    .device-tab,
    .faq-question {
        min-height: 44px !important;
        min-width: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Increase spacing between clickable elements */
    .btn + .btn,
    button + button {
        margin-top: 10px !important;
    }
}

/* ===== PREVENT ZOOM ON INPUT FOCUS (iOS) ===== */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
}

/* ===== SMOOTH SCROLLING ===== */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* ===== REMOVE OUTLINE ON TOUCH ===== */
@media (hover: none) {
    *:focus {
        outline: none !important;
    }
}

/* ===== ACTIVE STATE FOR BUTTONS ===== */
.btn:active,
button:active,
a:active {
    transform: scale(0.98) !important;
    opacity: 0.9 !important;
}

/* ===== LOADING STATE ===== */
.btn:disabled,
button:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}
