/* New announcement layout styles */
.announcement-containerMain {
  padding-left: 0;
}

.announcement-header {
  margin-left: 100px;
  height: 55px;
}

.header-announcementcoj {
  font-size: 1.1rem;
  margin-left: 50px;
}

.announcement-list {
  background: white;
  border: 1px solid #e6e6e6;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.03);
  margin: 16px 12px 10px 12px; /* near-full width with small gutter */
  width: calc(100% - 24px);
  max-width: 100vw;
}

.announcement-list.add {
  background: white;
  border: 1px solid #e6e6e6;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.03);
  margin: 16px 12px 40px 12px;
  width: calc(100% - 24px);
  max-width: 100vw;
}

.announcement-item {
  padding: 12px 22px;
  display: flex;
  align-items: center;
}

.announcement-item.add {
  padding: 0;
  display: flex;
  align-items: center;
  border-bottom: none;
}

.announce-left {
  width: 110px;
  display: flex;
  flex-direction: row;
  align-items: center;
}
.announce-date {
  padding-left: 8px;
}
.announce-month {
  font-weight: 600;
}
.announce-year {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}
.dot {
  display: none;
}
.announce-title {
  font-size: 18px;
  margin: 0;
  color: #222;
}
.announce-subtitle {
  font-size: 13px;
  color: #666;
}
.announce-actions .kebab {
  color: #222;
  border: none;
  background: transparent;
  font-size: 18px;
  line-height: 1;
}
.announce-actions .chevron {
  color: #222;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
}
.add-new .btn-add-new {
  background: #efefef;
  color: #333;
  padding: 18px 36px;
  width: 100%;
  font-size: 18px;
  text-decoration: none;
  display: inline-block;
}
.pagination .page-link {
  color: #333;
  text-decoration: none;
}
.page-info {
  min-width: 70px;
  text-align: center;
}

.announcement-controls {
  margin-right: 12px;
}

.announcement-controls .btn {
  border: 1px solid #eaeaea;
}
.announcement-controls .dropdown-menu {
  min-width: 180px;
}

.kebab-menu {
  background: #fff;
  border: 1px solid #ccc;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  z-index: 1050;
}
.kebab-menu .dropdown-item {
  display: block;
  padding: 8px 12px;
  color: #333;
  text-decoration: none;
}
.kebab-menu .dropdown-item:hover {
  background: #f6f6f6;
}

.btn-add-new {
  background: #efefef;
  color: #333;
  border: none;
  padding: 18px 36px;
  width: 100%;
  font-size: 18px;
  text-decoration: none;
  display: inline-block;
}

/* Styles copied from student announcement-list to match visual layout */
.announcement-list {
  padding: 28px 48px;
}

.announcement-list .announcement-item {
  display: flex;
  align-items: flex-start;
  margin: 10px 0;
}

.announcement-list .announcement-item.add {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0;
}

.announcement-list .bullet-point {
  display: none;
}
.announcement-list .announcement-card {
  display: flex;
  align-items: center;
  width: 100%;
  background: #fff;
  border: 1px solid #e6e6e6;
  padding: 14px;
}
.announcement-list .date-section {
  width: 96px;
  text-align: center;
  padding: 6px;
}
.announcement-list .month-day {
  font-weight: 700;
}
.announcement-list .year {
  font-size: 12px;
  color: #999;
  margin-top: 6px;
}
.announcement-list .divider {
  width: 1px;
  height: 56px;
  background: #864e21;
  margin: 0 18px;
}

.announcement-list .content-section {
  flex: 1;
}
.announcement-list .announcement-title-text {
  margin: 0 0 6px 0;
  font-size: 18px;
}
.announcement-list .announcement-description {
  margin: 0;
  color: #666;
  font-size: 13px;
}
.nav-icon {
  margin-right: 20px;
  font-size: 1.2rem;
}

.dot3 {
  display: none;
}

.announcement-list .nav-icon {
  width: 40px;
  text-align: center;
  color: #999;
}
.announcement-list .add-new-card {
  background: #efefef;
  border: none;
}
.announcement-list .add-new-card .btn-add-new {
  width: 100%;
  padding: 18px 0;
  background: transparent;
  color: #222;
  font-size: 16px;
}

/* New grid layout for admin announcement cards */
.announcement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;
}
.announcement-card-grid {
  background: #fff;
  border: 1px solid #e6e6e6;
  padding: 14px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  min-height: 140px;
}
.announcement-card-grid.add-card-grid {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.announcement-card-grid.add-card-grid .card-actions a {
  margin-left: 6px;
}
.announcement-card-grid .card-top {
  margin-bottom: 10px;
}
.announcement-card-grid .date-block {
  text-align: left;
}
.announcement-card-grid .date-block .month-day {
  font-weight: 700;
}
.announcement-card-grid .card-actions a {
  font-size: 0.85rem;
}
.announcement-card-grid .card-body {
  flex: 1;
}
.announcement-card-grid .announcement-description {
  color: #555;
  font-size: 13px;
}

/* Add-card should fit into grid as well */
.announcement-list.add {
  margin-top: 12px;
}
.announcement-list.add .announcement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.announcement-list.add .add-new-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* Student-style pagination container */
.pagination-container {
  display: flex;
  justify-content: center;
  margin: 20px 0 50px 0;
}
.pagination-box {
  background: #fff;
  padding: 12px 22px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.06);
  display: inline-flex;
  align-items: center;
}
.pagination-box .nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: #fff;
  border: 1px solid #eee;
  color: #333;
  text-decoration: none;
}
.pagination-box .nav-btn-prev {
  background: #fff;
}
.pagination-box .nav-btn-next {
  background: #f6a24b;
  color: #fff;
  border: none;
}
.pagination-box .page-indicator {
  font-size: 14px;
  color: #e88d42;
  padding: 0 8px;
}

/* 10x16 grid styles */
.announcement-grid-section .grid-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center; /* center rows horizontally */
  margin-left: 57px;
}
.announcement-grid-section .grid-row {
  margin-bottom: 8px;
  width: 100%;
  max-width: 1200px; /* limit total width for centering */
  justify-content: center;
}
.announcement-grid-section .grid-cell {
  border: 1px solid #dcdcdc;
  min-height: 48px;
  background: #fff;
  color: #333;
  font-size: 0.85rem;
  user-select: none;
}
.announcement-grid-section .cell-label {
  font-size: 0.75rem;
  color: #666;
}

/* Small formatted date shown when a cell contains an announcement */
.announcement-grid-section .cell-date {
  font-size: 0.75rem;
  color: #6b6b6b;
  margin-top: 4px;
  display: inline-block;
  padding-left: 200px;
}

.announcement-grid-section .grid-cell .cell-preview {
  font-size: 0.85rem;
  color: #444;
}

.calendar-cell{
  margin-left: 100px;
}

/* Ensure a consistent aspect ratio on wider screens: make each cell roughly square by limiting width via flex-basis */
@media (min-width: 768px) {
  .announcement-grid-section .grid-cell {
    /* 10 columns with 8px gaps across the max-width (1200px) */
    flex: 0 0 calc((100% - 9 * 8px) / 10);
    max-width: calc((100% - 9 * 8px) / 10);
    aspect-ratio: 1 / 1;
  }
}

/* On very narrow screens, allow cells to wrap so they remain usable */
@media (max-width: 767.98px) {
  .announcement-grid-section .grid-row {
    flex-wrap: wrap;
  }
  .announcement-grid-section .grid-cell {
    flex: 0 0 calc(25% - 6px);
    max-width: calc(25% - 6px);
  }
}

/* Cell action (colon) button */
.announcement-grid-section .grid-cell .cell-actions {
  top: 6px;
  right: 6px;
}
.announcement-grid-section .grid-cell .btn-transparent {
  background: transparent;
  border: none;
  color: #333;
  font-weight: 600;
}
.announcement-grid-section .cell-colon {
  display: inline-block;
  font-size: 1.1rem;
  line-height: 1;
  padding: 2px 6px;
  color: #444;
}
.announcement-grid-section .dropdown-menu {
  min-width: 110px;
}

/* Button for adding announcement below grid */
.btn-add-announcement {
  padding: 10px 20px;
  font-weight: 600;
}

/* Prevent dropdown from overflowing the grid area by using auto-placement (bootstrap handles this) */
.announcement-grid-section .grid-cell { overflow: visible; }

/* Preview text inside each cell */
.announcement-grid-section .cell-preview {
  margin-top: 6px;
  padding: 6px 8px 8px 8px;
  color: #444;
  font-size: 0.8rem;
  text-align: center;
  max-width: 100%;
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3; /* show at most 3 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-wrap: break-word;
}

/* Highlight an updated cell briefly when returning from edit page */
.announcement-grid-section .highlight-updated {
  animation: highlightFlash 2.2s ease-in-out;
  box-shadow: 0 0 0 3px rgba(9,105,218,0.25) inset, 0 6px 18px rgba(9,105,218,0.18);
  border-color: #0969da;
}

@keyframes highlightFlash {
  0% { background-color: #f6f8fa; transform: scale(1); }
  10% { background-color: #ddf4ff; transform: scale(1.01); }
  40% { background-color: #b6e3ff; }
  80% { background-color: #ddf4ff; }
  100% { background-color: transparent; transform: scale(1); }
}

/* System-based calendar styles */
.admin-calendar-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-left: 130px;
  padding-right: 30px;
  padding-bottom: 75px;
}
.admin-calendar {
  width: 1300px;
  max-width: 1300px;
  /* Clean white system background */
  background: #ecd2b3;
  padding: 24px 28px 32px 28px;
  /* Modern subtle shadow */
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 12px rgba(0,0,0,0.04);
  border: 1px solid #e1e4e8;
  color: #24292f; /* System dark gray text */
}
.admin-calendar-header {
  display:flex;
  justify-content:center;
  align-items:center;
  margin-bottom:20px;
}
.cal-nav-btn{
  background: #f6f8fa;
  color: #57606a;
  border: 1px solid #d0d7de;
  width:52px;
  height:44px;
  cursor:pointer;
  transition: all 0.2s ease;
}
.cal-nav-btn:hover {
  background: #eaeef2;
  border-color: #b0b8c1;
}
.cal-title{
  background: transparent;
  padding-left: 20px;
  padding-right: 20px;
  font-weight:600;
  font-size: 1.25rem;
  color:#e88d42;
}
.cal-month-picker{ display:inline-flex; align-items:center; }
.cal-month-select{ background: #f6f8fa; color:#24292f; border: 1px solid #d0d7de; padding:6px 8px; transition: all 0.2s ease; }
.cal-month-select:hover{ background: #eaeef2; border-color: #b0b8c1; }
.cal-year-input{ width:86px; background: #f6f8fa; color:#24292f; border:1px solid #d0d7de; padding:6px 8px; transition: all 0.2s ease; }
.cal-year-input:hover{ border-color: #b0b8c1; }
.cal-year-input:focus{ outline: 2px solid #0969da; outline-offset: 2px; border-color: #0969da; }
.cal-go{ background:#0969da; color:#fff; border:1px solid #0550ae; padding:8px 12px; cursor:pointer; min-width:56px; transition: all 0.2s ease; }
.cal-go:hover{ background:#0860ca; }
.cal-grid{
  display:flex;
  flex-direction:column;
}
/* container for all day cells - allow absolute spans to be positioned relative to this */
.cal-days { 
  position: relative; 
  overflow: visible;
  display: flex;
  flex-direction: column;
}
.cal-weekdays{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  color:#000000;
  font-weight:600;
  font-size: 0.875rem;
  padding:0;
  margin-bottom: 8px;
  text-align: center;
}
.cal-row{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap: 0; /* Remove gaps between cells */
  padding-bottom: 0;
  overflow: visible;
  position: relative;
  z-index: 1; /* allow spanning items to layer properly */
}
.cal-cell{
  position: relative; /* allow absolute children like .cell-number to anchor to this cell */
  min-height:72px;
  /* Clean system background */
  background: #ffffff;
  padding:8px;
  /* Add borders back */
  border: 1px solid #ecd2b3;
  box-shadow: none;
  overflow: visible;
  transition: all 0.2s ease;
}
.cal-cell:hover {
  /* Keep borders on hover */
  border: 1px solid #b0b8c1;
  box-shadow: none;
}
.cal-cell .cell-number{
  position: absolute; /* pin inside the .cal-cell */
  top: 6px;
  left: 6px;
  width:28px;
  height:28px; /* make it a circular small badge */
  background: transparent;
  color:#24292f; /* System dark text */
  font-weight:600;
  font-size: 0.875rem;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* Peek/preview numbers for other-month cells (faint/ghost style) */
.cal-cell.other-month {
  background: #f6f8fa;
  border: 1px solid #d0d7de;
}
.cal-cell.other-month .cell-number.peek {
  color: #8c959f;
  font-weight:500;
  background: transparent;
}

/* Make next-month preview subtly different */
.cal-cell.next-month {
  position: relative;
}
.cal-cell.next-month .cell-number.peek::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 6px;
  width: 26px;
  height: 26px;
  background: rgba(0,0,0,0.02);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  z-index: 0;
}

.cal-cell .cell-items{ /* allow multiple cal-items to stack vertically inside a cell */
  display: flex;
  flex-direction: column;
  gap: 2px; /* small gap between stacked announcements */
  align-items: stretch; /* keep cal-item width unchanged while allowing vertical stacking */
  padding-top: 36px; /* leave space for the absolute .cell-number */
  width: 100%; /* allow items to fill the cell width */
  box-sizing: border-box;
  overflow: visible;
  position: relative;
}
.cal-cell{
  /* allow the cell to grow vertically to contain multiple stacked items */
  min-height: 100px;
  height: auto;
  /* Ensure cell can expand to accommodate multiple announcements */
  transition: min-height 0.2s ease;
}

/* Style announcement summary inside cell as an inline button */
.cal-item {
  display: block;
  background: transparent;
  border: none;
  color: #000;
  padding: 4px 6px; /* reduced vertical padding for better stacking */
  cursor: pointer;
  font-size: 0.85rem;
  text-align: left;
  box-sizing: border-box;
  /* Ensure proper stacking behavior */
  margin-bottom: 1px;
  flex-shrink: 0; /* prevent items from shrinking */
}
.cal-item:focus {
  outline: 2px solid #0969da;
  outline-offset: 2px;
}


/* New styles: show title + description inside cell with gradient fade when overflow */
.cal-item .cal-title { 
  font-weight: 600; 
  font-size: 0.85rem; 
  color: #24292f; 
  margin: 0;
  padding: 0;
  line-height: 1.2;
}
/* ensure long titles wrap or truncate neatly within the cell */
.cal-item .cal-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; /* limit to two lines */
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-break: break-word;
}
.cal-item .cal-desc { font-size: 0.78rem; color: #57606a; line-height: 1.1; max-height: calc(1.1rem * 3); overflow: hidden; position: relative; }

/* fade gradient to indicate overflow */
.cal-item .cal-desc::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1.6em; /* overlap last ~1.6 lines */
  background: linear-gradient(to bottom, rgba(246,248,250,0), rgba(246,248,250,1));
  pointer-events: none;
  transition: opacity 220ms ease;
}

/* Archived announcement visual: make cal-inner appear red/muted and remove pointer affordance */
.cal-inner.archived {
  background: #ffebe9; /* System light red */
  border: 1px solid#cf222e !important; /* Red border for hidden announcements - thicker and more prominent */
  box-shadow: 0 0 0 1px #cf222e, 0 2px 4px rgba(207, 34, 46, 0.2); /* Add subtle red glow */
  color: #cf222e;
}
.cal-inner.archived .cal-title { color: #cf222e; }
.cal-inner.archived { cursor: default; opacity: 0.85; }

/* Solid red styling for archived spanning announcements */
.cal-inner.archived.spanning {
  background: #cf222e !important; /* Solid red background */
  border: 1px solid #cf222e !important; /* Red border */
  color: #ffffff !important; /* White text for contrast */
  box-shadow: 0 2px 4px rgba(207, 34, 46, 0.3); /* Stronger red shadow */
  opacity: 1 !important; /* Ensure full opacity for solid red effect */
}

.cal-inner.archived.spanning .cal-title { 
  color: #ffffff !important; /* White text for contrast */
}

/* Override any color classes for archived spanning announcements */
.cal-inner.archived.spanning.announcement-color-blue,
.cal-inner.archived.spanning.announcement-color-green,
.cal-inner.archived.spanning.announcement-color-yellow,
.cal-inner.archived.spanning.announcement-color-orange,
.cal-inner.archived.spanning.announcement-color-purple,
.cal-inner.archived.spanning.announcement-color-pink,
.cal-inner.archived.spanning.announcement-color-teal,
.cal-inner.archived.spanning.announcement-color-indigo {
  background: #cf222e !important;
  border: 1px solid #cf222e !important;
  color: #ffffff !important;
}

.cal-inner.archived.spanning.announcement-color-blue .cal-title,
.cal-inner.archived.spanning.announcement-color-green .cal-title,
.cal-inner.archived.spanning.announcement-color-yellow .cal-title,
.cal-inner.archived.spanning.announcement-color-orange .cal-title,
.cal-inner.archived.spanning.announcement-color-purple .cal-title,
.cal-inner.archived.spanning.announcement-color-pink .cal-title,
.cal-inner.archived.spanning.announcement-color-teal .cal-title,
.cal-inner.archived.spanning.announcement-color-indigo .cal-title {
  color: #ffffff !important;
}

/* Hover effect for archived spanning announcements */
.cal-inner.archived.spanning:hover {
  background: #b91c1c !important; /* Darker red on hover */
  border-color: #b91c1c !important;
  box-shadow: 0 4px 8px rgba(207, 34, 46, 0.4) !important;
}

/* inner clickable container with subtle shadow to indicate clickability */
.cal-item .cal-inner {
  background: #f6f8fa; /* System light gray background */
  border: 3px solid #d0d7de;
  box-shadow: 0px 1px 3px rgba(0,0,0,0.05);
  transition: all 180ms ease;
  cursor: pointer;
  box-sizing: border-box;
  /* make inner element stretch across the full cell width */
  width: 100%;
  margin: 0;
  /* remove fixed height so multiple items can expand the cell vertically */
  height: auto;
  min-height: 32px; /* Ensure minimum height for consistency */
  /* Better stacking visual separation */
  border-radius: 4px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  position: relative;
  /* Ensure it stretches across the full cell */
  left: 0;
  right: 0;
}

/* Enhanced stacking styles for multiple announcements */
.cal-item:nth-child(2) .cal-inner {
  background: #f0f7ff; /* Slightly different background for second item */
  border-color: #b3d9ff;
}

.cal-item:nth-child(3) .cal-inner {
  background: #f8f9fa; /* Third item gets different styling */
  border-color: #e1e4e8;
}

.cal-item:nth-child(4) .cal-inner {
  background: #fff5f5; /* Fourth item gets subtle red tint */
  border-color: #fecaca;
}

/* Show a subtle indicator when there are more than 3 announcements */
.cal-cell:has(.cal-item:nth-child(4))::after {
  content: '+';
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: #0969da;
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  z-index: 20;
}
/* Hover affordance: make cal-item visibly clickable (non-archived only) */
.cal-item:not(:disabled):hover,
.cal-item:not(.archived):hover {
  cursor: pointer; /* explicit pointer */
}
.cal-item:not(.archived) .cal-inner:hover {
  background: #eaeef2;
  border-color: #b0b8c1;
  box-shadow: 0 3px 6px rgba(0,0,0,0.08);
}
.cal-item:not(.archived):active .cal-inner {
  background: #e88d42;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}





/* when we detect server-side truncation, make the cell taller and soft-shadow the right/bottom to indicate hidden text */
.cal-cell.has-trunc { min-height: 120px; padding-bottom: 12px; }
.cal-cell.has-trunc .cal-desc { max-height: calc(1.1rem * 4.5); }
.cal-cell.has-trunc .cal-desc::after { opacity: 1; }

/* if not truncated, hide the fade */
.cal-cell:not(.has-trunc) .cal-desc::after { opacity: 0; }

/* allow the cell to expand on hover to reveal more text (smooth) */
.cal-cell.has-trunc { transition: all 200ms ease; }
/* Prevent hover from expanding the cell or adding a heavy shadow so hidden text isn't revealed on pointer */
.cal-cell.has-trunc:hover {
  /* keep the same baseline min-height and subtle shadow as the non-hover state */
  min-height: 120px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}
.cal-cell.has-trunc:hover .cal-desc {
  /* keep truncated max-height even on hover */
  max-height: calc(1.1rem * 4.5);
}

/* ensure other-month preview styling remains for prev/next */
.cal-cell.other-month .cal-item { opacity: 0.7; }
.cal-footer{display:flex;justify-content:center;margin-top:18px}
.cal-today{background:#0969da;color:#fff;border:1px solid #0550ae;padding:8px 14px;border-radius:6px;cursor:pointer;transition: all 0.2s ease;}
.cal-today:hover{background:#0860ca;border-color:#0550ae;}

.leftBtn,
.rightBtn {
  background: #f6a24b;
  color: black;
  border: 1px solid #e88d42;
  border-radius: 6px;
  padding: 8px 10px; /* increase clickable area */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.leftBtn:hover,
.rightBtn:hover {
  background: #e88d42;
  border-color: #d67c2a;
  color: black;
}

/* Ensure the Bootstrap icon inherits the intended color and is larger for visibility */
.leftBtn .bi,
.rightBtn .bi {
  color: inherit;
  font-size: 1.4rem; /* larger icon size */
  line-height: 1;
}

/* Slightly increase spacing around the month label when icons are present */
.cal-current { padding: 0 12px; }

/* center calendar on very wide screens */
@media (min-width: 1400px){
  .admin-calendar{ width:1200px }
}

@media (max-width: 768px){
  .admin-calendar{ width: calc(100% - 40px); padding: 16px }
  .cal-cell{ min-height:60px }
}

/* Highlight for today's date */
.cal-cell.is-today {
  background-color: #fff4e6; /* Light orange background */
  border: none;
  box-shadow: none;
}

/* Make sure the cell-number for today contrasts well */
.cal-cell.is-today .cell-number {
  color: #ffffff;
  background: #ff8800;
  border-radius: 4px;
}


/* Responsive adjustments: smaller highlight on narrow screens */
@media (max-width: 480px) {
  .cal-cell.is-today { box-shadow: none; border: none; }
  .cal-cell.is-today .cell-number { width:22px; height:22px; top:6px; left:6px; }
  
  /* Better stacking on mobile */
  .cal-item {
    padding: 2px 4px;
    font-size: 0.75rem;
  }
  
  .cal-item .cal-inner {
    padding: 4px 6px;
  }
  
  .cal-cell .cell-items {
    gap: 1px;
  }
}

/* Enhanced stacking behavior for cells with multiple announcements */
.cal-cell.has-multiple-announcements {
  min-height: 120px;
}

.cal-cell.has-multiple-announcements .cell-items {
  padding-top: 40px; /* more space for cell number */
}

/* Ensure proper spacing between stacked announcements */
.cal-cell.has-multiple-announcements .cal-item {
  margin-bottom: 2px;
}

.cal-cell.has-multiple-announcements .cal-item:last-child {
  margin-bottom: 0;
}

/* Smooth animation when announcements are added */
.cal-item {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dynamic color system for announcements - now using custom colors from database */
.announcement-color-blue .cal-inner {
  background: #e3f2fd !important;
  border: 3px solid #2196f3 !important;
  border-left: 5px solid #2196f3 !important;
}

.announcement-color-blue .cal-title {
  color: #1976d2 !important;
}

.announcement-color-green .cal-inner {
  background: #e8f5e8 !important;
  border: 3px solid #4caf50 !important;
  border-left: 5px solid #4caf50 !important;
}

.announcement-color-green .cal-title {
  color: #388e3c !important;
}

.announcement-color-yellow .cal-inner {
  background: #fffde7 !important;
  border: 3px solid #ffeb3b !important;
  border-left: 5px solid #ffeb3b !important;
}

.announcement-color-yellow .cal-title {
  color: #f57f17 !important;
}

.announcement-color-orange .cal-inner {
  background: #fff3e0 !important;
  border: 3px solid #ff9800 !important;
  border-left: 5px solid #ff9800 !important;
}

.announcement-color-orange .cal-title {
  color: #f57c00 !important;
}

.announcement-color-purple .cal-inner {
  background: #f3e5f5 !important;
  border: 3px solid #9c27b0 !important;
  border-left: 5px solid #9c27b0 !important;
}

.announcement-color-purple .cal-title {
  color: #7b1fa2 !important;
}

.announcement-color-pink .cal-inner {
  background: #fce4ec !important;
  border: 3px solid #e91e63 !important;
  border-left: 5px solid #e91e63 !important;
}

.announcement-color-pink .cal-title {
  color: #c2185b !important;
}

/* Custom color support for announcements */
.announcement-color-custom .cal-inner {
  background: var(--custom-bg, #e3f2fd) !important;
  border: var(--custom-border, 3px solid #2196f3) !important;
  border-left: var(--custom-border-left, 5px solid #2196f3) !important;
}

.announcement-color-custom .cal-title {
  color: var(--custom-text, #1976d2) !important;
}

.announcement-color-custom .cal-category {
  color: var(--custom-text, #1976d2) !important;
}

/* Special handling for spanning announcements with custom colors */
.announcement-color-custom .cal-inner.spanning {
  background: var(--custom-bg, #e3f2fd) !important;
  border: var(--custom-border, 4px solid #2196f3) !important;
  border-left: var(--custom-border-left, 8px solid #2196f3) !important;
  border-radius: 4px !important;
  position: relative !important;
  z-index: 10 !important;
}

.announcement-color-custom .cal-inner.span-continuation-bar {
  background: var(--custom-bg, rgba(33, 150, 243, 0.05)) !important;
  border: var(--custom-border, 4px solid #2196f3) !important;
  border-left: var(--custom-border-left, 8px solid #2196f3) !important;
  border-radius: 0 4px 4px 0 !important;
}

.announcement-color-teal .cal-inner {
  background: #e0f2f1 !important;
  border: 3px solid #009688 !important;
  border-left: 5px solid #009688 !important;
}

.announcement-color-teal .cal-title {
  color: #00695c !important;
}

.announcement-color-indigo .cal-inner {
  background: #e8eaf6 !important;
  border: 3px solid #3f51b5 !important;
  border-left: 5px solid #3f51b5 !important;
}

.announcement-color-indigo .cal-title {
  color: #303f9f !important;
}

/* Custom color class for database-stored colors */
.announcement-color-custom .cal-inner {
  background: var(--custom-bg, #e3f2fd) !important;
  border: var(--custom-border, 1px solid #2196f3) !important;
  border-left: var(--custom-border-left, 3px solid #2196f3) !important;
  transition: all 0.3s ease;
}

/* Enhanced color transitions for better visual feedback */
.cal-item[data-color] {
  transition: all 0.3s ease;
}

.cal-item[data-color] .cal-inner {
  transition: all 0.3s ease;
}

.cal-item[data-color] .cal-title {
  transition: color 0.3s ease;
}

.cal-item[data-color] .cal-category {
  transition: color 0.3s ease;
}

.announcement-color-custom .cal-title {
  color: var(--custom-text, #1976d2) !important;
  font-weight: 500 !important;
}

/* Ensure custom colors override any existing styles */
.cal-item[data-color] .cal-inner {
  transition: all 0.3s ease;
}

.cal-item[data-color] .cal-title {
  transition: color 0.3s ease;
}

.cal-item[data-color] .cal-category {
  transition: color 0.3s ease;
}

.announcement-color-custom .cal-category {
  color: var(--custom-text, #1976d2) !important;
  font-size: 0.75em !important;
  opacity: 0.8 !important;
  font-weight: 500 !important;
}

/* Ensure custom colors override default styles */
.announcement-color-custom .cal-inner.spanning {
  /* Spanning announcements with custom colors */
  transition: all 0.2s ease;
}

.announcement-color-custom .cal-inner.span-continuation-bar {
  /* Continuation bars with custom colors */
  transition: all 0.2s ease;
}

/* Hover effects for custom colored announcements */
.announcement-color-custom .cal-inner:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Category styling for custom colors */
.announcement-color-custom .cal-category {
  font-size: 0.75em;
  opacity: 0.8;
  margin-top: 2px;
  font-weight: 500;
}

/* Spanning announcement styles with custom colors */
.announcement-color-custom .cal-inner.spanning {
  position: relative;
  z-index: 10;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.announcement-color-custom .cal-inner.spanning:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Continuation bar styles for spanning announcements */
.announcement-color-custom .cal-inner.span-continuation-bar {
  position: relative;
  z-index: 5;
  border-radius: 0 4px 4px 0;
  transition: all 0.2s ease;
}

.announcement-color-custom .cal-inner.span-continuation-bar:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* Category display styles */
.cal-category {
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 2px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(0,0,0,0.05);
  color: #666;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Hover effects for colored announcements */
.announcement-color-blue .cal-inner:hover {
  background: #bbdefb !important;
  border-color: #1976d2 !important;
}

.announcement-color-green .cal-inner:hover {
  background: #c8e6c9 !important;
  border-color: #388e3c !important;
}

.announcement-color-yellow .cal-inner:hover {
  background: #fff9c4 !important;
  border-color: #f57f17 !important;
}

.announcement-color-orange .cal-inner:hover {
  background: #ffe0b2 !important;
  border-color: #f57c00 !important;
}

.announcement-color-purple .cal-inner:hover {
  background: #e1bee7 !important;
  border-color: #7b1fa2 !important;
}

.announcement-color-pink .cal-inner:hover {
  background: #f8bbd9 !important;
  border-color: #c2185b !important;
}

.announcement-color-teal .cal-inner:hover {
  background: #b2dfdb !important;
  border-color: #00695c !important;
}

.announcement-color-indigo .cal-inner:hover {
  background: #c5cae9 !important;
  border-color: #303f9f !important;
}

/* Spanning announcement colors */
.announcement-color-blue.spanning .cal-inner {
  background: #e3f2fd !important;
  border: 4px solid #2196f3 !important;
  border-left: 8px solid #2196f3 !important;
}

.announcement-color-green.spanning .cal-inner {
  background: #e8f5e8 !important;
  border: 4px solid #4caf50 !important;
  border-left: 8px solid #4caf50 !important;
}

.announcement-color-yellow.spanning .cal-inner {
  background: #fffde7 !important;
  border: 4px solid #ffeb3b !important;
  border-left: 8px solid #ffeb3b !important;
}

.announcement-color-orange.spanning .cal-inner {
  background: #fff3e0 !important;
  border: 4px solid #ff9800 !important;
  border-left: 8px solid #ff9800 !important;
}

.announcement-color-purple.spanning .cal-inner {
  background: #f3e5f5 !important;
  border: 4px solid #9c27b0 !important;
  border-left: 8px solid #9c27b0 !important;
}

.announcement-color-pink.spanning .cal-inner {
  background: #fce4ec !important;
  border: 4px solid #e91e63 !important;
  border-left: 8px solid #e91e63 !important;
}

.announcement-color-teal.spanning .cal-inner {
  background: #e0f2f1 !important;
  border: 4px solid #009688 !important;
  border-left: 8px solid #009688 !important;
}

.announcement-color-indigo.spanning .cal-inner {
  background: #e8eaf6 !important;
  border: 4px solid #3f51b5 !important;
  border-left: 8px solid #3f51b5 !important;
}

/* Category-based color system for announcements */
.category-announcement {
  background: #ffebee !important;
  border: 3px solid #f44336 !important;
  border-left: 5px solid #f44336 !important;
}

.category-announcement .cal-title {
  color: #d32f2f !important;
}

.category-announcement:hover {
  background: #ffcdd2 !important;
  border-color: #d32f2f !important;
}

.category-reminder {
  background: #e3f2fd !important;
  border: 3px solid #2196f3 !important;
  border-left: 5px solid #2196f3 !important;
}

.category-reminder .cal-title {
  color: #1976d2 !important;
}

.category-reminder:hover {
  background: #bbdefb !important;
  border-color: #1976d2 !important;
}

/* Spanning announcements with category colors */
.category-announcement.spanning {
  background: #ffebee !important;
  border: 4px solid #f44336 !important;
  border-left: 8px solid #f44336 !important;
}

.category-reminder.spanning {
  background: #e3f2fd !important;
  border: 4px solid #2196f3 !important;
  border-left: 8px solid #2196f3 !important;
}

/* Continuation bars for spanning announcements */
.category-announcement.span-continuation-bar {
  background: rgba(244, 67, 54, 0.1) !important;
  border: 4px solid #f44336 !important;
  border-left: 8px solid #f44336 !important;
  border-radius: 0 4px 4px 0 !important;
}

.category-reminder.span-continuation-bar {
  background: rgba(33, 150, 243, 0.1) !important;
  border: 4px solid #2196f3 !important;
  border-left: 8px solid #2196f3 !important;
  border-radius: 0 4px 4px 0 !important;
}

/* Spanning announcement base styles with category colors */
.cal-inner.spanning.category-announcement {
  background: #ffebee !important;
  border: 4px solid #f44336 !important;
  border-left: 8px solid #f44336 !important;
  border-radius: 4px !important;
  position: relative !important;
  z-index: 10 !important;
}

.cal-inner.spanning.category-reminder {
  background: #e3f2fd !important;
  border: 4px solid #2196f3 !important;
  border-left: 8px solid #2196f3 !important;
  border-radius: 4px !important;
  position: relative !important;
  z-index: 10 !important;
}

/* Spanning continuation bars with category colors */
.cal-inner.span-continuation-bar.category-announcement {
  background: rgba(244, 67, 54, 0.1) !important;
  border: 4px solid #f44336 !important;
  border-left: 8px solid #f44336 !important;
  border-radius: 0 4px 4px 0 !important;
  position: relative !important;
  z-index: 5 !important;
}

.cal-inner.span-continuation-bar.category-reminder {
  background: rgba(33, 150, 243, 0.1) !important;
  border: 4px solid #2196f3 !important;
  border-left: 8px solid #2196f3 !important;
  border-radius: 0 4px 4px 0 !important;
  position: relative !important;
  z-index: 5 !important;
}

/* Spanning announcements with category-based colors */
.cal-inner.spanning.category-announcement {
  background: #ffebee !important;
  border: 4px solid #f44336 !important;
  border-left: 8px solid #f44336 !important;
  border-radius: 4px !important;
  position: relative !important;
  z-index: 10 !important;
}

.cal-inner.spanning.category-reminder {
  background: #e3f2fd !important;
  border: 4px solid #2196f3 !important;
  border-left: 8px solid #2196f3 !important;
  border-radius: 4px !important;
  position: relative !important;
  z-index: 10 !important;
}

/* Title colors for spanning announcements with categories */
.cal-inner.spanning.category-announcement .cal-title {
  color: #d32f2f !important;
}

.cal-inner.spanning.category-reminder .cal-title {
  color: #1976d2 !important;
}

/* Hover effects for spanning announcements with categories */
.cal-inner.spanning.category-announcement:hover {
  background: #ffcdd2 !important;
  border-color: #d32f2f !important;
  box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3) !important;
}

.cal-inner.spanning.category-reminder:hover {
  background: #bbdefb !important;
  border-color: #1976d2 !important;
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3) !important;
}