/* Admin Panel Styles */

.hidden {
  display: none !important;
}


/* Admin Body */
.admin-body {
  background: #DEE2E5;
  min-height: 100vh;
  font-family: 'Open Sans', sans-serif;
}

/* ================= Admin Index Layout & Cards (slideshow/partners) ================ */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

.admin-sidebar {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1rem;
  height: fit-content;
  position: sticky;
  top: 1rem;
}

.admin-sidebar ul { list-style: none; padding: 0; margin: 0; }
.admin-sidebar li { margin-bottom: 0.5rem; }
.admin-sidebar .sidebar-link {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  color: #374151;
  text-decoration: none;
}
.admin-sidebar .sidebar-link.active,
.admin-sidebar .sidebar-link:hover {
  background: #eff6ff;
  color: #1e40af;
}

.admin-section {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.file-input { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.file-input input[type="file"] { display: none; }

/* Grid list used by slideshow and partners */
.grid-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  align-items: start; /* keep items aligned at top to avoid visual overlap */
}

/* Slideshow admin grid: exactly 2 cards per row on desktop/tablet */
#slideshowGrid.grid-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 768px) {
  #slideshowGrid.grid-list {
    grid-template-columns: 1fr; /* stack on small screens */
  }
}

.card {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  overflow: hidden;
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: 140px;
  width: 100%; /* card should not overflow its grid cell */
  position: relative;
}

.card__image {
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

/* Slideshow thumbnail target: max 200x120 */
.card__image img {
  width: 200px;
  height: 120px;
  object-fit: cover;
  border-radius: 0.5rem;
}

.card__body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0; /* allow inputs/textareas to shrink within the card */
}

.card__meta { color: #6b7280; font-size: 0.8125rem; }
.card__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.checkbox { display: inline-flex; align-items: center; gap: 0.375rem; color: #374151; }
.input { width: 100%; padding: 0.5rem; border: 1px solid #e5e7eb; border-radius: 0.5rem; font-size: 0.875rem; }
.input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }

/* Partners specific image size: logos up to 80x80 centered */
#section-partners .card {
  grid-template-columns: 120px 1fr;
  min-height: 120px;
}
#section-partners .card__image { padding: 0.75rem; }
#section-partners .card__image img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  background: #ffffff;
  border: 1px dashed #e5e7eb;
  border-radius: 0.5rem;
}

/* Empty state alignment within admin sections */
.admin-section .empty-state { padding: 2rem 1rem; }

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; }
  .card { grid-template-columns: 1fr; }
  .card__image img { width: 100%; height: 160px; }
}

/* Admin Month View (Calendar) */
.admin-calendar-grid {
  display: grid;
  grid-template-columns: 80px repeat(7, 1fr); /* week number + 7 days */
  gap: 1px;
  background: #DEE2E5; /* grid lines */
}

.admin-calendar-day {
  background: white;
  min-height: 120px;
  padding: 0.5rem;
  position: relative;
}

.admin-calendar-day.other-month {
  background: #f9fafb;
  color: #9ca3af;
}

.admin-calendar-day.today {
  background: #eff6ff;
  border: 2px solid #3b82f6;
}

.admin-calendar-day.has-sessions {
  border-left: 4px solid #10b981;
}

.admin-calendar-day.non-working {
  background: #fff1f2; /* light red */
}

.admin-calendar-day .day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.admin-calendar-day .day-number {
  font-weight: 600;
  color: #374151;
}

.admin-calendar-day .add-session-btn {
  background: transparent;
  border: 1px solid #e5e7eb;
  color: #6b7280;
  border-radius: 4px;
  padding: 0.125rem 0.25rem;
  cursor: pointer;
}

.admin-calendar-day .add-session-btn:hover {
  background: #f3f4f6;
}

.admin-calendar-day .day-sessions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-session-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-left: 3px solid #3F6695;
  border-radius: 4px;
  padding: 0.25rem 0.375rem;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-session-card .session-checkbox input {
  width: 14px;
  height: 14px;
}

.admin-session-card .session-content .session-title {
  font-weight: 600;
  color: #1f2937;
}

.admin-session-card .session-content .session-time,
.admin-session-card .session-content .session-participants {
  color: #6b7280;
  font-size: 0.6875rem;
}

.admin-session-card.safety { border-left-color: #10b981; }
.admin-session-card.medical { border-left-color: #f59e0b; }
.admin-session-card.survival { border-left-color: #ef4444; }
.admin-session-card.offshore { border-left-color: #8b5cf6; }
.admin-session-card.specialized { border-left-color: #6366f1; }

/* Week View Styles */
.week-header {
  display: grid;
  grid-template-columns: 80px 80px 1fr; /* week number | time column | days header */
  border-bottom: 1px solid #e5e7eb;
}

.time-column {
  background: #DEE2E5;
  border-right: 1px solid #e5e7eb;
}

.week-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #DEE2E5;
}

.week-day-header {
  flex: 1;
  padding: 1rem;
  text-align: center;
  border-right: 1px solid #e5e7eb;
  background: #f9fafb;
}

.week-day-header.non-working {
  background: #fee2e2; /* light header */
}

.week-day-header:last-child {
  border-right: none;
}

.day-name {
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.25rem;
}

.day-date {
  font-size: 0.875rem;
  color: #6b7280;
}

.week-content {
  display: grid;
  grid-template-columns: 80px 80px 1fr; /* week number | time slots | week grid */
  max-height: 600px;
  overflow-y: auto;
}

/* Week number header and box (mirror public schedule.css) */
.week-number-header {
  background: #d8dee6;
  border-right: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 700;
  color: #374151;
}

.week-number-header .week-number-value {
  display: inline-block;
  min-width: 2ch;
}

.week-number-box {
  background: #f3f4f6;
  color: #374151;
  border-right: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.admin-time-slots {
  width: 80px;
  flex-shrink: 0;
  border-right: 1px solid #e5e7eb;
}

.time-slot {
  height: 60px;
  padding: 0.5rem;
  font-size: 0.75rem;
  color: #6b7280;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: flex-start;
}

.admin-week-grid {
  display: flex;
  flex: 1;
  position: relative;
}

.week-day-column {
  flex: 1;
  position: relative;
  border-right: 1px solid #e5e7eb;
  min-height: 660px;
}

.week-day-column.non-working {
  background: #fff7f8; /* very subtle */
}

.week-day-column:last-child {
  border-right: none;
}

.week-day-column::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 59px,
    #f3f4f6 59px,
    #f3f4f6 60px
  );
  pointer-events: none;
}

.week-session {
  position: absolute;
  left: 2px;
  right: 2px;
  background: #3F6695;
  color: #ffffff;
  border-radius: 6px;
  padding: 0.5rem 0.6rem;
  font-size: 0.8125rem; /* 13px */
  cursor: pointer;
  z-index: 1;
  overflow: hidden;
  border-left: 4px solid #2d5a87;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.week-session:hover {
  background: #2d5a87;
  transform: translateX(1px);
}

.week-session .session-title {
  font-weight: 700;
  margin-bottom: 0.175rem;
  color: #fff;
  white-space: normal; /* allow wrapping */
  overflow: hidden;
  text-overflow: clip;
  line-height: 1.15;
}

.week-session .session-time {
  font-size: 0.75rem;
  color: #e5e7eb;
  opacity: 1;
  margin-bottom: 0.125rem;
}

.week-session .session-participants {
  font-size: 0.75rem;
  color: #f3f4f6;
  opacity: 1;
  font-weight: 600;
}

/* Bulk Actions Panel */
.bulk-actions-panel {
  background: #DEE2E5;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: all 0.3s ease;
}

.bulk-actions-panel.active {
  max-height: 200px;
  opacity: 1;
  padding: 1rem;
}

.bulk-actions-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.bulk-selection {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.bulk-actions-buttons {
  display: flex;
  gap: 0.5rem;
}

.bulk-actions-buttons .btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.bulk-actions-buttons .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Recent Activities Styles */
.activities-section {
  background: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-top: 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.activities-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 0.5rem;
  border-left: 3px solid #d1d5db;
}

.activity-item.recent {
  border-left-color: #10b981;
  background: #f0fdf4;
}

.activity-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #3F6695;
  color: white;
  border-radius: 50%;
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
}

.activity-title {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.25rem;
}

.activity-details {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.activity-status {
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.activity-status.scheduled {
  background: #dbeafe;
  color: #1e40af;
}

.activity-status.in_progress {
  background: #fef3c7;
  color: #92400e;
}

.activity-status.completed {
  background: #d1fae5;
  color: #065f46;
}

.activity-status.cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.activity-actions {
  display: flex;
  gap: 0.5rem;
}

.no-activities {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
}

.no-activities i {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: block;
}

/* Rating Chart Styles */
.rating-chart-container {
  background: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.rating-chart-container h3 {
  margin: 0 0 1rem 0;
  color: #1f2937;
  font-size: 1.125rem;
  font-weight: 600;
}

.rating-chart {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chart-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.bar-label {
  min-width: 60px;
  font-size: 0.875rem;
  color: #6b7280;
}

.bar-container {
  flex: 1;
  height: 20px;
  background: #f3f4f6;
  border-radius: 10px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3F6695 0%, #2d5a87 100%);
  border-radius: 10px;
  transition: width 0.3s ease;
  width: 0%;
}

.bar-percentage {
  min-width: 40px;
  text-align: right;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1f2937;
}

/* Admin Login */
.admin-login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.admin-login-card {
  background: white;
  border-radius: 1rem;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.admin-login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.admin-logo {
  width: 80px;
  height: auto;
  margin-bottom: 1rem;
}

.admin-login-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.admin-login-header p {
  color: #6b7280;
  font-size: 0.875rem;
}

.admin-login-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  color: #374151;
  font-size: 0.875rem;
}

.form-group input {
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.form-group input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: #3F6695;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #2d5a87;
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: #6b7280;
  color: white;
}

.btn-secondary:hover {
  background: #4b5563;
}

.btn-success {
  background: #059669;
  color: white;
}

.btn-success:hover {
  background: #047857;
}

.btn-warning {
  background: #d97706;
  color: white;
}

.btn-warning:hover {
  background: #b45309;
}

.btn-danger {
  background: #dc2626;
  color: white;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
}

.btn-full {
  width: 100%;
}

.btn-spinner svg {
  animation: spin 1s linear infinite;
}

.error-message {
  background: #fef2f2;
  color: #dc2626;
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #fecaca;
  font-size: 0.875rem;
}

.admin-login-footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
}

.admin-login-footer a {
  color: #6b7280;
  text-decoration: none;
  font-size: 0.875rem;
}

.admin-login-footer a:hover {
  color: #374151;
}

/* Admin Header */
.admin-header {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.admin-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-logo img {
  width: 40px;
  height: auto;
}

.admin-logo h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2937;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-user {
  color: #6b7280;
  font-size: 0.875rem;
}

/* Admin Main */
.admin-main {
  padding: 2rem 0;
}

/* Dashboard Stats */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.stat-card h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: #1e3a8a;
}

/* Ensure schedule dashboard stats render on a single row on wide screens */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 1rem;
  align-items: stretch;
}

@media (max-width: 1024px) {
  .dashboard-stats {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 520px) {
  .dashboard-stats {
    grid-template-columns: 1fr;
  }
}

/* Upload Section */
.admin-upload {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.upload-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.upload-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
}

.upload-form-container {
  border-top: 1px solid #e5e7eb;
  padding-top: 1.5rem;
  overflow: hidden;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
}

.form-group textarea {
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.form-group select {
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: white;
}

/* File Upload */
.file-upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 0.75rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.file-upload-area:hover {
  border-color: #3b82f6;
  background: #DEE2E5;
}

.file-upload-area.drag-over {
  border-color: #3b82f6;
  background: #eff6ff;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: #6b7280;
}

.upload-placeholder svg {
  color: #9ca3af;
}

.upload-placeholder p {
  font-weight: 600;
  margin: 0;
}

.upload-placeholder small {
  font-size: 0.75rem;
  opacity: 0.8;
}

.upload-progress {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: #DEE2E5;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #3A84C5;
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

/* Gallery Management */
.admin-gallery {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.gallery-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
}

.gallery-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  padding: 0.5rem 2.5rem 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  width: 200px;
  font-size: 0.875rem;
}

.search-box svg {
  position: absolute;
  right: 0.75rem;
  color: #6b7280;
  pointer-events: none;
}

.gallery-controls select {
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background: white;
}

/* Bulk Actions */
.bulk-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.selected-count {
  font-weight: 600;
  color: #1e40af;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.gallery-item {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all 0.2s ease;
  position: relative;
}

.gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gallery-item.inactive {
  opacity: 0.6;
}

.item-checkbox {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
}

.item-checkbox input {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: #3b82f6;
}

.item-thumbnail {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
}

.item-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-type-icon {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.25rem;
  border-radius: 0.25rem;
}

.item-content {
  padding: 1rem;
}

.item-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.item-description {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.5;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.item-type {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge.active {
  background: #d1fae5;
  color: #065f46;
}

.status-badge.inactive {
  background: #fef3c7;
  color: #92400e;
}

.item-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.item-actions .btn {
  flex: 1;
  min-width: 0;
}

/* Loading Spinner */
.loading-spinner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  color: #6b7280;
}

.loading-spinner.active {
  display: flex;
}

.loading-spinner .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e5e7eb;
  border-top: 4px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

.loading-spinner svg {
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: #6b7280;
}

.empty-state svg {
  margin-bottom: 1rem;
  color: #9ca3af;
}

.empty-state h3 {
  color: #374151;
  margin-bottom: 0.5rem;
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 0.75rem;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 0;
  margin-bottom: 1rem;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.modal-close:hover {
  color: #374151;
}

.modal-form {
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-body {
  padding: 0 1.5rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  padding: 1.5rem;
  border-top: 1px solid #e5e7eb;
  margin-top: 1rem;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: white;
  color: #374151;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #3b82f6;
  min-width: 300px;
  animation: slideIn 0.3s ease;
}

.toast.toast-success {
  border-left-color: #10b981;
}

.toast.toast-error {
  border-left-color: #ef4444;
}

.toast.toast-warning {
  border-left-color: #f59e0b;
}

.toast.fade-out {
  animation: slideOut 0.3s ease forwards;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .admin-container {
    padding: 0 0.75rem;
  }

  .admin-header-content {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .admin-nav {
    justify-content: space-between;
  }

  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .upload-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .gallery-header {
    flex-direction: column;
    align-items: stretch;
  }

  .gallery-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box input {
    width: 100%;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .item-actions {
    flex-direction: column;
  }

  .modal {
    padding: 1rem;
  }

  #toast-container {
    top: 1rem;
    right: 1rem;
    left: 1rem;
  }

  .toast {
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .admin-stats {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }

  .bulk-actions {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}

/* Centered primary action on admin schedule */
.centered-action-section {
  padding: 16px 0 8px;
}
.centered-action {
  display: flex;
  justify-content: center;
  align-items: center;
}
.centered-action .btn.btn-primary.btn-lg {
  font-size: 1.05rem;
  padding: 12px 18px;
}

/* Shared header help button styles (used on all admin pages) */
.header-content {
  position: relative;
}

.header-content.has-help .logo {
  margin-left: 36px; /* space for the help button */
}

.header-help-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background-color: #f0f9ff;
  color: #0ea5e9;
  border: 1px solid #bae6fd;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  transition: background-color 0.2s;
}

.header-help-btn:hover {
  background-color: #e0f2fe;
}
