/* Modern UI Stylesheet for Schedule Web Application */
:root {
  --primary: #3b82f6;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --accent-sync: #10b981;
  --accent-sync-bg: #ecfdf5;
  --accent-async: #6366f1;
  --accent-async-bg: #eef2ff;
  --accent-anomaly: #ef4444;
  --accent-anomaly-bg: #fef2f2;
  --accent-break: #f59e0b;
  --accent-break-bg: #fffbeb;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  padding-bottom: 60px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* Header Section */
.header {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: white;
  padding: 32px 28px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(59,130,246,0.15) 0%, rgba(255,255,255,0) 70%);
  pointer-events: none;
}

.header-title-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.header h1 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  line-height: 1.2;
}

.header p {
  color: #94a3b8;
  font-size: 0.95rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  backdrop-filter: blur(10px);
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: white;
}

.stat-label {
  font-size: 0.82rem;
  color: #cbd5e1;
  margin-top: 2px;
}

/* Controls & Toolbar */
.controls-bar {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.tabs-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-btn {
  background: #f1f5f9;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.25);
}

.view-switcher {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  gap: 4px;
}

.view-btn {
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.view-btn.active {
  background: white;
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.search-filter-box {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.search-input {
  flex: 1;
  min-width: 220px;
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.select-filter {
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  background: white;
  cursor: pointer;
}

/* Anomaly Alert Banner */
.anomaly-banner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 5px solid var(--accent-anomaly);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.anomaly-icon {
  font-size: 1.4rem;
  color: var(--accent-anomaly);
  flex-shrink: 0;
  margin-top: 2px;
}

.anomaly-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #991b1b;
  margin-bottom: 4px;
}

.anomaly-content p {
  font-size: 0.85rem;
  color: #7f1d1d;
}

.anomaly-tag {
  display: inline-block;
  background: #fee2e2;
  color: #991b1b;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 6px;
  margin-right: 6px;
}

/* Rules Guidelines Section */
.rules-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 24px;
  font-size: 0.85rem;
  color: #166534;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.rules-list {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.rule-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

/* Weekly Grid View */
.stage-section {
  margin-bottom: 36px;
}

.stage-header {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
}

.stage-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.stage-badge {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

.week-block {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.week-title {
  font-size: 1rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.weekly-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

@media (max-width: 1024px) {
  .weekly-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .weekly-grid {
    grid-template-columns: 1fr;
  }
}

.day-column {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 250px;
}

.day-header {
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 8px;
  margin-bottom: 4px;
  text-align: center;
}

.day-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.day-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.day-jp-tag {
  font-size: 0.72rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #475569;
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-block;
  margin-top: 4px;
}

/* Session Card */
.session-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  border-left: 4px solid var(--primary);
}

.session-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.session-card.sync {
  border-left-color: var(--accent-sync);
}

.session-card.async {
  border-left-color: var(--accent-async);
}

.session-card.holiday {
  border-left-color: #94a3b8;
  background: #f1f5f9;
}

.session-card.anomaly {
  border-left-color: var(--accent-anomaly);
  background: #fff5f5;
}

.session-time {
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.jp-badge {
  background: #f1f5f9;
  color: #334155;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.session-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 6px;
}

.session-teacher {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}

.type-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.type-pill.sync {
  background: var(--accent-sync-bg);
  color: #065f46;
}

.type-pill.async {
  background: var(--accent-async-bg);
  color: #3730a3;
}

.type-pill.anomaly {
  background: var(--accent-anomaly-bg);
  color: #991b1b;
}

/* Daily Timeline View (Ke Bawah) */
.daily-timeline-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.daily-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.daily-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.daily-date-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);

}

.daily-jp-summary {
  display: flex;
  align-items: center;
  gap: 10px;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  padding-left: 20px;
}

.timeline-list::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: #e2e8f0;
}

.timeline-item {
  position: relative;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-left: 12px;
  transition: transform 0.2s;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 20px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid white;
  box-shadow: 0 0 0 2px var(--primary);
}

.timeline-item.break {
  background: var(--accent-break-bg);
  border-color: #fde68a;
}

.timeline-item.break::before {
  background: var(--accent-break);
  box-shadow: 0 0 0 2px var(--accent-break);
}

.timeline-item.anomaly {
  background: var(--accent-anomaly-bg);
  border-color: #fecaca;
}

.timeline-item.anomaly::before {
  background: var(--accent-anomaly);
  box-shadow: 0 0 0 2px var(--accent-anomaly);
}

.timeline-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;

}

.timeline-time {
  font-size: 0.9rem;
  font-weight: 800;
  color: #1e293b;
}

.timeline-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.timeline-details {
  display: flex;
  gap: 16px;
  font-size: 0.83rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  margin-top: 6px;
}

/* Modal Dialog */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 550px;
  width: 90%;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;

}

.modal-close-btn {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 0.9rem;
}

.modal-row {
  display: flex;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.modal-row-label {
  font-weight: 600;
  color: var(--text-muted);
}

.modal-row-value {
  font-weight: 700;
  color: var(--text-main);
  text-align: right;
}

/* Tabel Matrix Waktu Paten Styles */
.matrix-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  background: white;
  margin-bottom: 24px;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 900px;
}

.matrix-table th {
  background: #1e293b;
  color: white;
  padding: 12px 14px;
  text-align: center;
  font-weight: 700;
  border: 1px solid #334155;
  white-space: nowrap;
}

.matrix-table td {
  border: 1px solid #e2e8f0;
  padding: 6px 10px;
  vertical-align: top;
  min-height: 48px;
}

.matrix-time-col {
  background: #f1f5f9;
  font-weight: 800;
  color: #1e293b;
  text-align: center;
  width: 150px;
  border-right: 2px solid #cbd5e1 !important;
}

.matrix-time-badge {
  font-size: 0.72rem;
  background: #cbd5e1;
  color: #334155;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 2px;
}

.matrix-break-row {
  background: #fef3c7 !important;
}

.matrix-break-cell {
  background: #fef3c7 !important;
  color: #92400e;
  font-weight: 800;
  text-align: center;
  padding: 10px !important;
  border-top: 2px solid #f59e0b !important;
  border-bottom: 2px solid #f59e0b !important;
}

.matrix-anomaly-row {
  background: #fee2e2 !important;
}

.matrix-anomaly-cell {
  background: #fee2e2 !important;
  color: #991b1b;
  font-weight: 800;
  text-align: center;
}

.matrix-card {
  background: white;
  border-radius: 6px;
  padding: 6px 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  border-left: 4px solid var(--primary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.matrix-card:hover {
  transform: scale(1.02);
}

.matrix-card.sync {
  border-left-color: var(--accent-sync);
  background: #f0fdf4;
}

.matrix-card.async {
  border-left-color: var(--accent-async);
  background: #f5f3ff;
}

.matrix-card.anomaly {
  border-left-color: var(--accent-anomaly);
  background: #fff5f5;
}

.matrix-card-title {
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 4px;
}

.matrix-card-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

