/* ============================================
   HIVEX Protocol - Mobile Responsive
   ============================================ */

/* Extra small screens */
@media (max-width: 360px) {
    html { font-size: 14px; }
    
    .wallet-balance {
        font-size: 1.6rem;
    }

    .token-pill {
        padding: 4px 8px;
        font-size: 0.65rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .agent-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cat-attrs {
        grid-template-columns: 1fr;
    }
}

/* Small screens (375px - standard iPhone) */
@media (min-width: 361px) and (max-width: 414px) {
    .main-content {
        padding-left: 14px;
        padding-right: 14px;
    }
}

/* Medium screens (tablets in portrait) */
@media (min-width: 481px) and (max-width: 768px) {
    .app-container {
        max-width: 580px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .agent-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .cat-attrs {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .vc-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Large screens (tablets landscape, desktop) */
@media (min-width: 769px) {
    .app-container {
        max-width: 480px;
        margin: 0 auto;
        box-shadow: -1px 0 0 var(--border-glass), 1px 0 0 var(--border-glass);
        min-height: 100vh;
    }
    
    body {
        background: #050810;
    }
    
    /* Desktop side panel hint */
    body::before {
        content: 'HIVEX PROTOCOL';
        position: fixed;
        left: 40px;
        top: 50%;
        transform: translateY(-50%) rotate(-90deg);
        font-family: 'Orbitron', monospace;
        font-size: 1.2rem;
        font-weight: 900;
        letter-spacing: 8px;
        color: rgba(99, 102, 241, 0.08);
    }
}

/* Safe area for notched phones */
@supports (padding: env(safe-area-inset-top)) {
    .top-bar {
        padding-top: env(safe-area-inset-top);
        height: calc(var(--top-bar-height) + env(safe-area-inset-top));
    }
    
    .main-content {
        padding-top: calc(var(--top-bar-height) + env(safe-area-inset-top) + 8px);
    }
    
    .bottom-nav {
        height: calc(var(--nav-height) + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .main-content {
        padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 20px);
    }
}

/* Touch optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn-icon,
    .nav-item,
    .mouse-card,
    .vault-card,
    .cat-status-card {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Larger touch targets */
    .btn-icon {
        min-width: 40px;
        min-height: 40px;
    }
    
    .nav-item {
        min-width: 54px;
        padding: 8px 0;
    }
}

/* Reduce 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;
    }
    
    .splash-screen {
        display: none;
    }
    
    #app {
        display: block !important;
    }
}

/* Dark mode color scheme indicator */
@media (prefers-color-scheme: light) {
    /* Keep dark theme as crypto DApp standard */
}

/* Landscape mode on small devices */
@media (max-height: 500px) and (orientation: landscape) {
    .bottom-nav {
        height: 56px;
    }
    
    .nav-item span {
        display: none;
    }
    
    .hunt-btn-inner {
        width: 40px;
        height: 40px;
    }
    
    .nav-item.hunt-btn {
        top: -8px;
    }
    
    .main-content {
        padding-bottom: 76px;
    }
}

/* Pull-to-refresh zone */
.ptr-zone {
    height: 0;
    overflow: hidden;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: height 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ptr-zone.active {
    height: 50px;
}

.ptr-zone i {
    margin-right: 6px;
}
