/* Home Page Layout - Enhanced Responsive and Adaptive Design */

/* Mobile-first approach for home page layout */
.ab-main-content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0;
  overflow: hidden;
  background-color: #ffffff !important; /* Ensure white background */
}

/* Page header styling - further reduced size and weight */
.ab-page-header {
  padding: 0.75rem 1rem 0.5rem;
  background: transparent;
  flex-shrink: 0;
  border-bottom: none;
}

.ab-page-header h5 {
  font-size: 0.9rem; /* Further reduced from 1rem */
  font-weight: 500; /* Further reduced from 600 to 500 */
  color: #1f2937;
  margin: 0;
  letter-spacing: -0.01em; /* Reduced letter spacing */
}

/* Activity container responsive spacing */
.ab-activity-container {
  padding: 0.5rem 0.75rem;
  background: transparent;
}

/* Drop area container */
.ab-drop-area {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0.5rem 0.75rem 0.75rem;
  overflow: hidden;
}

/* Small mobile (380px+) */
@media (min-width: 380px) {
  .ab-page-header {
    padding: 0.875rem 1rem 0.625rem;
  }
  
  .ab-page-header h5 {
    font-size: 0.95rem; /* Reduced from 1.0625rem */
  }
  
  .ab-activity-container {
    padding: 0.625rem 1rem;
  }
  
  .ab-drop-area {
    padding: 0.625rem 1rem 1rem;
  }
}

/* Tablet styles (576px+) */
@media (min-width: 576px) {
  .ab-page-header {
    padding: 1rem 1.25rem 0.75rem;
  }
  
  .ab-page-header h5 {
    font-size: 1rem; /* Reduced from 1.125rem */
  }
  
  .ab-activity-container {
    padding: 0.75rem 1.25rem;
  }
  
  .ab-drop-area {
    padding: 0.75rem 1.25rem 1.25rem;
  }
}

/* Desktop small (768px+) */
@media (min-width: 768px) {
  .ab-page-header {
    padding: 1.25rem 1.5rem 1rem;
  }
  
  .ab-page-header h5 {
    font-size: 1.0625rem; /* Reduced from 1.1875rem */
  }
  
  .ab-activity-container {
    padding: 1rem 1.5rem;
  }
  
  .ab-drop-area {
    padding: 1rem 1.5rem 1.5rem;
  }
}

/* Desktop medium (992px+) */
@media (min-width: 992px) {
  .ab-page-header {
    padding: 1.5rem 2rem 1.25rem;
  }
  
  .ab-page-header h5 {
    font-size: 1.125rem; /* Reduced from 1.25rem */
  }
  
  .ab-activity-container {
    padding: 1.25rem 2rem;
  }
  
  .ab-drop-area {
    padding: 1.25rem 2rem 2rem;
  }
}

/* Desktop large (1200px+) */
@media (min-width: 1200px) {
  .ab-page-header {
    padding: 1.75rem 2.5rem 1.5rem;
  }
  
  .ab-page-header h5 {
    font-size: 1.1875rem; /* Reduced from 1.375rem */
  }
  
  .ab-activity-container {
    padding: 1.5rem 2.5rem;
  }
  
  .ab-drop-area {
    padding: 1.5rem 2.5rem 2.5rem;
  }
}

/* Desktop extra large (1400px+) */
@media (min-width: 1400px) {
  .ab-page-header {
    padding: 2rem 3rem 1.75rem;
  }
  
  .ab-page-header h5 {
    font-size: 1.25rem; /* Reduced from 1.5rem */
  }
  
  .ab-activity-container {
    padding: 1.75rem 3rem;
  }
  
  .ab-drop-area {
    padding: 1.75rem 3rem 3rem;
  }
}

/* Ultra-wide displays (1600px+) */
@media (min-width: 1600px) {
  .ab-page-header {
    padding: 2.25rem 3.5rem 2rem;
  }
  
  .ab-page-header h5 {
    font-size: 1.375rem; /* Reduced from 1.625rem */
  }
  
  .ab-activity-container {
    padding: 2rem 3.5rem;
  }
  
  .ab-drop-area {
    padding: 2rem 3.5rem 3.5rem;
  }
}

/* Super ultra-wide displays (1920px+) */
@media (min-width: 1920px) {
  .ab-page-header {
    padding: 2.5rem 4rem 2.25rem;
  }
  
  .ab-page-header h5 {
    font-size: 1.5rem; /* Reduced from 1.75rem */
  }
  
  .ab-activity-container {
    padding: 2.25rem 4rem;
  }
  
  .ab-drop-area {
    padding: 2.25rem 4rem 4rem;
  }
}

/* Ensure proper sidebar spacing when present */
@media (min-width: 576px) {
  body.ab-has-sidebar .ab-main-content {
    margin-left: 0; /* Let sidebar handle positioning */
  }
  
  body.ab-has-sidebar.ab-sidebar-collapsed .ab-main-content {
    margin-left: 0; /* Let sidebar handle positioning */
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .ab-page-header {
    border-bottom: 2px solid #000000;
    background-color: #ffffff;
  }
  
  .ab-page-header h5 {
    color: #000000 !important;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .ab-main-content * {
    transition: none !important;
    animation: none !important;
  }
}

/* Print styles */
@media print {
  .ab-main-content {
    min-height: auto;
    overflow: visible;
    background-color: #ffffff !important;
  }
  
  .ab-activity-container,
  .ab-drop-area {
    padding: 1rem;
  }
  
  .ab-page-header {
    border-bottom: 1px solid #000000;
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: #ffffff !important;
  }
  
  .ab-page-header h5 {
    color: #000000 !important;
    font-size: 1rem; /* Smaller in print */
  }
}

/* Focus management for keyboard navigation */
.ab-main-content:focus {
  outline: none;
}

.ab-main-content [tabindex="-1"]:focus {
  outline: none;
}

/* Loading states */
.ab-main-content.loading {
  pointer-events: none;
}

.ab-main-content.loading::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Error states */
.ab-main-content.error .ab-activity-container {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 8px;
  margin: 0.5rem;
}

/* Success states */
.ab-main-content.success .ab-activity-container {
  background: #f0fff4;
  border: 1px solid #c6f6d5;
  border-radius: 8px;
  margin: 0.5rem;
}

/* Landscape mobile optimizations */
@media (max-height: 500px) and (orientation: landscape) {
  .ab-page-header {
    padding: 0.5rem 1rem 0.25rem;
  }
  
  .ab-page-header h5 {
    font-size: 0.8rem; /* Even smaller for landscape */
  }
  
  .ab-activity-container {
    padding: 0.25rem 1rem;
  }
  
  .ab-drop-area {
    padding: 0.25rem 1rem 0.5rem;
  }
}

/* Very small screens optimization */
@media (max-width: 320px) {
  .ab-page-header {
    padding: 0.5rem 0.75rem 0.375rem;
  }
  
  .ab-page-header h5 {
    font-size: 0.8rem; /* Smaller for very small screens */
  }
  
  .ab-activity-container {
    padding: 0.375rem 0.75rem;
  }
  
  .ab-drop-area {
    padding: 0.375rem 0.75rem 0.75rem;
  }
}