/* Mobile-Specific Optimizations */

/* Base Mobile Styles */
@media (max-width: 768px) {
    .mobile-device {
        -webkit-tap-highlight-color: rgba(0,0,0,0);
        -webkit-touch-callout: none;
        -webkit-text-size-adjust: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }

    /* Mobile Navigation */
    .navbar {
        padding: 0.5rem 0;
        transition: transform 0.3s ease;
    }

    .navbar.navbar-hidden {
        transform: translateY(-100%);
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .logo {
        width: 35px;
        height: 35px;
    }

    .nav-link {
        padding: 0.75rem 1rem;
        font-size: 1.1rem;
    }

    /* Mobile Hero */
    .hero-section {
        min-height: 100vh;
        padding: 0 1rem;
    }

    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
        line-height: 1.4;
    }

    /* Mobile Market Data */
    .market-data-container {
        margin: 1.5rem 0;
    }

    .market-card {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 12px;
    }

    .market-label {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }

    .market-value {
        font-size: 1.2rem;
    }

    /* Mobile Buttons */
    .cta-buttons {
        flex-direction: column;
        gap: 1rem;
        margin-top: 1.5rem;
    }

    .btn {
        width: 100%;
        padding: 15px 20px;
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .btn-lg {
        padding: 18px 25px;
        font-size: 1.1rem;
    }

    /* Mobile Sections */
    .about-section,
    .tokenomics-section,
    .community-section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .section-text {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 1rem;
    }

    /* Mobile Cards */
    .tokenomics-card,
    .community-card {
        margin-bottom: 1.5rem;
        padding: 1.5rem;
        border-radius: 15px;
    }

    .tokenomics-icon,
    .community-icon {
        font-size: 2.5rem;
        margin-bottom: 0.8rem;
    }

    .tokenomics-card h4,
    .community-card h4 {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
    }

    .tokenomics-value {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .tokenomics-desc {
        font-size: 0.85rem;
    }

    /* Mobile Features */
    .features-list {
        margin-top: 1.5rem;
    }

    .feature-item {
        margin-bottom: 0.8rem;
        font-size: 1rem;
    }

    .feature-item i {
        font-size: 1.2rem;
        margin-right: 0.8rem;
    }

    /* Mobile Footer */
    .footer-section {
        padding: 2rem 0;
        text-align: center;
    }

    .footer-brand {
        flex-direction: column;
        align-items: center;
        margin-bottom: 1rem;
    }

    .footer-logo {
        margin-bottom: 0.5rem;
    }

    .footer-links {
        text-align: center;
    }

    .footer-links a {
        display: block;
        margin: 0.5rem 0;
    }
}

/* Touch-Specific Styles */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .market-card:hover,
    .tokenomics-card:hover,
    .community-card:hover {
        transform: none;
        box-shadow: var(--shadow-light);
    }

    .btn:hover {
        transform: none;
    }

    .nav-link:hover {
        transform: none;
    }

    /* Add touch-friendly active states */
    .market-card:active,
    .tokenomics-card:active,
    .community-card:active {
        transform: scale(0.98);
        opacity: 0.8;
    }

    .btn:active {
        transform: scale(0.95);
    }

    .nav-link:active {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 5px;
    }
}

/* Small Mobile Devices (320px - 480px) */
@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .market-card {
        padding: 0.8rem;
    }

    .market-value {
        font-size: 1.1rem;
    }

    .market-label {
        font-size: 0.75rem;
    }

    .btn {
        padding: 12px 16px;
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .tokenomics-card,
    .community-card {
        padding: 1.2rem;
    }

    .tokenomics-icon,
    .community-icon {
        font-size: 2rem;
    }

    .tokenomics-value {
        font-size: 1.3rem;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        min-height: 100vh;
        padding: 1rem;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .market-data-container {
        margin: 1rem 0;
    }

    .cta-buttons {
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
    }

    .btn {
        width: auto;
        min-width: 150px;
    }
}

/* Pull to Refresh Indicator */
.refresh-indicator {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 9999;
    display: none;
    backdrop-filter: blur(10px);
}

.refresh-feedback {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(76, 205, 196, 0.9);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 9999;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Mobile Loading States */
.mobile-device .loading {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.mobile-device .spinner {
    width: 30px;
    height: 30px;
    border-width: 3px;
}

/* Mobile Data Disclaimer */
.data-disclaimer {
    text-align: center;
    margin-top: 1rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    font-size: 0.8rem;
}

/* Mobile Performance Optimizations */
.low-fps-mode {
    /* Disable expensive animations on low-end devices */
    --animation-duration: 0.1s;
}

.low-fps-mode .animate-in,
.low-fps-mode .slide-left,
.low-fps-mode .slide-right {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}

.low-fps-mode .float,
.low-fps-mode .pulse {
    animation: none !important;
}

.low-fps-mode .particle {
    display: none !important;
}

/* High contrast mode for accessibility */
@media (prefers-contrast: high) {
    .market-card,
    .tokenomics-card,
    .community-card {
        border: 2px solid #fff;
    }

    .btn-outline-light {
        border-width: 3px;
    }

    .text-gradient {
        background: #fff;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .three-bg {
        display: none;
    }

    .particle {
        display: none;
    }
}

/* Safe area handling for notched devices */
@supports (padding: max(0px)) {
    .navbar {
        padding-top: max(1rem, env(safe-area-inset-top));
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .hero-section {
        padding-top: max(2rem, env(safe-area-inset-top));
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .footer-section {
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}

/* Mobile keyboard handling */
@media (max-width: 768px) {
    .mobile-device.keyboard-open .hero-section {
        min-height: 50vh;
    }

    .mobile-device.keyboard-open .footer-section {
        display: none;
    }
}

/* Touch gesture helpers */
.swipe-hint {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    z-index: 1000;
    animation: fadeInOut 3s ease-in-out;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    20%, 80% { opacity: 1; }
}

/* Mobile menu animations */
@media (max-width: 768px) {
    .navbar-collapse {
        background: rgba(0, 0, 0, 0.95);
        border-radius: 10px;
        margin-top: 10px;
        padding: 1rem;
        backdrop-filter: blur(10px);
    }

    .navbar-collapse.collapsing,
    .navbar-collapse.show {
        animation: slideDown 0.3s ease;
    }
}

/* Viewport units fix for mobile browsers */
.mobile-device .hero-section {
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
}

/* JavaScript to set correct viewport height */
/* Add this to your JavaScript:
let vh = window.innerHeight * 0.01;
document.documentElement.style.setProperty('--vh', `${vh}px`);

window.addEventListener('resize', () => {
    let vh = window.innerHeight * 0.01;
    document.documentElement.style.setProperty('--vh', `${vh}px`);
});
*/