/* =================== BODY & LAYOUT =================== */
body {
  font-family: Arial, sans-serif;
  background-color: #f8fafc;
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* ensures footer stays at bottom */
}

main {
  flex: 1; /* pushes footer down */
  padding-top: 80px; /* space for fixed header, adjust if needed */
}

/* =================== EVENTS TITLE =================== */
.events-title {
  text-align: center;
  font-size: 32px;
  font-style: italic;
  margin-top: 20px;
  margin-bottom: 30px;
  color: #1d4ed8;
}

/* =================== EVENTS CONTAINER =================== */
.events-container {
  display: flex;
  flex-direction: column; /* vertical stacking */
  gap: 30px;
  padding: 20px 30px;
  max-width: 700px; /* optional: center container */
  margin: auto;
}

/* =================== EVENT CELL =================== */
.event-cell {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
  display: flex;
  flex-direction: column; /* image on top, content below */
}

.event-cell:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.event-cell img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.event-cell .content {
  padding: 15px;
}

.event-cell .title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 8px;
}

.event-cell .snippet {
  font-size: 14px;
  color: #555;
}

/* =================== PAGINATION =================== */
.pagination {
  text-align: center;
  margin: 30px 0;
}

.pagination a {
  display: inline-block;
  margin: 0 5px;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  background: #1d4ed8;
  color: #fff;
  transition: all 0.3s ease;
}

.pagination a:hover {
  background: #2563eb;
}

.pagination .active {
  background: #16a34a;
}

/* =================== EVENT DETAIL =================== */
.event-detail {
  max-width: 800px;
  margin: 40px auto;
  background: #fff;
  border-radius: 10px;
  padding: 30px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.event-detail img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 20px;
}

.event-detail .title {
  font-size: 36px; /* bigger, attention-grabbing */
  font-weight: 700; /* bold */
  color: #1d4ed8; /* library blue */
  margin-bottom: 20px;
  text-align: center;
}

.event-detail .description-label {
  font-weight: bold;
  font-size: 18px;
  margin-bottom: 10px;
}

.event-detail .description-text {
  font-size: 16px;
  color: #333;
  line-height: 1.6;
}

/* =================== NO EVENTS TEXT =================== */
.no-events {
  text-align: center;
  width: 100%;
  color: gray;
  margin-top: 20px;
}

/* =================== FOOTER =================== */
footer {
  margin-top: auto; /* sticks footer to bottom */
  background: #1d4ed8;
  color: white;
  text-align: center;
  padding: 20px 0;
}

.event-submit-container {
  max-width: 600px;
  margin: 60px auto;
  background: #fff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.event-submit-container h2 {
  text-align: center;
  margin-bottom: 15px;
  font-size: 26px;
  color: #1d4ed8;
}

.event-submit-container .note {
  text-align: center;
  font-size: 14px;
  color: #555;
  margin-bottom: 25px;
}

.event-submit-form label {
  font-weight: bold;
  display: block;
  margin-bottom: 6px;
}

.event-submit-form input[type="text"],
.event-submit-form textarea,
.event-submit-form input[type="file"] {
  width: 100%;
  padding: 10px;
  margin-bottom: 20px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
}

.event-submit-form button {
  display: block;
  width: 100%;
  padding: 12px;
  background: #1d4ed8;
  color: white;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.event-submit-form button:hover {
  background: #2563eb;
}

.file-note {
  font-weight: normal;
  font-size: 12px;
  color: #666;
}

/* =================== EVENTS SUBMIT =================== */
.event-submit-wrapper {
  text-align: center;
  padding: 30px;
}
button {
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
}
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}
.modal-content {
  background: #fff;
  margin: 50px auto;
  padding: 20px;
  width: 400px;
  border-radius: 10px;
  position: relative;
}
.close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
}
input,
textarea {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  border-radius: 4px;
  border: 1px solid #ccc;
}
#formMessage {
  margin-top: 10px;
  font-weight: bold;
}

/* ========== EVENT TIME DROPDOWN ========== */
#event_time {
  width: 220px;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  max-height: 220px; /* roughly 10 rows visible */
  overflow-y: auto; /* scroll when more than 10 */
}

/* =================== POPUP MODAL =================== */
#popupMessage {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
  z-index: 2000;
  width: 90%;
  max-width: 500px;
  text-align: left;
  opacity: 0;
  transition: all 0.3s ease;
}

/* Enhanced show animation and visibility */
#popupMessage.show {
  display: block !important;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Popup heading */
#popupMessage h3 {
  text-align: center;
  margin-bottom: 15px;
  font-size: 22px;
}

/* Info labels inside popup */
#popupMessage p strong {
  display: inline-block;
  min-width: 100px;
  color: #1d4ed8;
}

/* Buttons inside popup */
#popupMessage button,
#popupMessage a.popup-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 18px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
}

/* Close button */
#popupMessage button {
  background: #dc2626;
  color: #fff;
  border: none;
}
#popupMessage button:hover {
  background: #b91c1c;
}

/* View file button */
#popupMessage a.popup-btn {
  background: #1d4ed8;
  color: #fff;
}
#popupMessage a.popup-btn:hover {
  background: #2563eb;
}

/* Added overlay styles for better modal experience */
#popupOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1999;
  display: none;
}

/* =================== MODAL CARD (Success/Error Layout) =================== */
.modal-card {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  max-width: 500px;
  margin: auto;
}

.modal-success {
  color: #16a34a;
  margin-bottom: 15px;
  text-align: center;
}

.modal-body {
  display: grid;
  grid-template-columns: 140px 1fr; /* labels + values */
  gap: 8px 16px;
}

.modal-row {
  display: contents; /* align children to grid */
}

.modal-btn {
  margin-top: 20px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: white;
  cursor: pointer;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.modal-btn:hover {
  background: #1e40af;
}

.modal-link {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  background: #2563eb;
  color: white;
  text-decoration: none;
}

.modal-link:hover {
  background: #1e40af;
}

/* Added proposal card styles to fix status text overflow */
/* =================== PROPOSAL CARD =================== */
.content-wrapper {
  max-width: 1200px; /* Increased max-width from 900px to 1200px to prevent status text wrapping */
  margin: 40px auto;
  padding: 20px;
}

.page-title {
  text-align: center;
  font-size: 32px;
  color: #1d4ed8;
  margin-bottom: 30px;
}

.filter-form {
  text-align: center;
  margin-bottom: 30px;
}

.filter-form label {
  font-weight: bold;
  margin-right: 10px;
  color: #333;
}

.filter-form select {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
  cursor: pointer;
}

.proposals-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.proposal-card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden; /* prevents content from leaking out */
  word-wrap: break-word; /* breaks long words */
}

.proposal-card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.proposal-card h3 {
  font-size: 20px;
  color: #1d4ed8;
  margin-bottom: 12px;
  word-wrap: break-word; /* ensures title wraps */
}

.proposal-card p {
  margin: 8px 0;
  font-size: 14px;
  color: #555;
  word-wrap: break-word; /* ensures all text wraps */
}

.proposal-card p strong {
  color: #333;
}

.proposal-card .status {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 13px;
  margin-top: 10px;
  white-space: nowrap; /* Added white-space: nowrap to keep "Status: Pending" on one line */
  max-width: 100%; /* ensures it stays within container */
}

.proposal-card .status.pending {
  background: #fef3c7;
  color: #92400e;
}

.proposal-card .status.accepted {
  background: #d1fae5;
  color: #065f46;
}

.proposal-card .status.rejected {
  background: #fee2e2;
  color: #991b1b;
}

.proposal-card .status.cancelled {
  background: #e5e7eb;
  color: #374151;
}

.empty-msg {
  text-align: center;
  color: #999;
  font-size: 16px;
  margin-top: 40px;
}

/* =================== PROPOSAL DETAIL =================== */
.proposal-detail {
  max-width: 800px;
  margin: 40px auto;
  background: #fff;
  border-radius: 10px;
  padding: 30px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.proposal-detail .proposal-title {
  font-size: 28px;
  color: #1d4ed8;
  margin-bottom: 20px;
  font-weight: bold;
}

.proposal-detail .proposal-status {
  margin: 15px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.proposal-detail .proposal-status strong {
  color: #333;
  font-size: 16px;
}

.proposal-detail .status {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 14px;
  white-space: nowrap;
  vertical-align: middle;
}

.proposal-detail .status.pending {
  background: #fef3c7;
  color: #92400e;
}

.proposal-detail .status.accepted {
  background: #d1fae5;
  color: #065f46;
}

.proposal-detail .status.rejected {
  background: #fee2e2;
  color: #991b1b;
}

.proposal-detail .status.cancelled {
  background: #e5e7eb;
  color: #374151;
}

.proposal-detail .proposal-description {
  margin: 20px 0;
  line-height: 1.6;
}

.proposal-detail .proposal-description strong {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-size: 16px;
}

.proposal-detail p {
  margin: 12px 0;
  color: #555;
  font-size: 15px;
}

.proposal-detail .btn-view-file {
  display: inline-block;
  padding: 8px 16px;
  background: #1d4ed8;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  transition: background 0.3s ease;
}

.proposal-detail .btn-view-file:hover {
  background: #2563eb;
}

.proposal-detail .btn-cancel {
  padding: 10px 20px;
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
  margin-top: 15px;
}

.proposal-detail .btn-cancel:hover {
  background: #b91c1c;
}

.proposal-detail .back-btn-container {
  margin-top: 30px;
  text-align: center;
}

.proposal-detail .btn-back {
  display: inline-block;
  padding: 10px 20px;
  background: #6b7280;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  transition: background 0.3s ease;
}

.proposal-detail .btn-back:hover {
  background: #4b5563;
}

.proposal-detail .error-msg {
  text-align: center;
  color: #dc2626;
  font-size: 16px;
  margin-top: 40px;
}

/* =================== MODAL CARD (Success/Error Layout) =================== */
.modal-card {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  max-width: 750px; /* Increased from 600px to 750px to make modal wider and less tall */
  margin: auto;
  max-height: 85vh; /* Increased from 80vh to 85vh for more content space */
  overflow-y: auto; /* Allow scrolling if content exceeds max-height */
}

.modal-success {
  color: #16a34a;
  margin-bottom: 15px;
  text-align: center;
}

.modal-body {
  display: grid;
  grid-template-columns: 140px 1fr; /* labels + values */
  gap: 8px 16px;
  /* Removed max-height and overflow-y from modal-body - let the modal-card handle scrolling */
}

.modal-row {
  display: contents; /* align children to grid */
}

/* Added styles for full-width description row */
.modal-row-full {
  display: grid;
  grid-column: 1 / -1; /* Span full width */
  grid-template-columns: 140px 1fr; /* Match parent grid structure */
  gap: 16px;
}

/* Added styles for description content with proper word wrapping */
.description-content {
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.6;
  color: #333;
}

/* Removed #truncatedDesc and .see-more-btn styles - no longer needed */

.modal-btn {
  margin-top: 20px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: white;
  cursor: pointer;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.modal-btn:hover {
  background: #1e40af;
}

.modal-link {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  background: #2563eb;
  color: white;
  text-decoration: none;
}

.modal-link:hover {
  background: #1e40af;
}

