/* Overall dashboard container */
.dashboard-container,
.public-dashboard-header {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  width: 100%;
  padding-bottom: 10px;
}

.public-dashboard-header h1 {
  text-align: center;
  grid-column: 2;
  margin: 0;
}

.public-dashboard-header a {
  justify-self: end; /* Aligns the button to the right */
  grid-column: 3;
}

.public-dashboard-header button {
  background-color: var(--org-primary-color, #01535b);
  color: #fff;
  width: auto; /* Adjust width if necessary */
  padding: 10px 20px; /* Add some padding for better visuals */
  border: none; /* Optional: remove border */
  border-radius: 5px; /* Optional: make corners rounded */
  cursor: pointer; /* Add pointer cursor for better UX */
  transition: background-color 0.2s ease;
}

.public-dashboard-header button:hover {
  background-color: var(--org-primary-hover, #014a51);
}

/* Center the dashboard heading */
#orgDashboardSection h1 {
  text-align: center;
  margin-bottom: 20px;
}

/* Flexbox layout for the main sections in the orgDashboardSection */
#orgDashboardSection {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Two rows of containers: top row has two columns (classes and school year info), and the bottom row has two columns (events and announcements) */
.dashboard-grid {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  width: 100%;
  max-width: 1200px;
  gap: 20px;
}

/* Each grid row should be a flex container with two equal parts */
.grid-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

/* Individual section containers with equal flex space */
.classes-container,
.school-year-info,
.events-container,
.announcements-container {
  flex: 1;
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  min-width: 250px;
}

/* Ensure there’s some space between two items in each row */
.grid-row > div {
  margin: 10px;
}

/* Center alignment for event and announcement titles */
.events-container h2,
.announcements-container h2 {
  text-align: center;
}

/* List styles for events, classes, announcements */
ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

li {
  margin-bottom: 10px;
  text-align: left;
}

/* Center the Classes header */
.classes-container h2 {
  text-align: center;
}

/* Keep the rest of the class list aligned as they are */
.classes-container ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.classes-container li {
  margin-bottom: 0;
  padding: 0;
  text-align: left; /* Keep the list items left-aligned */
}

.class-item {
  position: relative;
  display: block;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
}

.class-item:last-child {
  border-bottom: none;
}

.class-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
  flex-shrink: 0;
}

.class-header a,
.class-header b {
  white-space: nowrap;
}

.teacher-toggle {
  flex: 0 0 auto;
}

.teacher-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 6px;
  padding: 4px;
  border-radius: 50%;
  background: var(--org-primary-color, #01535b);
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  vertical-align: middle;
}

.teacher-toggle:hover {
  background: var(--org-primary-hover, #014a51);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.toggle-arrow {
  transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  color: #fff;
  stroke: #fff;
  display: block;
}

.toggle-arrow.expanded {
  transform: rotate(90deg);
}

.teachers-list {
  margin-top: 8px;
  margin-left: 28px;
  padding-left: 16px;
  border-left: 3px solid var(--org-primary-color, #01535b);
  padding-top: 6px;
  padding-bottom: 6px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
}

.teachers-list.show {
  max-height: 500px;
  opacity: 1;
}

.teacher-entry {
  padding: 6px 8px;
  font-size: 0.95em;
  color: #333;
  background: #f5f5f5;
  margin-bottom: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  transform: translateX(-10px);
  opacity: 0;
  animation: slideInTeacher 0.3s ease forwards;
}

.teacher-entry:nth-child(1) { animation-delay: 0.05s; }
.teacher-entry:nth-child(2) { animation-delay: 0.1s; }
.teacher-entry:nth-child(3) { animation-delay: 0.15s; }
.teacher-entry:nth-child(4) { animation-delay: 0.2s; }
.teacher-entry:nth-child(5) { animation-delay: 0.25s; }

.teacher-entry:hover {
  background: #e8e8e8;
  transform: translateX(3px);
}

@keyframes slideInTeacher {
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Event and Announcement items styling */
.event-item,
.announcement-item {
  margin-bottom: 8px;
  padding: 12px;
  background: #ffffff;
  border-radius: 6px;
  border-bottom: 1px solid #e5e7eb;
  transition: all 0.2s ease;
  position: relative;
}

.event-item:hover,
.announcement-item:hover {
  background: #f9fafb;
  border-bottom-color: #d1d5db;
}

.event-item.expanded,
.announcement-item.expanded {
  background: #f0f9ff;
  border-bottom-color: var(--org-primary-color, #01535b);
  box-shadow: 0 2px 8px rgba(1, 83, 91, 0.1);
}

.event-item::after,
.announcement-item::after {
  content: 'tap to expand';
  position: absolute;
  right: 48px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7em;
  color: #9ca3af;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.event-item:hover::after,
.announcement-item:hover::after {
  opacity: 1;
}

.event-item.expanded::after,
.announcement-item.expanded::after {
  display: none;
}

.announcement-divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 12px 0 0 0;
}

.event-header,
.announcement-header {
  cursor: pointer;
}

.event-title-row,
.announcement-preview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.event-title-row strong {
  color: var(--org-primary-color, #01535b);
  font-size: 1.05em;
}

.event-preview,
.announcement-preview {
  color: #6b7280;
  font-size: 0.9em;
  margin-top: 4px;
  line-height: 1.4;
}

.event-toggle,
.announcement-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  background: var(--org-primary-color, #01535b);
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.event-toggle:hover,
.announcement-toggle:hover {
  background: var(--org-primary-hover, #014a51);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.event-details,
.announcement-full {
  margin-top: 8px;
  padding: 12px;
  padding-left: 16px;
  border-left: 3px solid var(--org-primary-color, #01535b);
  background: color-mix(in srgb, var(--org-primary-color, #01535b) 5%, white);
  border-radius: 4px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  color: #374151;
  line-height: 1.6;
  font-size: 0.95em;
}

.event-details.show,
.announcement-full.show {
  max-height: 1000px;
  opacity: 1;
}

.event-divider,
.announcement-divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 12px 0 0 0;
}

/* Optional: Styling for employees and other class details */
.on-hold {
  color: red;
  font-size: 1.2em;
}

.main {
  color: green;
  font-size: 1.2em;
}

/* Welcome card layout */
.welcome-page-wrapper {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 40px 20px !important;
  min-height: 50vh !important;
  width: 100% !important;
}

/* Large screen: add right offset to tools */
@media screen and (min-width: 992px) {
  #tools {
    right: 45px;
  }
}

/* Small screen: adjust padding for welcome page */
@media screen and (max-width: 768px) {
  .welcome-page-wrapper {
    padding: 20px 10px !important;
  }
}

.org-welcome-card {
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: 32px;
  text-align: center;
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.admin-flash-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 700px;
}

.admin-flash {
  background: #003640;
  color: white;
  padding: 14px 20px;
  border-left: 5px solid #f39c12;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.3s ease-in;
  border-radius: 4px;
}

.admin-flash-text {
  flex-grow: 1;
}

.announcement-title {
  display: block;
  font-weight: bold !important;
  font-size: 16px !important;
  margin-bottom: 6px;
  color: #ffffff !important;
}


.announcement-description {
  font-size: 14px;
  color: #ecf0f1;
  line-height: 1.4;
}

.admin-flash .close-btn {
  background: none;
  border: none;
  color: #ecf0f1;
  font-size: 18px;
  cursor: pointer;
  margin-left: 12px;
}


.org-welcome-card h1 {
  font-size: 2.25em;
  color: #333;
  margin-bottom: 12px;
}

.org-welcome-card p {
  font-size: 1.15em;
  color: #555;
  margin-bottom: 12px;
}

.text-link {
  color: var(--org-primary-color);
  text-decoration: underline;
  font-weight: 600;
}

.text-link:hover {
  color: var(--org-primary-hover);
}

.start-link {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 22px;
  background-color: transparent;
  color: var(--org-primary-color);
  text-decoration: underline;
  border-radius: 6px;
  font-weight: 700;
  transition: color 0.2s ease;
}

.start-link:hover {
  color: var(--org-primary-hover);
  text-decoration: underline;
}

/* Horizontal line divider */
.line-divider {
  width: 100%;
  border-top: 2px solid #ddd;
  margin: 20px 0;
}

/* Dashboard button styles */
.dashboard-buttons {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.dashboard-buttons button {
  text-align: center;
  white-space: nowrap;
}

.dashboard-buttons button {
  background-color: var(--org-primary-color);
  color: white;
  padding: 10px 20px;
  margin: 0 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.dashboard-buttons button.active {
  background-color: var(--org-primary-color);
}

.dashboard-buttons button:hover {
  background-color: var(--org-primary-hover);
}
/* Current School Year section styling */
.school-year-info {
  flex: 1;
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  text-align: center; /* Center all text and items */
  min-width: 250px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.school-year-info h2 {
  margin-bottom: 10px;
}

.school-year-info div {
  margin-bottom: 10px;
}

/* Align days until end in the same centered style */
#daysUntilEnd {
  font-weight: bold;
}

/* Mobile view: make grid-row elements stack vertically */
@media screen and (max-width: 768px) {
  main {
    padding: 0 !important;
  }

  /* Stack dashboard header elements */
  .public-dashboard-header {
    grid-template-columns: 1fr;
    text-align: center;
    row-gap: 10px;
  }

  .public-dashboard-header h1 {
    grid-column: auto;
    font-size: 1.4rem;
  }

  .public-dashboard-header a {
    grid-column: auto;
    justify-self: center;
  }

  /* Stack all dashboard blocks vertically on mobile only */
  .dashboard-grid {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 0 10px;
  }

  .grid-row {
    flex-direction: column;
    gap: 16px;
  }

  .grid-row > div {
    margin: 0;
    width: 100%;
  }

  .classes-container,
  .school-year-info,
  .events-container,
  .announcements-container {
    padding: 16px;
    min-width: unset;
  }

  .school-year-info h2 {
    font-size: 1.1rem;
  }

  .school-year-info div,
  .announcement-description,
  .classes-container li {
    font-size: 0.9rem;
  }

  .classes-container h2,
  .events-container h2,
  .announcements-container h2 {
    font-size: 1.2rem;
  }

  .admin-flash-container {
    max-width: 90%;
    left: 5%;
  }

  .admin-flash {
    padding: 10px 14px;
  }

  .announcement-title {
    font-size: 13px !important;
  }

  .announcement-description {
    font-size: 12px;
  }

  #orgDashboardSection h1 {
    font-size: 1.5rem;
    margin-bottom: 16px;
  }
  .dashboard-buttons-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 0 6px;
  }

  .dashboard-buttons {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    width: 100%;
    gap: 12px;
  }

  .dashboard-buttons button {
    max-width: 44%;
    font-size: 0.8rem;
  }
}

/* Medium and large screens: keep side-by-side layout */
@media screen and (min-width: 769px) {
  .dashboard-buttons {
    display: flex;
    flex-direction: row;
    gap: 12px;
  }

  .grid-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
  }
}
