/**
 * ULTIMATE MOBILE ALIGNMENT FIX
 * This file has the HIGHEST priority and fixes all mobile alignment issues
 * Load this LAST to override everything else
 * ALL FIXES ARE MOBILE-ONLY (max-width: 768px)
 */

/* ============================================
   MOBILE RESPONSIVE BREAKPOINT ONLY
   ============================================ */

@media (max-width: 768px) {
  /* CRITICAL: PREVENT HORIZONTAL SCROLL */
  * {
    box-sizing: border-box !important;
    max-width: 100vw !important;
  }

  html {
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    scroll-behavior: smooth !important;
  }

  body {
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
  }

  /* FIX ALL CONTAINERS */
  .container,
  .hero-content,
  .dashboard-container,
  .simulator-container,
  .calculator-container,
  .contact-container,
  .flex-fund-dashboard {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
  }

  /* FIX ALL SECTIONS */
  section {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    padding: 40px 15px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
  }

  /* NAVIGATION FIX */
  #navbar {
    width: 100vw !important;
    max-width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
    padding: 10px 15px !important;
  }

  .nav-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .nav-menu {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
  }

  .nav-menu.active {
    width: 100vw !important;
    max-width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
  }

  /* HAMBURGER MENU */
  .hamburger-menu {
    display: block !important;
    width: 44px !important;
    height: 44px !important;
    z-index: 10001 !important;
    cursor: pointer !important;
    font-size: 1.5rem !important;
    color: var(--accent-color, #0ff) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .nav-menu {
    position: fixed !important;
    top: 60px !important;
    left: -100% !important;
    width: 100vw !important;
    height: calc(100vh - 60px) !important;
    background: rgba(0, 0, 0, 0.98) !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    padding: 20px !important;
    transition: left 0.3s ease !important;
    z-index: 1000 !important;
    overflow-y: auto !important;
  }

  .nav-menu.active {
    left: 0 !important;
  }

  .nav-menu li {
    width: 100% !important;
    margin: 10px 0 !important;
    text-align: center !important;
  }

  .nav-menu li a,
  .nav-menu li button {
    width: 100% !important;
    padding: 15px !important;
    display: block !important;
    font-size: 1.2rem !important;
    min-height: 50px !important;
  }

  /* HERO SECTION MOBILE FIX */
  #hero {
    width: 100% !important;
    max-width: 100vw !important;
    min-height: 100vh !important;
    padding: 80px 15px 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }

  .hero-content {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
  }

  .tech-logo-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto 20px !important;
    padding: 0 10px !important;
    display: flex !important;
    justify-content: center !important;
  }

  .tech-logo {
    width: 100% !important;
    max-width: 320px !important;
    height: 100px !important;
    object-fit: contain !important;
  }

  /* Fix logo text sizing inside SVG - INCREASED FROM 28px */
  .tech-logo .logo-text.main-text {
    font-size: 48px !important;
  }

  .tech-logo .logo-text.sub-text {
    font-size: 14px !important;
  }

  /* Make circuit paths and nodes visible on mobile */
  .tech-logo .circuit-path {
    stroke-width: 2 !important;
  }

  .tech-logo .tech-node {
    r: 4 !important;
  }

  .hero-header,
  .glitch-container,
  .title-line,
  .subtitle-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .terminal-heading {
    font-size: 1.5rem !important;
    margin: 0 0 15px !important;
    padding: 0 10px !important;
  }

  .section-description {
    font-size: 1rem !important;
    line-height: 1.5 !important;
    padding: 0 10px !important;
    margin: 15px 0 !important;
  }

  /* THEME SELECTOR MOBILE */
  .theme-selector {
    width: 100% !important;
    max-width: 100% !important;
    margin: 20px 0 !important;
    padding: 15px !important;
    background: rgba(0, 0, 0, 0.4) !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }

  .theme-buttons {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px !important;
    justify-items: center !important;
  }

  .theme-btn {
    width: 45px !important;
    height: 45px !important;
    min-width: 45px !important;
    min-height: 45px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* HERO STATS */
  .hero-stats {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    margin: 20px 0 !important;
    padding: 0 !important;
  }

  .hero-stats .blockchain-stat {
    width: 100% !important;
    padding: 12px 15px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    font-size: 0.95rem !important;
  }

  /* HERO ACTIONS */
  .hero-actions {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    margin: 25px 0 !important;
    padding: 0 !important;
  }

  .hero-btn,
  .connect-button {
    width: 100% !important;
    max-width: 100% !important;
    padding: 14px 20px !important;
    margin: 0 !important;
    font-size: 1.1rem !important;
    min-height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    text-align: center !important;
  }

  /* PROFILE / ABOUT SECTION */
  .profile-container {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 20px !important;
    text-align: center !important;
  }

  .profile-image {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
  }

  .profile-details {
    width: 100% !important;
  }

  .profile-stats {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)) !important;
    gap: 10px !important;
    margin: 20px 0 !important;
  }

  /* DASHBOARD & PANELS */
  .dashboard-container,
  .simulator-container,
  .calculator-container,
  .explorer-interface {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    padding: 0 !important;
  }

  .dashboard-panel,
  .simulator-panel,
  .calculator-panel,
  .results-panel,
  .trading-panel,
  .market-view,
  .explorer-controls,
  .explorer-viewport {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 15px 0 !important;
    padding: 15px !important;
    box-sizing: border-box !important;
  }

  /* GRIDS - FORCE SINGLE COLUMN */
  .dashboard-container,
  .flex-fund-dashboard,
  .project-specs,
  .specs-primary,
  .specs-detail,
  .metrics-grid,
  .real-time-stats {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  /* CHARTS */
  .chart-container {
    width: 100% !important;
    max-width: 100% !important;
    height: 250px !important;
    padding: 10px !important;
    overflow: hidden !important;
    position: relative !important;
  }

  .chart-container canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
  }

  /* 3D BLOCKCHAIN VIEWER */
  #blockchain3DContainer,
  #tradingBlockchain3DContainer {
    width: 100% !important;
    max-width: 100% !important;
    height: 300px !important;
    overflow: hidden !important;
  }

  #blockchain3DContainer canvas,
  #tradingBlockchain3DContainer canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
  }

  /* TRADING SIMULATOR */
  .energy-sources-container {
    width: 100% !important;
    margin: 15px 0 !important;
  }

  .energy-source {
    width: 100% !important;
    margin-bottom: 10px !important;
    padding: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .trade-form {
    width: 100% !important;
  }

  .transaction-type-toggle {
    width: 100% !important;
    display: flex !important;
    margin-bottom: 15px !important;
  }

  .transaction-type-btn {
    flex: 1 !important;
    padding: 12px !important;
    min-height: 44px !important;
  }

  /* TIMELINE */
  .timeline-container {
    width: 100% !important;
    padding: 0 !important;
  }

  .timeline-node {
    width: 100% !important;
    margin-bottom: 20px !important;
  }

  .node-content {
    width: 100% !important;
    padding: 15px !important;
  }

  .timeline-track,
  .timeline-axis {
    display: none !important;
  }

  /* ROADMAP */
  .roadmap-timeline {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .roadmap-phase {
    width: 100% !important;
    margin-bottom: 20px !important;
  }

  .phase-content {
    width: 100% !important;
    padding: 15px !important;
  }

  .phase-details {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  .milestone-card {
    width: 100% !important;
    padding: 12px !important;
  }

  /* AI ASSISTANT */
  .assistant-interface {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .assistant-sidebar {
    width: 100% !important;
    padding: 15px !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  }

  .assistant-main {
    width: 100% !important;
    padding: 15px !important;
  }

  .conversation-history {
    max-height: 300px !important;
    overflow-y: auto !important;
  }

  .input-field {
    display: flex !important;
    gap: 8px !important;
  }

  .input-field input {
    flex: 1 !important;
    padding: 12px !important;
    min-height: 44px !important;
  }

  .input-field button {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    flex-shrink: 0 !important;
  }

  /* BATTERY FLEX FUND */
  .flex-fund-dashboard {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
  }

  .fund-overview-panel,
  .fund-metrics-panel,
  .fund-strategy-panel {
    width: 100% !important;
    padding: 15px !important;
  }

  /* FINANCIAL SNAPSHOT */
  .snapshot-cards {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    padding: 0 !important;
  }

  .snapshot-card {
    width: 100% !important;
    padding: 15px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
  }

  .card-icon {
    font-size: 2rem !important;
    min-width: 45px !important;
  }

  /* FORMS */
  .form-group {
    width: 100% !important;
    margin-bottom: 15px !important;
  }

  .form-group label {
    display: block !important;
    width: 100% !important;
    margin-bottom: 6px !important;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px !important;
    font-size: 16px !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
  }

  /* BUTTONS */
  button,
  .btn,
  .submit-btn,
  .calculator-btn,
  .execute-btn {
    width: 100% !important;
    max-width: 100% !important;
    padding: 14px 20px !important;
    min-height: 50px !important;
    font-size: 1.1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    margin: 10px 0 !important;
  }

  /* CONTACT */
  .contact-container {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
  }

  .contact-info {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
  }

  .contact-card {
    width: 100% !important;
    padding: 15px !important;
  }

  .social-icons {
    display: flex !important;
    justify-content: center !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
  }

  .social-icon {
    width: 50px !important;
    height: 50px !important;
    min-width: 50px !important;
    min-height: 50px !important;
  }

  /* FOOTER */
  #siteFooter {
    width: 100% !important;
    padding: 30px 15px !important;
  }

  .footer-content {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    text-align: center !important;
  }

  .footer-links {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
  }

  .link-column {
    width: 100% !important;
  }

  .footer-bottom {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    text-align: center !important;
  }

  /* SVG & IMAGES */
  svg,
  img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* PREVENT TEXT OVERFLOW */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  span,
  div,
  a {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }

  /* TOUCH IMPROVEMENTS */
  a,
  button,
  input,
  select,
  textarea,
  .clickable,
  .theme-btn,
  .filter-btn {
    min-height: 44px !important;
    min-width: 44px !important;
    touch-action: manipulation !important;
  }

  /* iOS SPECIFIC */
  @supports (-webkit-touch-callout: none) {
    input,
    select,
    textarea {
      font-size: 16px !important;
    }

    body {
      -webkit-text-size-adjust: 100% !important;
    }
  }
}

/* SMALL MOBILE (< 480px) */
@media (max-width: 480px) {
  section {
    padding: 30px 12px !important;
  }

  .terminal-heading {
    font-size: 1.3rem !important;
  }

  .theme-buttons {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
  }

  .theme-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
  }

  .tech-logo {
    max-width: 240px !important;
    height: 70px !important;
  }
}

/* ============================================
   BLOCKCHAIN EXPLORER MOBILE FIXES
   ============================================ */
@media (max-width: 768px) {
  #blockchain-explorer,
  .explorer-interface {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    padding: 20px 10px !important;
  }

  .explorer-controls {
    width: 100% !important;
    max-width: 100% !important;
    padding: 15px !important;
    margin: 0 0 15px 0 !important;
  }

  .control-group {
    width: 100% !important;
    margin-bottom: 15px !important;
  }

  .control-group label {
    display: block !important;
    width: 100% !important;
    margin-bottom: 8px !important;
    font-size: 0.95rem !important;
  }

  .control-group select,
  .control-group input {
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px !important;
    font-size: 16px !important;
  }

  .range-slider-container {
    width: 100% !important;
    padding: 10px 0 !important;
  }

  .range-slider {
    width: 100% !important;
  }

  .control-actions {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 8px !important;
    margin: 15px 0 !important;
  }

  .explorer-btn {
    width: 100% !important;
    padding: 10px 5px !important;
    font-size: 0.85rem !important;
    white-space: nowrap !important;
  }

  .blockchain-stats {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    margin-top: 15px !important;
  }

  .stat-group {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .explorer-stat {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    padding: 10px !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border-radius: 8px !important;
  }

  .stat-label,
  .stat-value {
    font-size: 0.9rem !important;
  }

  .explorer-viewport {
    width: 100% !important;
    max-width: 100% !important;
    height: 350px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  #blockchain3DContainer {
    width: 100% !important;
    height: 100% !important;
    touch-action: pan-y pinch-zoom !important;
  }

  .block-info-panel {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    right: 10px !important;
    max-width: calc(100% - 20px) !important;
    padding: 12px !important;
    font-size: 0.85rem !important;
    max-height: 250px !important;
    overflow-y: auto !important;
  }

  .block-info-panel h3 {
    font-size: 1rem !important;
    margin-bottom: 10px !important;
  }

  .info-row {
    font-size: 0.8rem !important;
    margin-bottom: 6px !important;
    word-break: break-all !important;
  }
}

/* ============================================
   BATTERY FLEX FUND MOBILE FIXES
   ============================================ */
@media (max-width: 768px) {
  #battery-flex-fund,
  .battery-flex-fund {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    padding: 20px 10px !important;
  }

  .section-header {
    width: 100% !important;
    text-align: center !important;
    margin-bottom: 20px !important;
    padding: 0 10px !important;
  }

  .section-title {
    font-size: 1.5rem !important;
    margin-bottom: 8px !important;
  }

  .section-subtitle {
    font-size: 0.95rem !important;
  }

  .flex-fund-dashboard {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    padding: 0 !important;
  }

  .fund-overview-panel,
  .fund-metrics-panel,
  .fund-strategy-panel {
    width: 100% !important;
    max-width: 100% !important;
    padding: 15px !important;
    margin: 0 0 15px 0 !important;
    box-sizing: border-box !important;
  }

  .panel-header {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    margin-bottom: 15px !important;
  }

  .panel-header h3 {
    font-size: 1.2rem !important;
    margin: 0 !important;
  }

  .project-status {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    padding: 8px !important;
  }

  .project-specs {
    width: 100% !important;
  }

  .specs-primary,
  .specs-detail {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    margin: 10px 0 !important;
  }

  .spec-item {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 12px !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border-radius: 8px !important;
  }

  .spec-icon {
    font-size: 1.5rem !important;
    min-width: 40px !important;
    text-align: center !important;
  }

  .spec-data {
    flex: 1 !important;
  }

  .spec-value {
    font-size: 1.1rem !important;
    font-weight: bold !important;
    display: block !important;
    margin-bottom: 4px !important;
  }

  .spec-label {
    font-size: 0.85rem !important;
    opacity: 0.8 !important;
  }

  .system-diagram {
    width: 100% !important;
    display: none !important; /* Hide complex diagram on mobile */
  }

  .metrics-visualization {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
  }

  .metric-card {
    width: 100% !important;
    padding: 12px !important;
    margin: 0 !important;
  }

  .metric-card h4 {
    font-size: 1rem !important;
    margin-bottom: 10px !important;
  }

  .chart-container {
    width: 100% !important;
    height: 200px !important;
    margin: 10px 0 !important;
  }

  .chart-container canvas {
    width: 100% !important;
    height: 100% !important;
  }

  .chart-legend {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    margin-top: 10px !important;
  }

  .legend-item {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 0.85rem !important;
  }

  .legend-color {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0 !important;
  }

  .market-charts-container {
    width: 100% !important;
    margin: 15px 0 !important;
  }

  .chart-tab-container {
    width: 100% !important;
    display: flex !important;
    gap: 6px !important;
    margin-bottom: 12px !important;
    overflow-x: auto !important;
  }

  .chart-tab-container .btn-sm {
    padding: 8px 12px !important;
    font-size: 0.85rem !important;
    white-space: nowrap !important;
  }

  .panel-controls {
    width: 100% !important;
    display: flex !important;
    gap: 6px !important;
    overflow-x: auto !important;
  }

  .panel-controls .btn-sm {
    padding: 6px 10px !important;
    font-size: 0.8rem !important;
    white-space: nowrap !important;
  }

  .finance-metric {
    width: 100% !important;
    padding: 10px !important;
    text-align: center !important;
  }

  .metric-value {
    font-size: 1.3rem !important;
    margin-bottom: 4px !important;
  }

  .metric-label {
    font-size: 0.85rem !important;
  }

  .investment-highlights {
    width: 100% !important;
    padding: 0 !important;
    margin: 10px 0 !important;
  }

  .investment-highlights li {
    font-size: 0.9rem !important;
    margin-bottom: 8px !important;
    padding-left: 25px !important;
  }

  .fund-notes {
    width: 100% !important;
    padding: 15px 10px !important;
    margin-top: 20px !important;
    font-size: 0.85rem !important;
    line-height: 1.5 !important;
  }
}

/* ============================================
   TRADING SIMULATOR MOBILE FIXES
   ============================================ */
@media (max-width: 768px) {
  #trading-simulator {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .simulator-container {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
  }

  .simulator-panel {
    width: 100% !important;
    padding: 15px !important;
    margin: 0 !important;
  }

  .market-view,
  .trading-panel,
  .blockchain-panel {
    width: 100% !important;
    max-width: 100% !important;
  }

  .market-stats-grid {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .market-stat-card {
    width: 100% !important;
    padding: 12px !important;
  }

  .price-chart-container {
    width: 100% !important;
    margin: 15px 0 !important;
  }

  .chart-controls {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    margin-bottom: 12px !important;
  }

  .timeframe-selector {
    width: 100% !important;
    display: flex !important;
    gap: 6px !important;
    overflow-x: auto !important;
  }

  .timeframe-btn {
    padding: 8px 12px !important;
    font-size: 0.85rem !important;
    white-space: nowrap !important;
    min-width: 50px !important;
  }

  .chart-type-toggle {
    display: flex !important;
    gap: 6px !important;
    justify-content: center !important;
  }

  .chart-type-btn {
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
  }

  .energy-price-chart {
    width: 100% !important;
    height: 250px !important;
    margin: 10px 0 !important;
  }

  .energy-sources-container {
    width: 100% !important;
  }

  .energy-source {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 12px !important;
    margin-bottom: 8px !important;
  }

  .source-icon {
    font-size: 1.5rem !important;
    min-width: 40px !important;
  }

  .source-info {
    flex: 1 !important;
    padding: 0 10px !important;
  }

  .source-name {
    font-size: 0.95rem !important;
  }

  .source-price {
    font-size: 1rem !important;
    font-weight: bold !important;
  }

  .source-trend {
    font-size: 0.85rem !important;
    min-width: 60px !important;
    text-align: right !important;
  }

  .trading-interface {
    width: 100% !important;
  }

  .wallet-quick-access {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    font-size: 0.95rem !important;
  }

  .form-group {
    width: 100% !important;
    margin-bottom: 15px !important;
  }

  .custom-select {
    width: 100% !important;
    position: relative !important;
  }

  .custom-select select {
    width: 100% !important;
    padding: 12px !important;
    font-size: 16px !important;
  }

  .input-with-buttons {
    width: 100% !important;
    display: flex !important;
    gap: 8px !important;
  }

  .input-with-buttons input {
    flex: 1 !important;
    padding: 12px !important;
    font-size: 16px !important;
  }

  .input-with-buttons button {
    width: 44px !important;
    height: 44px !important;
    flex-shrink: 0 !important;
  }

  .preset-values {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin: 10px 0 !important;
  }

  .preset-btn {
    width: 100% !important;
    padding: 10px !important;
    font-size: 0.9rem !important;
  }

  .transaction-summary {
    width: 100% !important;
    padding: 15px !important;
    margin: 15px 0 !important;
  }

  .summary-item {
    display: flex !important;
    justify-content: space-between !important;
    margin-bottom: 10px !important;
    font-size: 0.95rem !important;
  }

  .execute-btn {
    width: 100% !important;
    padding: 15px !important;
    font-size: 1.1rem !important;
    min-height: 50px !important;
  }

  .transaction-history-container {
    width: 100% !important;
    margin-top: 20px !important;
  }

  .transaction-history {
    width: 100% !important;
    max-height: 250px !important;
    overflow-y: auto !important;
  }

  .transaction-item {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px !important;
    margin-bottom: 8px !important;
    font-size: 0.85rem !important;
  }

  .tx-indicator {
    width: 8px !important;
    height: 8px !important;
    flex-shrink: 0 !important;
  }

  .tx-content {
    flex: 1 !important;
    padding: 0 10px !important;
  }

  .tx-time {
    font-size: 0.75rem !important;
    white-space: nowrap !important;
  }

  .blockchain-visualization {
    width: 100% !important;
    margin-top: 20px !important;
  }

  #tradingBlockchain3DContainer {
    width: 100% !important;
    height: 300px !important;
  }

  .network-status {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 10px !important;
    font-size: 0.85rem !important;
  }
}

/* ============================================
   ENERGY STATS BANNER MOBILE FIX
   ============================================ */
@media (max-width: 768px) {
  .energy-stats-banner {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    padding: 15px 10px !important;
    margin: 20px 0 !important;
  }

  .stat-item {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 12px 8px !important;
    min-width: 0 !important;
  }

  .stat-item i {
    font-size: 1.5rem !important;
    margin-bottom: 6px !important;
  }

  .stat-value {
    font-size: 1rem !important;
    margin-bottom: 4px !important;
  }

  .stat-label {
    font-size: 0.8rem !important;
    text-align: center !important;
  }
}

/* ============================================
   DATA CONTROLS & TOGGLES MOBILE FIX
   ============================================ */
@media (max-width: 768px) {
  .data-controls {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    margin: 15px 0 !important;
  }

  .toggle-group {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 10px !important;
  }

  .toggle-label {
    width: 100% !important;
    text-align: center !important;
    margin-bottom: 5px !important;
  }

  .toggle-btn {
    padding: 8px 12px !important;
    font-size: 0.9rem !important;
    min-width: 60px !important;
  }

  .refresh-btn {
    width: 100% !important;
    padding: 12px !important;
    justify-content: center !important;
  }
}

/* ============================================
   ENSURE NO HORIZONTAL SCROLL
   ============================================ */
@media (max-width: 768px) {
  /* Override any potential overflow causes */
  * {
    max-width: 100vw !important;
  }

  /* Specific overrides for problematic elements */
  table,
  pre,
  code {
    max-width: 100% !important;
    overflow-x: auto !important;
    word-wrap: break-word !important;
  }

  /* Canvas elements */
  canvas {
    max-width: 100% !important;
  }

  /* SVG elements */
  svg {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Text elements that might overflow */
  .hash-value,
  .wallet-address,
  .address-value,
  .tx-hash,
  code,
  pre {
    word-break: break-all !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
  }
}
