/* Mobile-first responsive styles */

/* Custom scrollbar for better mobile experience */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #1A1D21;
}

::-webkit-scrollbar-thumb {
  background: #4B5563;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #6B7280;
}

/* Prevent horizontal scroll on mobile */
html, body {
  overflow-x: hidden;
}

/* Responsive text sizing */
@media (max-width: 640px) {
  .text-responsive-xl {
    font-size: 1.5rem;
    line-height: 2rem;
  }
  
  .text-responsive-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
  }
  
  .text-responsive-base {
    font-size: 0.875rem;
    line-height: 1.25rem;
  }
  
  .text-responsive-sm {
    font-size: 0.75rem;
    line-height: 1rem;
  }
}

/* Touch-friendly tap targets */
@media (max-width: 768px) {
  .touch-target {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Increase spacing for touch */
  .space-y-mobile > * + * {
    margin-top: 1rem;
  }
  
  /* Better mobile button sizing */
  .btn-mobile {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
}

/* Responsive chart container */
.chart-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Smooth transitions for mobile menu */
.sidebar-transition {
  transition: transform 0.3s ease-in-out;
}

/* Ensure content doesn't overlap with mobile menu */
@media (max-width: 1023px) {
  .content-with-sidebar {
    padding-top: 60px;
  }
}

/* Mobile table improvements */
@media (max-width: 768px) {
  .mobile-table {
    display: block;
  }
  
  .mobile-table thead {
    display: none;
  }
  
  .mobile-table tbody,
  .mobile-table tr,
  .mobile-table td {
    display: block;
    width: 100%;
  }
  
  .mobile-table tr {
    margin-bottom: 1rem;
    border: 1px solid #374151;
    border-radius: 0.5rem;
    padding: 0.75rem;
  }
  
  .mobile-table td {
    text-align: right;
    padding-left: 50%;
    position: relative;
  }
  
  .mobile-table td:before {
    content: attr(data-label);
    position: absolute;
    left: 6px;
    width: 45%;
    padding-right: 10px;
    text-align: left;
    font-weight: 600;
    color: #9CA3AF;
  }
}

/* Responsive grid layouts */
.responsive-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

@media (max-width: 640px) {
  .responsive-grid {
    grid-template-columns: 1fr;
  }
}

/* Responsive flex layouts */
.responsive-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (max-width: 640px) {
  .responsive-flex {
    flex-direction: column;
  }
}

/* Loading states for mobile */
.loading-skeleton {
  background: linear-gradient(90deg, #1F2937 0%, #374151 50%, #1F2937 100%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Pull-to-refresh indicator for mobile */
.pull-to-refresh {
  position: fixed;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  transition: top 0.3s ease;
}

.pull-to-refresh.active {
  top: 20px;
}