/* =======================================================
   KALENDER BURSA EFEK INDONESIA (IDX MARKET CALENDAR)
   Smart Running Trade - Cyber Terminal Theme
   Accent: Bright Emerald & Electric Cyan (#10b981 / #06b6d4)
   ======================================================= */

.calendar-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9990;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.calendar-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.calendar-drawer {
  position: fixed;
  top: 0;
  right: 44px;
  bottom: 0;
  width: 960px;
  max-width: calc(100vw - 44px);
  height: 100vh;
  background: #090e1f;
  border-left: 1px solid rgba(16, 185, 129, 0.25);
  box-shadow: -16px 0 48px rgba(0, 0, 0, 0.85);
  z-index: 9995;
  display: flex;
  flex-direction: column;
  transform: translateX(calc(100% + 44px));
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: #f1f5f9;
  font-family: 'JetBrains Mono', 'SF Mono', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, monospace;
  user-select: none;
  overflow: hidden;
}

body.sidebar-hidden .calendar-drawer {
  right: 0 !important;
  max-width: 100vw;
}

.calendar-drawer.open {
  transform: translateX(0);
}

/* Header */
.calendar-header {
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #080c1a;
  flex-shrink: 0;
}

.calendar-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calendar-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: calPulse 2s infinite;
  flex-shrink: 0;
}

@keyframes calPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.calendar-title-main {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #34d399;
  text-transform: uppercase;
}

.calendar-title-sub {
  font-size: 10px;
  color: #64748b;
  letter-spacing: 0.04em;
  margin-top: 1px;
}

.calendar-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.calendar-btn-refresh {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.calendar-btn-refresh:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  color: #34d399;
}

.calendar-btn-close {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.calendar-btn-close:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border-color: #ef4444;
}

/* Controls */
.calendar-controls {
  padding: 10px 20px;
  background: rgba(15, 23, 42, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.calendar-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-input-wrap {
  flex: 1;
  position: relative;
}

.calendar-search-input {
  width: 100%;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  padding: 7px 12px;
  color: #e2e8f0;
  font-size: 11px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.calendar-search-input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.calendar-btn-all {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
}

.calendar-btn-all:hover,
.calendar-btn-all.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #34d399;
}

/* Navigation Pills */
.calendar-pills-row {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.calendar-pills-row::-webkit-scrollbar {
  display: none;
}

.calendar-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 10.5px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.calendar-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.calendar-pill.active {
  background: #10b981;
  border-color: #10b981;
  color: #022c22;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.calendar-pill .pill-badge {
  background: rgba(0, 0, 0, 0.25);
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 10px;
  color: inherit;
}

/* Metrics Bar */
.calendar-metrics-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 8px 20px;
  background: #080c1a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.calendar-metric-cell {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 6px 10px;
}

.calendar-metric-hdr {
  font-size: 9.5px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.calendar-metric-val {
  font-size: 13px;
  font-weight: 700;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-metric-val.green { color: #10b981; }
.calendar-metric-val.cyan { color: #06b6d4; }
.calendar-metric-val.amber { color: #f59e0b; }
.calendar-metric-val.purple { color: var(--accent-primary, #f59e0b); }
.calendar-metric-val.rose { color: #f43f5e; }

/* Body Container */
.calendar-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Card Styles */
.calendar-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 14px 16px;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
  cursor: pointer;
}

.calendar-card:hover {
  border-color: rgba(16, 185, 129, 0.4);
  background: #111c34;
  transform: translateY(-1px);
}

.calendar-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.calendar-header-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.calendar-symbol-badge {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  transition: all 0.2s;
}

.calendar-symbol-badge:hover {
  background: #10b981;
  color: #022c22;
}

.calendar-cat-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.calendar-cat-badge.dividend { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.calendar-cat-badge.rups { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.calendar-cat-badge.ipo { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.calendar-cat-badge.rightissue { background: var(--theme-accent-glow, rgba(245, 158, 11, 0.15)); color: var(--accent-primary, #fbbf24); border: 1px solid rgba(245, 158, 11, 0.3); }
.calendar-cat-badge.stocksplit { background: rgba(236, 72, 153, 0.15); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.3); }
.calendar-cat-badge.pubex { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
.calendar-cat-badge.economic { background: rgba(14, 165, 233, 0.15); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.3); }
.calendar-cat-badge.holiday { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

.calendar-card-date {
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 5px;
}

.calendar-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.4;
  margin-bottom: 8px;
}

.calendar-card-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
  padding: 8px 12px;
  margin-top: 6px;
}

.calendar-detail-item {
  display: flex;
  flex-direction: column;
}

.calendar-detail-label {
  font-size: 9.5px;
  color: #64748b;
  text-transform: uppercase;
}

.calendar-detail-value {
  font-size: 11.5px;
  font-weight: 600;
  color: #e2e8f0;
  margin-top: 1px;
}

.calendar-detail-value.highlight {
  color: #34d399;
}

.calendar-detail-value.amber {
  color: #fbbf24;
}

.calendar-detail-value.cyan {
  color: #38bdf8;
}

/* Day Selector Strip for Weekly Agenda */
.calendar-day-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0 10px 0;
  scrollbar-width: none;
}

.calendar-day-strip::-webkit-scrollbar { display: none; }

.calendar-day-btn {
  flex: 1;
  min-width: 90px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 8px 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.calendar-day-btn:hover {
  border-color: rgba(16, 185, 129, 0.4);
  background: #131d36;
}

.calendar-day-btn.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.calendar-day-name {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
}

.calendar-day-num {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
  margin: 2px 0;
}

.calendar-day-count {
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #64748b;
  display: inline-block;
}

.calendar-day-btn.active .calendar-day-count {
  background: #10b981;
  color: #022c22;
  font-weight: 700;
}

/* Empty & Loading States */
.calendar-state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
}


.calendar-state-title {
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
}

.calendar-state-desc {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
  max-width: 320px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .calendar-drawer {
    width: 100vw;
    max-width: 100vw;
    right: 0;
    transform: translateX(100%);
  }
  .calendar-metrics-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .calendar-card-details-grid {
    grid-template-columns: 1fr 1fr;
  }
}
