/* Landing Pages Mobile Responsive - Complex Layouts */

/* ===== LANDING_PORTAL.PHP - Pump.fun Interface ===== */

/* Main Layout */
@media (max-width: 1200px) {
  .wrap { padding: 0 16px; }
  .main-grid { grid-template-columns: 1fr; gap: 20px; }
  .sidebar { order: -1; }
}

@media (max-width: 900px) {
  /* Header & Navigation */
  .topbar { padding: 0 12px; }
  .brand { font-size: 1.2rem; }
  .nav-pills { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 6px; 
    justify-content: center; 
  }
  .nav-pills .pill { 
    font-size: 12px; 
    padding: 6px 10px; 
  }
  
  /* Crypto Table - Horizontal Scroll */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    margin: 0 -12px;
    padding: 0 12px;
  }
  
  .crypto-table {
    min-width: 800px;
    font-size: 13px;
  }
  
  .crypto-table th,
  .crypto-table td {
    padding: 8px 6px;
    white-space: nowrap;
  }
  
  /* Filters & Controls */
  .filters-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  
  .filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .filter-btn {
    flex: 1;
    min-width: 80px;
    font-size: 12px;
    padding: 8px 12px;
  }
}

@media (max-width: 768px) {
  /* Stack Layout */
  .main-grid { gap: 16px; }
  
  /* Mobile Table - Card Format */
  .crypto-table-mobile {
    display: block;
  }
  
  .crypto-table-mobile .crypto-row {
    display: block;
    background: rgba(15, 22, 38, 0.7);
    border: 1px solid #1a243a;
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 16px;
  }
  
  .crypto-table-mobile .crypto-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  
  .crypto-table-mobile .crypto-name {
    font-weight: 700;
    font-size: 16px;
  }
  
  .crypto-table-mobile .crypto-price {
    font-weight: 600;
    color: #00e5a8;
  }
  
  .crypto-table-mobile .crypto-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 13px;
  }
  
  .crypto-table-mobile .detail-item {
    display: flex;
    justify-content: space-between;
  }
  
  .crypto-table-mobile .detail-label {
    color: #9fb2cd;
  }
  
  /* Hide desktop table on mobile */
  .crypto-table { display: none; }
  
  /* Sidebar Adjustments */
  .sidebar {
    background: rgba(15, 22, 38, 0.9);
    border-radius: 16px;
    padding: 16px;
  }
  
  .sidebar-section {
    margin-bottom: 20px;
  }
  
  .sidebar-title {
    font-size: 16px;
    margin-bottom: 12px;
  }
}

@media (max-width: 480px) {
  .wrap { padding: 0 10px; }
  
  .crypto-table-mobile .crypto-details {
    grid-template-columns: 1fr;
  }
  
  .filter-group {
    flex-direction: column;
  }
  
  .filter-btn {
    width: 100%;
  }
}

/* ===== HOME.PHP - Formation Landing ===== */

@media (max-width: 1200px) {
  .container { padding: 0 16px; }
  .hero__wrap { gap: 30px; }
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr 1fr; gap: 20px; }
  .price__wrap { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  /* Hero Section */
  .hero { padding: 60px 0 40px; }
  .h1 { font-size: 48px; }
  .h2 { font-size: 36px; }
  .lead.big { font-size: 18px; }
  
  /* Charts & Visualizations */
  .chart { padding: 12px; }
  .chart-svg { height: 280px; }
  .chart__legend { 
    flex-direction: column; 
    gap: 10px; 
    align-items: stretch;
  }
  .legend-badge { 
    text-align: center; 
    width: 100%; 
  }
  
  /* Pricing Cards */
  .pricecard { 
    padding: 30px 20px; 
    margin-bottom: 20px;
  }
  .price { font-size: 48px; }
  
  /* Chapter Grid */
  .chapters .grid3 { 
    grid-template-columns: 1fr; 
    gap: 16px; 
  }
  
  .neon-card { 
    padding: 20px; 
  }
}

@media (max-width: 768px) {
  .container { padding: 0 12px; }
  
  /* Mobile Hero */
  .hero { 
    padding: 40px 0 30px; 
    text-align: center; 
  }
  .hero__text { 
    padding-left: 0; 
    border-left: none; 
    border-top: 3px solid var(--a2); 
    padding-top: 20px; 
  }
  .h1 { font-size: 42px; }
  .h2 { font-size: 32px; }
  .lead.big { font-size: 16px; }
  
  /* Navigation */
  .nav { display: none; }
  .site__row { flex-wrap: wrap; gap: 10px; }
  
  /* All Grids to Single Column */
  .grid2, .grid3, .grid4, .stats-grid { 
    grid-template-columns: 1fr; 
    gap: 16px; 
  }
  
  /* CTA Buttons */
  .cta-row { 
    flex-direction: column; 
    align-items: stretch; 
  }
  .cta-row .btn { 
    width: 100%; 
    margin-bottom: 8px;
  }
  
  /* Badges & Pills */
  .badges { 
    justify-content: center; 
    gap: 6px;
  }
  .pill { 
    font-size: 12px; 
    padding: 6px 12px; 
  }
  
  /* Charts Mobile */
  .chart-svg { height: 240px; }
  .chart { padding: 8px; }
  
  /* Pricing Mobile */
  .pricecard { 
    padding: 24px 16px; 
    text-align: center;
  }
  .price { font-size: 42px; }
  .bullets li { 
    padding-left: 30px; 
    font-size: 14px;
  }
  
  /* Guarantee Section */
  .guarantee { 
    flex-direction: column; 
    text-align: center; 
  }
  .shield { margin-bottom: 10px; }
}

@media (max-width: 480px) {
  .container { padding: 0 10px; }
  
  /* Ultra Mobile */
  .h1 { font-size: 32px; }
  .h2 { font-size: 28px; }
  .h3 { font-size: 20px; }
  .lead.big { font-size: 15px; }
  
  .card, .neon-card, .pricecard { 
    padding: 16px 12px; 
  }
  
  .chart-svg { height: 200px; }
  .price { font-size: 36px; }
  
  .btn { 
    padding: 12px 20px; 
    font-size: 14px; 
  }
  
  .badges { gap: 4px; }
  .pill { 
    font-size: 11px; 
    padding: 4px 8px; 
  }
}

/* ===== LANDING.PHP - Tool Landing ===== */

@media (max-width: 1200px) {
  .hero__grid { 
    grid-template-columns: 1fr; 
    gap: 30px; 
    text-align: center;
  }
  
  .demo-interface { 
    max-width: 600px; 
    margin: 0 auto; 
  }
}

@media (max-width: 900px) {
  /* Hero Adjustments */
  .hero { padding: 80px 0 50px; }
  .h1 { font-size: 48px; }
  
  /* Demo Interface */
  .panel { padding: 12px; }
  .chart-svg { height: 280px; }
  
  /* Feature Cards */
  .grid2, .grid3 { 
    grid-template-columns: 1fr; 
    gap: 16px; 
  }
  
  /* Status Chips */
  .status-row { 
    justify-content: center; 
    gap: 8px; 
  }
  .chip { 
    font-size: 12px; 
    padding: 6px 10px; 
  }
}

@media (max-width: 768px) {
  /* Mobile Layout */
  .hero { padding: 50px 0 30px; }
  .h1 { font-size: 42px; }
  .h2 { font-size: 32px; }
  
  /* Navigation */
  .nav { display: none; }
  
  /* Demo Interface Mobile */
  .demo-interface {
    margin: 0 -12px;
    border-radius: 0;
  }
  
  .panel { 
    padding: 8px; 
    border-radius: 0;
  }
  .chart-svg { height: 240px; }
  
  /* Feature List */
  .value li { 
    padding-left: 25px; 
    font-size: 14px;
  }
  
  /* CTA Section */
  .cta-row { 
    flex-direction: column; 
  }
  .cta-row .btn { 
    width: 100%; 
  }
  
  /* Status Chips Mobile */
  .status-row { 
    flex-wrap: wrap; 
    gap: 6px; 
  }
  .chip { 
    flex: 1; 
    min-width: 100px; 
    justify-content: center;
  }
  
  /* Stars Rating */
  .stars { 
    justify-content: center; 
    margin: 8px 0; 
  }
}

@media (max-width: 480px) {
  /* Ultra Mobile */
  .hero { padding: 30px 0 20px; }
  .h1 { font-size: 32px; }
  .h2 { font-size: 28px; }
  
  .demo-interface { 
    margin: 0 -10px; 
  }
  
  .chart-svg { height: 200px; }
  
  .chip { 
    font-size: 11px; 
    padding: 5px 8px; 
    min-width: 80px;
  }
  
  .value li { 
    font-size: 13px; 
    margin: 8px 0; 
  }
}

/* ===== FLOATING ELEMENTS MOBILE FIXES ===== */

/* Fix for ax-overlay (floating navigation) */
@media (max-width: 768px) {
  .ax-overlay {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    background: rgba(7, 11, 18, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 0 !important;
    padding: 12px 16px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    justify-content: center !important;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3) !important;
  }
  
  .ax-overlay a {
    flex: 1 !important;
    min-width: 120px !important;
    text-align: center !important;
    padding: 10px 12px !important;
    font-size: 13px !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  
  /* Add bottom padding to body when ax-overlay is present */
  body:has(.ax-overlay) {
    padding-bottom: 80px !important;
  }
}

@media (min-width: 769px) {
  .ax-overlay {
    position: fixed !important;
    right: 16px !important;
    bottom: 16px !important;
    left: auto !important;
    display: flex !important;
    gap: 10px !important;
    z-index: 9999 !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    flex-wrap: nowrap !important;
  }
}

/* Fix for promo-popin (bottom left popup) */
@media (max-width: 768px) {
  .promo-popin {
    position: fixed !important;
    bottom: 90px !important; /* Above ax-overlay */
    left: 12px !important;
    right: 12px !important;
    z-index: 999 !important;
    max-width: none !important;
    display: block !important;
  }
  
  .promo-card {
    max-width: 100% !important;
    margin: 0 auto !important;
  }
  
  .promo-cta {
    flex-direction: column !important;
    gap: 6px !important;
  }
  
  .promo-cta a {
    width: 100% !important;
    padding: 12px !important;
    font-size: 13px !important;
  }
}

@media (max-width: 480px) {
  .promo-popin {
    bottom: 100px !important;
    left: 8px !important;
    right: 8px !important;
  }
  
  .promo-card {
    padding: 12px !important;
  }
  
  .promo-cta a {
    padding: 10px !important;
    font-size: 12px !important;
  }
}

/* Fix for top navigation visibility */
@media (max-width: 768px) {
  .site, .topbar, .header {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    background: rgba(7, 11, 18, 0.95) !important;
    backdrop-filter: blur(10px) !important;
  }
  
  .site__row, .topbar .wrap, .header-top {
    min-height: 56px !important;
    padding: 0 12px !important;
  }
  
  /* Ensure navigation is always visible */
  .nav, .menu {
    display: none !important;
  }
  
  /* Mobile menu toggle if it exists */
  .mobile-menu-toggle {
    display: block !important;
    background: none !important;
    border: 1px solid rgba(108, 168, 255, 0.3) !important;
    color: #6ca8ff !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
  }
}

/* Fix for page-caption (top banner) */
@media (max-width: 768px) {
  .page-caption {
    position: relative !important;
    z-index: 50 !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    text-align: center !important;
    line-height: 1.4 !important;
  }
  
  .cap-sep {
    display: none !important;
  }
  
  .page-caption span:not(.cap-dot):not(.cap-sep) {
    display: block !important;
    margin: 2px 0 !important;
  }
}

/* ===== POPINS & MODALS ===== */

@media (max-width: 768px) {
  .modal, .popin {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    border-radius: 0;
    max-width: 100vw;
    max-height: 100vh;
    overflow-y: auto;
    z-index: 1100; /* Above floating elements */
  }
  
  .modal-content, .popin-content {
    padding: 20px 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  
  .modal-header, .popin-header {
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 10;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 16px;
  }
  
  .modal-close, .popin-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
  }
  
  .modal-body, .popin-body {
    flex: 1;
  }
  
  .modal-footer, .popin-footer {
    position: sticky;
    bottom: 0;
    background: var(--bg);
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 16px;
  }
  
  .modal-footer .btn,
  .popin-footer .btn {
    width: 100%;
    margin-bottom: 8px;
  }
}

/* ===== ACCESSIBILITY & TOUCH ===== */

@media (max-width: 768px) {
  /* Touch Targets */
  .btn, .chip, .pill, .nav a, .filter-btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Focus Indicators */
  .btn:focus,
  .chip:focus,
  .filter-btn:focus {
    outline: 2px solid #6ca8ff;
    outline-offset: 2px;
  }
  
  /* Scroll Indicators */
  .table-container::after {
    content: "← Faites défiler →";
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    pointer-events: none;
  }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */

@media (max-width: 768px) {
  /* Reduce animations on mobile */
  .orb, .bg-beams, .neon-pulse {
    animation-duration: 20s;
  }
  
  /* Simplify blur effects */
  .backdrop-filter {
    backdrop-filter: blur(5px);
  }
  
  /* Optimize gradients */
  .card, .panel {
    background: rgba(15, 22, 38, 0.9);
  }
}
