/* Responsive Design System for Spot and Eat Admin & Kitchen Portals */

/* Mobile Header - Hidden by default, shown on mobile */
.mobile-header {
  display: none;
  background: var(--gradient-hero, linear-gradient(135deg, #EF4444 0%, #DC2626 40%, #B91C1C 100%));
  color: white;
  padding: 1rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.mobile-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.mobile-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.mobile-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Sidebar responsive modifications */
.sidebar {
  transition: transform 0.3s ease, width 0.3s ease;
  z-index: 999;
}

/* Mobile overlay for sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}

.sidebar-overlay.active {
  display: block;
}

/* Responsive Main Content */
.main-content {
  transition: margin-left 0.3s ease, padding 0.3s ease;
}

/* Responsive Grid Systems */
.stats-grid,
.earnings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

/* Responsive Tables */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--border-radius, 8px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table-responsive table {
  min-width: 600px;
  width: 100%;
  border-collapse: collapse;
}

/* Enhanced table styling for mobile */
@media (max-width: 768px) {
  .table-responsive table {
    font-size: 0.875rem;
  }
  
  .table-responsive th,
  .table-responsive td {
    padding: 0.75rem 0.5rem;
    text-align: left;
  }
  
  .table-responsive th {
    background-color: var(--surface-color, #f8f9fa);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color, #e2e8f0);
  }
  
  .table-responsive tr:nth-child(even) {
    background-color: var(--background-dark, #f7f7f7);
  }
  
  /* Hide less important columns on mobile */
  .table-responsive .hide-mobile {
    display: none;
  }
  
  /* Compact table actions */
  .table-actions {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
  }
  
  .table-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    min-width: auto;
    width: auto;
    margin-bottom: 0;
  }
}

/* Responsive Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

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

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-color, #000);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--border-radius-sm, 8px);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color, #DC2626);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Responsive form layouts */
@media (max-width: 768px) {
  .form-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  
  .form-row .form-group {
    flex: 1;
    margin-bottom: 0;
  }
  
  /* Stack form elements vertically on mobile */
  .form-inline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  
  .form-inline .form-group {
    margin-bottom: 0;
  }
}

/* Responsive checkboxes and radios */
.checkbox-group,
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (max-width: 480px) {
  .checkbox-group,
  .radio-group {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Media Queries */

/* Large Tablets and Small Laptops */
@media (max-width: 1200px) {
  .sidebar {
    width: 240px;
  }
  
  .main-content {
    margin-left: 240px;
    padding: 2rem;
  }
  
  .stats-grid,
  .earnings-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

/* Tablets */
@media (max-width: 992px) {
  .sidebar {
    width: 220px;
  }
  
  .main-content {
    margin-left: 220px;
    padding: 1.5rem;
  }
  
  .dashboard-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .dashboard-header h1 {
    font-size: 2rem;
  }
  
  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

/* Mobile Landscape and Small Tablets */
@media (max-width: 768px) {
  /* Show mobile header */
  .mobile-header {
    display: block;
  }
  
  /* Hide/transform sidebar */
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
    width: 280px;
    top: 0;
    height: 100vh;
    z-index: 999;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  /* Adjust main content */
  .main-content {
    margin-left: 0;
    padding: 1rem;
    padding-top: 5rem; /* Account for mobile header */
    width: 100%;
  }
  
  /* Responsive dashboard header */
  .dashboard-header {
    padding: 1.5rem;
    margin-bottom: 2rem;
  }
  
  .dashboard-header h1 {
    font-size: 1.75rem;
  }
  
  /* Responsive grids */
  .stats-grid,
  .earnings-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
  }
  
  .card-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  /* Responsive cards */
  .stat-card,
  .earnings-card {
    padding: 1.5rem;
  }
  
  .stat-card .stat-value {
    font-size: 2rem;
  }
  
  /* Responsive tables */
  .table-responsive {
    margin: 0 -1rem;
    padding: 0 1rem;
  }
  
  /* Responsive forms */
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  /* Responsive buttons */
  .btn {
    width: 100%;
    justify-content: center;
    margin-bottom: 0.5rem;
  }
  
  .btn-group {
    flex-direction: column;
  }
  
  .btn-group .btn {
    margin-bottom: 0.5rem;
    margin-right: 0;
  }
}

/* Mobile Portrait */
@media (max-width: 480px) {
  .main-content {
    padding: 0.75rem;
    padding-top: 4.5rem;
  }
  
  .dashboard-header {
    padding: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .dashboard-header h1 {
    font-size: 1.5rem;
  }
  
  /* Smaller grids for mobile */
  .stats-grid,
  .earnings-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
  }
  
  /* Compact cards */
  .stat-card,
  .earnings-card {
    padding: 1rem;
  }
  
  .stat-card h3 {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
  }
  
  .stat-card .stat-value {
    font-size: 1.5rem;
  }
  
  .earnings-value {
    font-size: 1.5rem;
  }
  
  /* Responsive sidebar adjustments */
  .sidebar {
    width: 260px;
    padding: 1.5rem;
  }
  
  .sidebar-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
  }
  
  .sidebar-header h3 {
    font-size: 1.25rem;
  }
  
  .nav-link {
    padding: 12px 16px;
    font-size: 0.9rem;
  }
  
  /* Tables on mobile */
  .table-responsive table {
    font-size: 0.875rem;
  }
  
  .table-responsive th,
  .table-responsive td {
    padding: 0.5rem;
  }
}

/* Extra Small Mobile */
@media (max-width: 320px) {
  .main-content {
    padding: 0.5rem;
    padding-top: 4rem;
  }
  
  .stats-grid,
  .earnings-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  
  .stat-card,
  .earnings-card {
    padding: 0.75rem;
  }
  
  .stat-card .stat-value {
    font-size: 1.25rem;
  }
  
  .earnings-value {
    font-size: 1.25rem;
  }
  
  .dashboard-header h1 {
    font-size: 1.25rem;
  }
  
  .mobile-logo {
    font-size: 1rem;
  }
}

/* Utility Classes for Responsive Design */
.mobile-only {
  display: none;
}

.desktop-only {
  display: block;
}

@media (max-width: 768px) {
  .mobile-only {
    display: block;
  }
  
  .desktop-only {
    display: none;
  }
}

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

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

/* Print Styles */
@media print {
  .sidebar,
  .mobile-header,
  .btn,
  .nav-link {
    display: none !important;
  }
  
  .main-content {
    margin-left: 0 !important;
    padding: 1rem !important;
  }
  
  .card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    break-inside: avoid;
  }
}