@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap');

@import url('../home/home.css');

h1, h2, h3, h4, h5, h6 {
  font-family: 'Segoe UI', sans-serif;
}

.archive-header h1 {
  font-family: 'Newsreader', serif;
}

.archive-container {
  max-width: 1400px;
  margin: 40px auto;
  padding: 0 20px;
}

.archive-header {
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.archive-header h1 {
  color: #054634;
  font-size: 32px;
  margin-bottom: 10px;
}

.archive-header p {
  color: #666;
  font-size: 16px;
}

/* Table Container */
.table-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.archive-table {
  width: 100%;
  border-collapse: collapse;
}

.archive-table thead {
  background: #054634;
  color: white;
}

.archive-table th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.archive-table tbody tr {
  border-bottom: 1px solid #e0e0e0;
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.archive-table tbody tr:hover {
  background-color: #f5f5f5;
}

.archive-table td {
  padding: 15px;
  font-size: 14px;
  color: #333;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.status-ended {
  background: #e3f2fd;
  color: #1976d2;
}

.status-completed {
  background: #e8f5e9;
  color: #388e3c;
}

.status-cancelled {
  background: #ffebee;
  color: #d32f2f;
}

.status-planning {
  background: #fff3e0;
  color: #f57c00;
}

.view-details-btn {
  background: #054634;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: background-color 0.2s ease;
}

.view-details-btn:hover {
  background: #043526;
}

/* Loading and Empty States */
.loading-message,
.no-records {
  text-align: center;
  padding: 60px 20px;
  color: #666;
  font-size: 16px;
}

.error-message {
  text-align: center;
  padding: 60px 20px;
  color: #d32f2f;
  font-size: 16px;
  background: #ffebee;
  border-radius: 8px;
  margin: 20px;
}

/* Responsive Table */
@media (max-width: 1024px) {
  .archive-table {
    font-size: 13px;
  }
  
  .archive-table th,
  .archive-table td {
    padding: 12px 10px;
  }
}

@media (max-width: 768px) {
  .archive-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  
  .archive-header h1 {
    font-size: 24px;
  }
  
  .archive-container {
    margin: 20px auto;
  }
}

/* Page transition animations */
body {
  animation: pagefadeIn 0.3s ease-in-out;
}

@keyframes pagefadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.page-exit {
  animation: pageExit 0.3s ease-in-out forwards;
}

@keyframes pageExit {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* Program Details Modal Styles */
.program-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.0); /* start transparent, fade in when active */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: background 220ms ease, opacity 220ms ease, visibility 220ms ease;
  z-index: 10000;
  padding: 20px;
  overflow-y: auto;
}

.program-modal-overlay.active {
  background: rgba(0, 0, 0, 0.6);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.program-modal {
  background: white;
  border-radius: 12px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  position: relative; /* let overlay flex center it */
  transform: translateY(-6px) scale(0.98);
  opacity: 0;
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events: none;
}

/* Hide native scrollbars for the modal but keep scrolling functional */
.program-modal {
  scrollbar-width: none; /* Firefox */
}
.program-modal::-webkit-scrollbar { /* Webkit */
  display: none;
}

/* Modal open animation */
@keyframes modalOpen {
  from { opacity: 0; transform: translate(-50%, -52%) scale(0.98); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.program-modal.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  animation: modalOpen 260ms cubic-bezier(.2,.9,.2,1) both;
}

.program-modal-header {
  background: #054634;
  color: white;
  padding: 20px 30px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.program-modal-header h3 {
  margin: 0;
  font-size: 24px;
}

.program-modal-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.program-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.program-modal-content {
  padding: 30px;
}

.modal-carousel {
  margin-bottom: 25px;
}

.modal-carousel-main {
  position: relative;
  background: #f5f5f5;
  border-radius: 8px;
  overflow: hidden;
  height: 400px;
}

.modal-carousel-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  color: white;
  border: none;
  font-size: 48px;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.7;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  padding: 20px;
  z-index: 10;
}

.modal-carousel-arrow:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.2);
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}

.modal-carousel-arrow.left {
  left: 0;
}

.modal-carousel-arrow.right {
  right: 0;
}

.modal-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  overflow-x: auto;
  padding: 5px 0;
}

.modal-thumbs img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.modal-thumbs img:hover {
  transform: scale(1.05);
}

.modal-thumbs img.active {
  border-color: #054634;
}

.program-modal-body {
  font-size: 15px;
  line-height: 1.6;
  color: #333;
}

.info-row {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e0e0e0;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-weight: 600;
  color: #054634;
  margin-bottom: 5px;
}

.info-value {
  color: #555;
}

/* Admin actions in modal */
.admin-actions {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid #e0e0e0;
}

.restore-btn {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.2s ease, opacity 0.2s;
}

.restore-btn:hover {
  background-color: #218838;
}

.restore-btn:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
  opacity: 0.6;
}

/* ========================================
   MOBILE RESPONSIVE STYLES - ARCHIVE PAGE
   ======================================== */

/* Tablet and below (768px) */
@media (max-width: 768px) {
  /* Archive container */
  .archive-container {
    padding: 0 10px;
    margin: 15px auto;
  }
  
  .archive-header {
    padding: 20px 15px;
  }
  
  .archive-header h1 {
    font-size: 22px;
  }
  
  .archive-header p {
    font-size: 14px;
  }
  
  /* Transform table into card layout for mobile */
  .table-container {
    border-radius: 0;
    box-shadow: none;
  }
  
  .archive-table {
    display: block;
    overflow-x: visible;
    white-space: normal;
  }
  
  .archive-table thead {
    display: none; /* Hide table header on mobile */
  }
  
  .archive-table tbody {
    display: block;
  }
  
  .archive-table tbody tr {
    display: block;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: default;
  }
  
  .archive-table tbody tr:hover {
    background: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  }
  
  .archive-table td {
    display: block;
    text-align: left;
    padding: 8px 0;
    border: none;
    font-size: 14px;
  }
  
  /* Add labels before each cell */
  .archive-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #054634;
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    text-transform: uppercase;
  }
  
  /* Program name should be prominent */
  .archive-table td:first-child {
    font-size: 18px;
    font-weight: bold;
    color: #054634;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
  }
  
  .archive-table td:first-child::before {
    display: none; /* Don't show label for program name */
  }
  
  /* Last cell (Action button) */
  .archive-table td:last-child {
    padding-top: 15px;
    text-align: center;
  }
  
  .view-details-btn {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
  }
  
  /* Modal adjustments for mobile */
  .program-modal-overlay {
    padding: 10px;
    align-items: flex-start;
    padding-top: 20px;
  }
  
  .program-modal {
    max-height: calc(100vh - 40px);
    border-radius: 8px;
  }
  
  .program-modal-header {
    padding: 15px 20px;
  }
  
  .program-modal-header h3 {
    font-size: 18px;
    line-height: 1.3;
  }
  
  .program-modal-content {
    padding: 20px 15px;
  }
  
  .modal-carousel-main {
    height: 250px;
  }
  
  .modal-carousel-arrow {
    font-size: 20px;
    padding: 8px 12px;
  }
  
  .modal-thumbs img {
    width: 60px;
    height: 60px;
  }
  
  .program-modal-body {
    font-size: 14px;
  }
}

/* Small mobile (480px and below) */
@media (max-width: 480px) {
  .archive-header h1 {
    font-size: 20px;
  }
  
  .archive-header p {
    font-size: 13px;
  }
  
  .archive-table tbody tr {
    padding: 12px;
  }
  
  .archive-table td {
    font-size: 13px;
  }
  
  .archive-table td:first-child {
    font-size: 16px;
  }
  
  .modal-carousel-main {
    height: 200px;
  }
  
  .modal-thumbs img {
    width: 50px;
    height: 50px;
  }
  
  .program-modal-header h3 {
    font-size: 16px;
  }
}

/* Notification Animations */
@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* Custom Confirmation Modal */
.confirm-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10002;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.confirm-modal-overlay.active {
  display: flex;
  opacity: 1;
}

.confirm-modal {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  max-width: 450px;
  width: 90%;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.confirm-modal-overlay.active .confirm-modal {
  transform: scale(1);
}

.confirm-modal-header {
  padding: 20px 24px;
  background: #054634;
  color: white;
}

.confirm-modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.confirm-modal-body {
  padding: 24px;
}

.confirm-modal-body p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: #333;
}

.confirm-modal-footer {
  padding: 16px 24px;
  background: #f8f9fa;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid #dee2e6;
}

.confirm-modal-footer .btn-secondary {
  padding: 10px 20px;
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.confirm-modal-footer .btn-secondary:hover {
  background: #5a6268;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.confirm-modal-footer .btn-primary {
  padding: 10px 20px;
  background: #054634;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.confirm-modal-footer .btn-primary:hover {
  background: #076d4f;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(5, 70, 52, 0.3);
}

