/* Basic styles for the sidebar */
#wrapper {
    display: flex;
}

#sidebar-wrapper {
    min-height: 100vh;
    width: 250px;
    transition: margin .25s ease-out;
}

#sidebar-wrapper .sidebar-heading {
    padding: 0.875rem 1.25rem;
    font-size: 1.2rem;
}

#page-content-wrapper {
    min-width: 100vw;
}

#wrapper.toggled #sidebar-wrapper {
    margin-left: -250px;
}

#page-content-wrapper {
    min-width: 0;
    width: 100%;
} 

/* Responsive sidebar behavior: hidden by default on small screens, shown when wrapper has .sidebar-open */
@media (max-width: 992px) {
  #sidebar-wrapper { margin-left: -250px; }
  #wrapper.sidebar-open #sidebar-wrapper { margin-left: 0; }
}

/* Calendar visual refinements */
.fc .fc-timegrid-event {
  border-radius: 6px;
}
.fc .fc-event .fc-event-title,
.fc .fc-event .fc-event-time {
  font-weight: 600;
}

/* Status indicator badge inside event */
.fc-status-indicator {
  font-size: 10px;
  line-height: 1;
  padding: 3px 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* Canceled lesson appearance */
.fc-event-cancelled {
  filter: grayscale(0.9);
  opacity: 0.6;
  text-decoration: line-through;
}

/* Completed lesson subtle enhancement */
.fc-event-completed {
  box-shadow: inset 0 0 0 2px rgba(25,135,84,0.3);
}

/* Legend styles */
.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  margin-bottom: 8px;
}
.calendar-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}
.calendar-legend .legend-dot {
  width: 14px;
  height: 14px;
  display: inline-block;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.15);
}

/* Popover tweaks */
.popover .badge {
  font-weight: 600;
}
.popover .small ul { padding-left: 18px; } 

/* Wider lesson popover and responsive button grid */
.lesson-popover.popover { max-width: 380px; }
.lesson-popover .action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.lesson-popover .action-buttons .btn {
  flex: 1 1 calc(50% - 6px);
}
@media (max-width: 420px) {
  .lesson-popover.popover { max-width: 320px; }
  .lesson-popover .action-buttons .btn { flex-basis: 100%; }
} 

/* Compact event layout for overlapping (narrow) widths */
.fc .fc-timegrid-event .fc-event-main {
  padding: 4px 6px;
}
.fc .fc-timegrid-event .fc-event-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  line-height: 1.15;
}
.fc-event-narrow .fc-event-title { font-size: 11px; }
.fc-event-ultranarrow .fc-event-title { font-size: 10px; }
.fc-event-narrow .fc-status-indicator { transform: scale(0.88); }
.fc-event-ultranarrow .fc-status-indicator { transform: scale(0.8); } 

/* AI Chat */
.ai-chat-container { position: relative; height: calc(var(--vh, 1vh) * 100 - 140px); display: flex; flex-direction: column; gap: 8px; }
.ai-chat-header { display:flex; align-items:center; justify-content: space-between; padding: 10px 12px; background: #f8f9fa; border: 1px solid rgba(0,0,0,.05); border-radius: 8px; }
.ai-chat-body { flex: 1 1 auto; overflow-y: auto; padding: 12px; background: #fff; border: 1px solid rgba(0,0,0,.05); border-radius: 8px; }
.ai-chat-composer { position: sticky; bottom: 0; padding: 8px 0; background: #fff; z-index: 1; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
.ai-chat-composer .form-control { min-height: 56px; font-size: 1rem; padding: 12px 14px; }
.ai-chat-composer .btn { min-height: 56px; font-size: 1.05rem; display: inline-flex; align-items: center; gap: 8px; padding: 0 18px; min-width: 160px; justify-content: center; }
.ai-chat-composer .btn i { font-size: 1.2rem; }

.chat-row { display:flex; gap:8px; margin: 8px 0; }
.chat-row.you { justify-content: flex-start; }
.chat-row.me { justify-content: flex-end; }

.chat-row .avatar { width: 32px; height: 32px; border-radius: 50%; display:flex; align-items:center; justify-content:center; }
.chat-row .bubble { max-width: 70%; padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(0,0,0,.05); background: #f6f8fa; }
.chat-row.you .bubble { background: #f6f8fa; }
.chat-row.me .bubble { background: #e7f1ff; border-color: rgba(13,110,253,.2); }

/* Typing dots */
.typing-dots { display:inline-flex; gap:4px; }
.typing-dots span { width:6px; height:6px; border-radius:50%; background:#6c757d; display:inline-block; animation: blink 1.2s infinite; opacity:.5; }
.typing-dots span:nth-child(2){ animation-delay:.2s; }
.typing-dots span:nth-child(3){ animation-delay:.4s; }
@keyframes blink { 0%, 80%, 100% { opacity:.2 } 40% { opacity:1 } } 

/* Mobile tweaks for FullCalendar */
@media (max-width: 576px) {
  .ai-chat-container { height: auto; min-height: calc(var(--vh, 1vh) * 100 - 110px); }
  .ai-chat-body { padding-bottom: 88px; }
  #calendar { width: 100%; min-height: calc(100vh - 220px); }
  .fc .fc-toolbar { flex-wrap: wrap; gap: 6px; }
  .fc .fc-toolbar-title { font-size: 1rem; }
  .fc .fc-button { padding: .25rem .5rem; font-size: .85rem; }
  .fc .fc-col-header-cell-cushion { padding: 6px 4px; font-size: .8rem; }
  .fc .fc-timegrid-axis-cushion { padding: 2px 4px; font-size: .75rem; }
  .fc .fc-timegrid-slot-label { font-size: .75rem; }
  .fc .fc-timegrid-slot { height: 2.2em; }
  .fc .fc-event .fc-event-title, .fc .fc-event .fc-event-time { white-space: normal; }
  .lesson-popover.popover { max-width: 90vw; }
  .calendar-legend { gap: 6px 10px; }
  /* AI chat header responsive stacking */
  .ai-chat-header { flex-direction: column; align-items: stretch; gap: 8px; }
  .ai-chat-header > .d-flex { flex-wrap: wrap; }
  .ai-chat-header select.form-select { width: 100% !important; }
  .ai-chat-header .form-check { width: 100%; }
  .ai-chat-header .btn { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .ai-chat-composer .form-control { min-height: 48px; }
  .ai-chat-composer .btn { min-height: 48px; padding: 0 12px; min-width: 120px; }
} 