/**
 * Academic Calendar Styles
 * Clean, modern horizontal calendar display
 */

/* ===== Header Section ===== */
.academic-calendar-full .calendar-header-section {
  margin-bottom: 20px;
}

.academic-calendar-full .calendar-header-top {
  padding: 15px 0;
}

.academic-calendar-full .institute-name-hindi {
  font-size: 1.1rem;
  color: #444;
  font-weight: 500;
}

.academic-calendar-full .institute-name-english {
  font-size: 0.95rem;
  color: #666;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.academic-calendar-full .calendar-title-main {
  font-size: 1.4rem;
  font-weight: 600;
  color: #e87722;
  margin-top: 10px;
}

/* ===== Legend - Compact Inline ===== */
.calendar-legend-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 6px;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  background: #fff;
  border: 1px solid #ddd;
}

.legend-chip .chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
}

.legend-chip.holiday { border-color: #dc3545; color: #dc3545; }
.legend-chip.holiday .chip-dot { background: #dc3545; }

.legend-chip.exam { border-color: #fd7e14; color: #b35900; }
.legend-chip.exam .chip-dot { background: #fd7e14; }

.legend-chip.instruction { border-color: #28a745; color: #1e7e34; }
.legend-chip.instruction .chip-dot { background: #28a745; }

.legend-chip.vacation { border-color: #17a2b8; color: #117a8b; }
.legend-chip.vacation .chip-dot { background: #17a2b8; }

.legend-chip.result { border-color: #6f42c1; color: #5a32a3; }
.legend-chip.result .chip-dot { background: #6f42c1; }

/* ===== Calendar Table ===== */
.calendar-table-wrapper {
  overflow-x: auto;
  margin: 0 -15px;
  padding: 0 15px;
}

.calendar-horizontal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border-radius: 8px;
  overflow: hidden;
}

.calendar-horizontal-table thead tr {
  background: linear-gradient(135deg, #e87722, #f5a623);
}

.calendar-horizontal-table thead th {
  color: #fff;
  font-weight: 600;
  padding: 12px 8px;
  text-align: center;
  font-size: 0.85rem;
  border: none;
}

.calendar-horizontal-table thead th.day-column {
  width: 70px;
  background: rgba(0,0,0,0.1);
}

.calendar-horizontal-table tbody tr {
  transition: background 0.15s ease;
}

.calendar-horizontal-table tbody tr:hover {
  background: #fffaf5;
}

.calendar-horizontal-table tbody tr:nth-child(even) {
  background: #fafafa;
}

.calendar-horizontal-table tbody tr:nth-child(even):hover {
  background: #fffaf5;
}

/* Sunday row highlighting - removed since each month has different days */

.calendar-horizontal-table td {
  padding: 6px 4px;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid #eee;
  min-height: 36px;
}

/* Day number cell (first column) */
.calendar-horizontal-table td.day-num-cell {
  font-weight: 700;
  color: #333;
  background: #f8f9fa;
  width: 40px;
  padding: 6px 8px;
  border-right: 2px solid #e87722;
}

/* Day indicator inside each cell */
.cell-day-indicator {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  color: #888;
  margin-bottom: 2px;
  letter-spacing: 0.5px;
}

.cell-day-indicator.sunday {
  color: #dc3545;
  font-weight: 700;
}

/* Legacy support */
.calendar-horizontal-table td.day-label {
  font-weight: 600;
  color: #555;
  background: #f8f9fa;
  border-right: 2px solid #e87722;
}

/* ===== Calendar Cells with Events ===== */
.calendar-cell {
  position: relative;
  min-width: 100px;
}

.calendar-cell.empty-cell {
  background: #f5f5f5;
}

.calendar-cell.sunday {
  background: #fff5f5;
}

/* Event Pills - Clickable */
.event-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 500;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.event-pill:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  text-decoration: none;
}

.event-pill:active {
  transform: scale(0.98);
}

.event-pill.event-holiday {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}

.event-pill.event-holiday:hover {
  background: #ffcdd2;
  color: #b71c1c;
}

.event-pill.event-exam {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffe0b2;
}

.event-pill.event-exam:hover {
  background: #ffe0b2;
  color: #bf360c;
}

.event-pill.event-instruction {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.event-pill.event-instruction:hover {
  background: #c8e6c9;
  color: #1b5e20;
}

.event-pill.event-vacation {
  background: #e0f7fa;
  color: #00838f;
  border: 1px solid #b2ebf2;
}

.event-pill.event-vacation:hover {
  background: #b2ebf2;
  color: #006064;
}

.event-pill.event-result {
  background: #f3e5f5;
  color: #6a1b9a;
  border: 1px solid #e1bee7;
}

/* Cell backgrounds for events */
.calendar-cell.event-holiday {
  background: #fff8f8;
}

.calendar-cell.event-exam {
  background: #fffbf5;
}

.calendar-cell.event-instruction {
  background: #f8fff8;
}

.calendar-cell.event-vacation {
  background: #f5feff;
}

.calendar-cell.event-result {
  background: #fdf5ff;
}

/* ===== Events List Section ===== */
.events-list-section {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  overflow: hidden;
}

.events-details {
  border: none;
}

.events-summary {
  padding: 15px 20px;
  background: #f8f9fa;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #333;
  border-bottom: 1px solid #eee;
  list-style: none;
}

.events-summary::-webkit-details-marker {
  display: none;
}

.events-summary::before {
  content: '▶';
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

details[open] .events-summary::before {
  transform: rotate(90deg);
}

.summary-icon {
  font-size: 1.1rem;
}

.summary-text {
  flex: 1;
}

.summary-count {
  font-weight: 400;
  color: #666;
  font-size: 0.85rem;
}

.events-table-container {
  padding: 0;
}

.events-table-modern {
  width: 100%;
  border-collapse: collapse;
}

.events-table-modern thead {
  background: #343a40;
  color: #fff;
}

.events-table-modern thead th {
  padding: 12px 15px;
  font-weight: 500;
  font-size: 0.85rem;
  text-align: left;
}

.events-table-modern thead th.col-date {
  width: 90px;
}

.events-table-modern thead th.col-type {
  width: 110px;
  text-align: center;
}

.events-table-modern tbody tr {
  border-bottom: 1px solid #eee;
  transition: background 0.15s ease;
}

.events-table-modern tbody tr:hover {
  background: #f8f9fa;
}

.event-date-cell {
  padding: 10px 15px;
}

.date-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 10px;
  border-radius: 6px;
  min-width: 60px;
  border-left: 3px solid #ddd;
  background: #f8f9fa;
}

.date-box.event-holiday { border-left-color: #dc3545; }
.date-box.event-exam { border-left-color: #fd7e14; }
.date-box.event-instruction { border-left-color: #28a745; }
.date-box.event-vacation { border-left-color: #17a2b8; }
.date-box.event-result { border-left-color: #6f42c1; }

.date-day {
  font-size: 1.3rem;
  font-weight: 700;
  color: #333;
  line-height: 1;
}

.date-month {
  font-size: 0.7rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.event-title-cell {
  padding: 10px 15px;
  color: #333;
}

.event-type-cell {
  padding: 10px 15px;
  text-align: center;
}

.type-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
}

.type-badge.badge-holiday {
  background: #dc3545;
  color: #fff;
}

.type-badge.badge-exam {
  background: #fd7e14;
  color: #fff;
}

.type-badge.badge-instruction {
  background: #28a745;
  color: #fff;
}

.type-badge.badge-vacation {
  background: #17a2b8;
  color: #fff;
}

.type-badge.badge-result {
  background: #6f42c1;
  color: #fff;
}

.empty-events {
  text-align: center;
  padding: 40px;
  color: #999;
}

/* ===== Action Buttons ===== */
.calendar-actions {
  padding: 15px 0;
}

.calendar-actions .btn {
  padding: 8px 20px;
}

/* ===== Print Styles ===== */
@media print {
  .calendar-actions,
  .events-summary::before {
    display: none !important;
  }
  
  .events-details {
    display: block !important;
  }
  
  .calendar-horizontal-table {
    box-shadow: none;
    font-size: 0.75rem;
  }
  
  .event-pill {
    font-size: 0.65rem;
    padding: 1px 4px;
  }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .calendar-legend-inline {
    gap: 5px;
  }
  
  .legend-chip {
    font-size: 0.68rem;
    padding: 3px 8px;
  }
  
  .calendar-horizontal-table {
    font-size: 0.75rem;
  }
  
  .calendar-horizontal-table thead th {
    padding: 8px 4px;
    font-size: 0.75rem;
  }
  
  .calendar-horizontal-table td {
    padding: 4px 2px;
  }
  
  .event-pill {
    font-size: 0.65rem;
    padding: 1px 4px;
  }
  
  .events-table-modern thead th,
  .event-title-cell,
  .event-date-cell,
  .event-type-cell {
    padding: 8px 10px;
  }
}

/* ===== Events Header (non-collapsible) ===== */
.events-header {
  padding: 15px 20px;
  background: linear-gradient(135deg, #e87722, #f5a623);
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  border-radius: 8px 8px 0 0;
}

.events-icon {
  font-size: 1.2rem;
}

.events-title {
  font-weight: 600;
  font-size: 1rem;
  flex: 1;
}

.events-count {
  font-size: 0.85rem;
  opacity: 0.9;
}

/* ===== Row Highlight Animation ===== */
.event-row-modern {
  transition: all 0.3s ease;
}

.event-row-modern.highlight-row {
  background: #fff3cd !important;
  animation: pulse-highlight 0.5s ease-in-out 3;
  box-shadow: 0 0 0 3px rgba(232, 119, 34, 0.3);
}

@keyframes pulse-highlight {
  0%, 100% {
    background: #fff3cd;
  }
  50% {
    background: #ffe69c;
  }
}

/* Scroll target offset for fixed headers */
.event-row-modern[id] {
  scroll-margin-top: 100px;
}

/* ===== Landing Page Styles ===== */
.academic-calendar-landing .view-academic-calendar-list {
  margin-bottom: 0;
}

.academic-calendar-landing .academic-calendar-table {
  margin: 0;
  border: none;
}

.academic-calendar-landing .academic-calendar-table thead {
  background: linear-gradient(135deg, #2a7ab8, #1d5a8a);
}

.academic-calendar-landing .academic-calendar-table thead th {
  color: #fff;
  font-weight: 600;
  padding: 12px 15px;
  border: none;
  font-size: 0.9rem;
}

.academic-calendar-landing .academic-calendar-table tbody tr {
  transition: background 0.15s ease;
}

.academic-calendar-landing .academic-calendar-table tbody tr:hover {
  background: #f8f9fa;
}

.academic-calendar-landing .academic-calendar-table tbody td {
  padding: 12px 15px;
  vertical-align: middle;
  border-bottom: 1px solid #eee;
}

.academic-calendar-landing .academic-calendar-table tbody td a {
  color: #2a7ab8;
  font-weight: 500;
  text-decoration: none;
}

.academic-calendar-landing .academic-calendar-table tbody td a:hover {
  color: #e87722;
  text-decoration: underline;
}

.academic-calendar-landing .calendar-preview-btn {
  padding: 4px 12px;
  font-size: 0.8rem;
}

/* ========================================
   NEW LANDING PAGE DESIGN
   ======================================== */

/* Page Introduction */
.academic-calendar-landing-page .calendar-intro {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 30px;
}

.academic-calendar-landing-page .calendar-intro .lead {
  font-size: 1.05rem;
  line-height: 1.6;
}

/* Section Heading */
.academic-calendar-landing-page .section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.4rem;
  font-weight: 600;
  color: #333;
  padding-bottom: 15px;
  border-bottom: 2px solid #e87722;
}

.academic-calendar-landing-page .heading-icon {
  font-size: 1.5rem;
}

/* Semester Cards */
.academic-calendar-landing-page .semester-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.academic-calendar-landing-page .semester-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.academic-calendar-landing-page .semester-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px 25px;
  color: #fff;
}

.academic-calendar-landing-page .odd-semester .semester-header {
  background: linear-gradient(135deg, #e87722, #f5a623);
}

.academic-calendar-landing-page .even-semester .semester-header {
  background: linear-gradient(135deg, #2a7ab8, #1d5a8a);
}

.academic-calendar-landing-page .semester-icon {
  width: 50px;
  height: 50px;
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.academic-calendar-landing-page .semester-title h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
}

.academic-calendar-landing-page .semester-period {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.9;
}

.academic-calendar-landing-page .semester-body {
  padding: 0;
}

/* Calendar list inside semester cards */
.academic-calendar-landing-page .semester-body .view-academic-calendar-list {
  margin: 0;
}

.academic-calendar-landing-page .semester-body table {
  margin: 0;
  border: none;
}

.academic-calendar-landing-page .semester-body thead {
  display: none;
}

.academic-calendar-landing-page .semester-body tbody tr {
  border-bottom: 1px solid #eee;
  transition: background 0.15s ease;
}

.academic-calendar-landing-page .semester-body tbody tr:hover {
  background: #f8f9fa;
}

.academic-calendar-landing-page .semester-body tbody tr:last-child {
  border-bottom: none;
}

.academic-calendar-landing-page .semester-body tbody td {
  padding: 15px 20px;
  vertical-align: middle;
}

.academic-calendar-landing-page .semester-body tbody td a {
  color: #333;
  font-weight: 500;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.academic-calendar-landing-page .semester-body tbody td a::before {
  content: '📄';
  font-size: 1.2rem;
}

.academic-calendar-landing-page .semester-body tbody td a:hover {
  color: #e87722;
}

.academic-calendar-landing-page .semester-body tbody td:last-child {
  color: #666;
  font-size: 0.85rem;
  text-align: right;
}

/* Empty state */
.academic-calendar-landing-page .semester-body .view-empty {
  padding: 30px 20px;
  text-align: center;
  color: #999;
}

/* Archives Section */
.academic-calendar-landing-page .archives-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.academic-calendar-landing-page .archives-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px 25px;
  background: linear-gradient(135deg, #6c757d, #495057);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
}

.academic-calendar-landing-page .archives-header:hover {
  background: linear-gradient(135deg, #5a6268, #3d4349);
}

.academic-calendar-landing-page .archives-icon {
  width: 50px;
  height: 50px;
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.academic-calendar-landing-page .archives-title {
  flex: 1;
}

.academic-calendar-landing-page .archives-title h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
}

.academic-calendar-landing-page .archives-subtitle {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.9;
}

.academic-calendar-landing-page .archives-toggle {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.academic-calendar-landing-page .archives-header[aria-expanded="true"] .archives-toggle {
  transform: rotate(180deg);
}

.academic-calendar-landing-page .archives-body {
  padding: 0;
  max-height: 400px;
  overflow-y: auto;
}

.academic-calendar-landing-page .archives-body table {
  margin: 0;
}

.academic-calendar-landing-page .archives-body thead {
  background: #f8f9fa;
  position: sticky;
  top: 0;
}

.academic-calendar-landing-page .archives-body thead th {
  padding: 12px 20px;
  font-weight: 600;
  font-size: 0.85rem;
  color: #555;
  border-bottom: 2px solid #ddd;
}

.academic-calendar-landing-page .archives-body tbody tr {
  border-bottom: 1px solid #eee;
}

.academic-calendar-landing-page .archives-body tbody td {
  padding: 12px 20px;
}

.academic-calendar-landing-page .archives-body tbody td a {
  color: #2a7ab8;
  text-decoration: none;
}

.academic-calendar-landing-page .archives-body tbody td a:hover {
  color: #e87722;
  text-decoration: underline;
}

/* Info Cards */
.academic-calendar-landing-page .calendar-info-section {
  background: #f8f9fa;
  padding: 30px;
  border-radius: 12px;
}

.academic-calendar-landing-page .info-card {
  display: flex;
  align-items: center;
  gap: 15px;
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.academic-calendar-landing-page .info-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
}

.academic-calendar-landing-page .info-icon.holiday {
  background: linear-gradient(135deg, #dc3545, #c82333);
}

.academic-calendar-landing-page .info-icon.exam {
  background: linear-gradient(135deg, #fd7e14, #e96800);
}

.academic-calendar-landing-page .info-icon.instruction {
  background: linear-gradient(135deg, #28a745, #1e7e34);
}

.academic-calendar-landing-page .info-content h4 {
  margin: 0 0 5px;
  font-size: 1rem;
  font-weight: 600;
  color: #333;
}

.academic-calendar-landing-page .info-content p {
  margin: 0;
  font-size: 0.85rem;
  color: #666;
}

/* Responsive */
@media (max-width: 991px) {
  .academic-calendar-landing-page .semester-card {
    margin-bottom: 20px;
  }
}

@media (max-width: 767px) {
  .academic-calendar-landing-page .semester-header {
    padding: 15px 20px;
  }
  
  .academic-calendar-landing-page .semester-icon {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
  
  .academic-calendar-landing-page .semester-title h3 {
    font-size: 1.1rem;
  }
  
  .academic-calendar-landing-page .info-card {
    padding: 15px;
  }
  
  .academic-calendar-landing-page .info-icon {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
}


