body { font-family: system-ui, Arial, sans-serif; margin: 0; padding: 0; }

/* Content width controls */
.content-wrapper {
  width: 100%;
}

.content-contained {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.content-full-width {
  width: 100%;
}

/* Responsive content control */
@media (min-width: 1400px) {
  .content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
  }
}
header { display:flex; justify-content:space-between; align-items:center; margin-bottom: 12px; }
.flash-success { background:#e6ffed; border:1px solid #b4f5c8; padding:8px; margin:8px 0; }
.flash-error { background:#ffecec; border:1px solid #f5b4b4; padding:8px; margin:8px 0; }
table.calendar { width: 100%; border-collapse: collapse; }
table.calendar th, table.calendar td { border:1px solid #ddd; vertical-align: top; padding:6px; }
td.time { width: 70px; background:#fafafa; font-weight: bold; }
.shift { background:#f3f9ff; border:1px solid #cfe4ff; padding:6px; margin:4px 0; border-radius:4px; }
.meta { font-size: 12px; color:#333; margin-bottom: 4px; }

body {
  background-color: #f5f7fa;
}

.card {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.weekly-shift-table thead th {
  text-align: center;
  vertical-align: bottom;
}

.weekly-shift-table td {
  text-align: center;
  vertical-align: top;
}

.weekly-shift-table tbody th {
  text-align: center;
  vertical-align: middle;
}

.shift-block {
  border: 1px solid #ccc;
  padding: .5rem;
  margin-bottom: .5rem;
  background: #f5f5f5;
  text-align: left;
}

.shift-block-special {
  background: #fff9c4; /* light yellow for "*** ***" / special rows */
}

.shift-block-cop .shift-block-header {
  background: #a00;
  color: #fff;
}

.shift-block-header {
  background: green;
  color: white;
  font-weight: bold;
  padding: .15rem .35rem;
  margin: -.5rem -.5rem .4rem -.5rem; /* flush to block borders */
}

.shift-entry {
  cursor: pointer;
  line-height: 1.25rem;
}

.weekly-shift-table .events td {
  background-color: #fff9c4; /* light yellow */
}

.weekly-shift-table .text-muted.small {
  color: #888;
  font-size: 0.8rem;
  text-align: center;
}

/* Make all table headers consistent (thead + tbody label cells) */
.weekly-shift-table thead th,
.weekly-shift-table tbody th {
  font-size: 1rem;         /* same size everywhere */
  font-weight: 700;        /* header-style bold */
  line-height: 1.25;       /* keeps the day + date tidy */
}

/* Task row styling */
.task-row td, .task-row th {
  background-color: #ffffcc !important;
}

.task-row td:hover {
  background-color: #ffff99 !important;
}

/* Shift period header styling to match table headers */
.weekly-shift-table .shift-period-header {
  background-color: #f8f9fa;
  color: #000;
}

/* Mobile responsiveness for shift table */
@media (max-width: 768px) {
  .weekly-shift-table {
    font-size: 0.8rem;
  }
  
  .weekly-shift-table th,
  .weekly-shift-table td {
    padding: 4px 2px;
    min-width: 60px;
  }
  
  .weekly-shift-table .shift-cell {
    min-height: 60px;
  }
  
  .shift-block {
    font-size: 0.75rem;
    padding: 2px;
    margin-bottom: 2px;
  }
  
  .shift-block div {
    font-size: 0.7rem;
    line-height: 1.2;
  }
  
  /* Make the table horizontally scrollable on mobile */
  .table-responsive {
    border: none;
    -webkit-overflow-scrolling: touch;
  }
  
  .mobile-shift-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  
  .mobile-shift-table::-webkit-scrollbar {
    height: 8px;
  }
  
  .mobile-shift-table::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
  }
  
  .mobile-shift-table::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
  }
  
  .mobile-shift-table::-webkit-scrollbar-thumb:hover {
    background: #555;
  }
  
  /* Improve button sizes on mobile */
  .btn-group .btn {
    font-size: 0.8rem;
    padding: 0.375rem 0.5rem;
  }
  
  /* Make the shift period header more compact */
  .weekly-shift-table tbody th {
    font-size: 0.8rem;
    padding: 4px 2px;
  }
  
  /* Improve touch targets */
  .shift-cell {
    min-height: 70px;
  }
  
  .shift-block {
    min-height: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  /* Ensure holiday/event blocks are visible on mobile */
  .mobile-event-block,
  .mobile-holiday-block {
    display: block !important;
  }
}

@media (max-width: 576px) {
  .weekly-shift-table {
    font-size: 0.7rem;
  }
  
  .weekly-shift-table th,
  .weekly-shift-table td {
    padding: 2px 1px;
    min-width: 50px;
  }
  
  .shift-block {
    font-size: 0.65rem;
    padding: 1px;
  }
  
  .shift-block div {
    font-size: 0.6rem;
  }
  
  /* Hide some less important content on very small screens */
  .shift-block .member-names {
    font-size: 0.55rem;
  }
}

/* Mobile Card Layout Styles */
.mobile-cards-container {
  padding: 0 10px;
}

.mobile-day-card {
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mobile-day-card .card-header {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  padding: 12px;
}

.mobile-day-card .card-header h5 {
  font-size: 1rem;
  font-weight: 600;
  color: #495057;
}

.mobile-shift-period {
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 10px;
}

.mobile-shift-period:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.mobile-period-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #495057;
  background-color: #f8f9fa;
  padding: 6px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.mobile-shifts-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-shift-block {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.mobile-shift-block:hover {
  background-color: #e9ecef;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mobile-shift-block.needed-shift {
  background-color: #e3f2fd;
  border-color: #90caf9;
}

.mobile-shift-block.needed-shift:hover {
  background-color: #bbdefb;
}

.mobile-shift-block.regular-shift {
  background-color: #f3f9ff;
  border-color: #cfe4ff;
}

.mobile-shift-block.regular-shift:hover {
  background-color: #e1f5fe;
}

.mobile-shift-block.default-task {
  background-color: #fff3e0;
  border-color: #ffcc02;
  border-style: dashed;
}

.shift-time {
  font-weight: 600;
  color: #007bff;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.shift-name {
  font-weight: 600;
  color: #495057;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.shift-description {
  color: #6c757d;
  font-size: 0.8rem;
  font-style: italic;
}

.shift-team {
  background-color: #fff3cd;
  color: #856404;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 4px;
}

.shift-vehicle {
  background-color: #e3f2fd;
  color: #1976d2;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 4px;
}

.shift-user {
  color: #495057;
  font-size: 0.85rem;
  font-weight: 500;
}

.shift-comment {
  color: #6c757d;
  font-size: 0.8rem;
  margin-top: 4px;
  font-style: italic;
}

.mobile-empty-shift {
  color: #adb5bd;
  font-style: italic;
  text-align: center;
  padding: 10px;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px dashed #dee2e6;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.mobile-empty-shift:hover {
  background-color: #f8f9fa;
  color: #6c757d;
}

/* Mobile button group styling */
.mobile-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.mobile-btn-group .btn {
  min-width: 40px;
  padding: 6px 8px;
}

/* Priority indicators for mobile */
.mobile-shift-block[data-needed-shift-is-high-priority="true"] {
  border-left: 4px solid #dc3545;
}

.mobile-shift-block[data-approval-status="pending"] {
  border-left: 4px solid #ffc107;
}

.mobile-shift-block[data-approval-status="rejected"] {
  border-left: 4px solid #dc3545;
}

.mobile-shift-block[data-approval-status="cancelled"] {
  border-left: 4px solid #6c757d;
}

/* Draggable Sidebar Styles */
.draggable-sidebar {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  width: 200px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-height: 70vh;
  overflow-y: auto;
  transition: all 0.3s ease;
}

.draggable-sidebar.hidden {
  transform: translateY(-50%) translateX(100%);
  opacity: 0;
  pointer-events: none;
}

.sidebar-header {
  position: relative;
  padding: 8px 15px 0 15px;
  border-bottom: 1px solid #eee;
  margin-bottom: 10px;
}

.sidebar-toggle {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 10;
  background: transparent !important;
  border: none !important;
  color: #6c757d !important;
  padding: 4px !important;
}

.sidebar-toggle:hover {
  background: rgba(0, 0, 0, 0.1) !important;
  color: #dc3545 !important;
}

.sidebar-content {
  padding: 15px;
}

.sidebar-title {
  font-weight: bold;
  color: #333;
  margin-bottom: 10px;
  font-size: 14px;
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
}

.draggable-items {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.draggable-item {
  padding: 8px 12px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  cursor: grab;
  font-size: 13px;
  transition: all 0.2s ease;
  user-select: none;
}

.draggable-item i {
  margin-right: 8px;
}

.draggable-item:hover {
  background: #e9ecef;
  border-color: #adb5bd;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.draggable-item:active {
  cursor: grabbing;
  transform: scale(0.95);
}

.team-item {
  border-left: 3px solid #007bff;
}

.vehicle-item {
  border-left: 3px solid #28a745;
}

/* Drop zone styles */
.shift-cell.drag-over {
  background-color: #e3f2fd !important;
  border: 2px dashed #1976d2 !important;
}

.shift-cell.drag-over::after {
  content: "Drop here to assign";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(25, 118, 210, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  z-index: 1001;
  pointer-events: none;
}

/* Dragging state */
.draggable-item.dragging {
  opacity: 0.5;
  transform: rotate(5deg);
}

/* RTL support for sidebar */
[dir="rtl"] .draggable-sidebar {
  right: auto;
  left: 20px;
}

/* JSON Display Enhancement */
.json-display {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-left: 4px solid #007bff;
  border-radius: 0.375rem;
  position: relative;
}

.json-display::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #007bff, #6f42c1, #28a745);
  border-radius: 0.375rem 0.375rem 0 0;
}

.json-display .json-key {
  color: #d73a49;
  font-weight: bold;
}

.json-display .json-string {
  color: #032f62;
}

.json-display .json-number {
  color: #005cc5;
}

.json-display .json-boolean {
  color: #e36209;
  font-weight: bold;
}

.json-display .json-null {
  color: #6a737d;
  font-style: italic;
}

.json-display .json-bracket {
  color: #24292e;
  font-weight: bold;
}

.json-display .json-comma {
  color: #24292e;
}

.json-display .json-colon {
  color: #24292e;
}

/* Welcome page language buttons */
.language-btn {
  transition: all 0.3s ease;
  border: 2px solid #dee2e6;
}
.language-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.language-btn.active {
  background-color: #0d6efd;
  border-color: #0d6efd;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}
.language-btn i,
.language-btn .flag-image {
  font-size: 1.2em;
}
.language-btn .flag-image {
  width: 1.2em;
  height: 0.8em;
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
}

/* Welcome page community card selection */
.community-card { cursor: pointer; }
.community-card.selected { border: 2px solid #0d6efd; box-shadow: 0 0 0 0.2rem rgba(13,110,253,.25); }
.community-card .btn.btn-outline-primary { color: #0d6efd; background-color: transparent; }
.community-card.selected .btn.btn-outline-primary { color: #fff; background-color: #0d6efd; border-color: #0d6efd; }
.community-card.selected .btn.btn-outline-primary:hover { color: #fff; background-color: #0b5ed7; border-color: #0a58ca; }
.community-card .card-title { color: inherit; }
.community-card.selected .card-title { color: #0d6efd; }
.community-card .text-muted { color: #6c757d !important; }
.community-card.selected .text-muted { color: #495057 !important; }
.community-card.selected .btn.btn-outline-primary .fa-user-plus { color: #fff; }

/* Mobile: mirror desktop color accents for needed shifts */
@media (max-width: 768px) {
  .mobile-shift-block.needed-shift .shift-time {
    border-radius: 3px;
  }
}
