/* =============================================
   Agendamento Calendar - Google Calendar Style
   ============================================= */

/* --- Container principal --- */
.gc-calendar {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 160px);
  min-height: 500px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  font-size: 13px;
  color: #3c4043;
  background: #fff;
  border-top: 1px solid #dadce0;
  user-select: none;
}

/* --- Header com dias da semana --- */
.gc-header {
  display: flex;
  border-bottom: 1px solid #dadce0;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.gc-header-gutter {
  width: 60px;
  min-width: 60px;
  flex-shrink: 0;
  border-right: 1px solid #dadce0;
}

.gc-header-days {
  display: flex;
  flex: 1;
  min-width: 0;
}

.gc-header-day {
  flex: 1;
  text-align: center;
  padding: 8px 4px 6px;
  border-right: 1px solid #f1f3f4;
  min-width: 0;
}

.gc-header-day:last-child {
  border-right: none;
}

.gc-header-day-name {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #70757a;
}

.gc-header-day-number {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.2;
  margin-top: 2px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.15s;
}

.gc-header-day-number:hover {
  background: #f1f3f4;
}

.gc-header-day.gc-today .gc-header-day-name {
  color: #1a73e8;
}

.gc-header-day.gc-today .gc-header-day-number {
  background: #1a73e8;
  color: #fff;
}

.gc-header-day.gc-today .gc-header-day-number:hover {
  background: #1765cc;
}

/* --- Grid do corpo --- */
.gc-body {
  display: flex;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}

.gc-time-gutter {
  width: 60px;
  min-width: 60px;
  flex-shrink: 0;
  position: relative;
}

.gc-time-label {
  position: absolute;
  right: 8px;
  transform: translateY(-50%);
  font-size: 10px;
  color: #70757a;
  white-space: nowrap;
  pointer-events: none;
}

.gc-days-container {
  display: flex;
  flex: 1;
  position: relative;
  min-width: 0;
}

.gc-day-column {
  flex: 1;
  position: relative;
  border-right: 1px solid #f1f3f4;
  min-width: 0;
}

.gc-day-column:last-child {
  border-right: none;
}

/* --- Slots de hora --- */
.gc-hour-slot {
  height: 48px;
  border-bottom: 1px solid #f1f3f4;
  position: relative;
  cursor: pointer;
  transition: background-color 0.1s;
}

.gc-hour-slot:hover {
  background: #f8f9fa;
}

.gc-hour-slot.gc-half {
  border-bottom: 1px dashed #f1f3f4;
}

.gc-hour-slot.gc-full {
  border-bottom: 1px solid #dadce0;
}

/* Linha da hora atual */
.gc-now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #ea4335;
  z-index: 5;
  pointer-events: none;
}

.gc-now-line::before {
  content: '';
  position: absolute;
  left: -5px;
  top: -4px;
  width: 10px;
  height: 10px;
  background: #ea4335;
  border-radius: 50%;
}

/* --- Eventos --- */
.gc-event {
  position: absolute;
  left: 2px;
  right: 2px;
  min-height: 20px;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  line-height: 16px;
  overflow: hidden;
  cursor: pointer;
  z-index: 3;
  border-left: 3px solid;
  transition: box-shadow 0.15s, transform 0.1s;
}

.gc-event:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 6;
}

.gc-event.gc-dragging {
  opacity: 0.85;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 100;
  transform: scale(1.02);
  cursor: grabbing;
}

.gc-event-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gc-event-time {
  font-size: 10px;
  opacity: 0.85;
  white-space: nowrap;
}

/* Cores dos eventos por funcionaria */
.gc-event-color-0 { background: #e8f0fe; border-color: #1a73e8; color: #174ea6; }
.gc-event-color-1 { background: #fce8e6; border-color: #ea4335; color: #a50e0e; }
.gc-event-color-2 { background: #e6f4ea; border-color: #34a853; color: #0d652d; }
.gc-event-color-3 { background: #fef7e0; border-color: #f9ab00; color: #7c5800; }
.gc-event-color-4 { background: #f3e8fd; border-color: #a142f4; color: #5e0d8b; }
.gc-event-color-5 { background: #e0f7fa; border-color: #00bcd4; color: #006978; }
.gc-event-color-6 { background: #fff3e0; border-color: #ff9800; color: #7a4100; }
.gc-event-color-7 { background: #fce4ec; border-color: #e91e63; color: #880e4f; }

/* Cor customizada da funcionaria */
.gc-event[style*="--fc"] {
  background: var(--fc-bg);
  border-color: var(--fc-border);
  color: var(--fc-text);
}

/* Drop target highlight */
.gc-hour-slot.gc-drop-target {
  background: #e8f0fe !important;
  outline: 2px dashed #1a73e8;
  outline-offset: -2px;
}

/* --- Ghost do drag --- */
.gc-drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.7;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  white-space: nowrap;
}

/* --- Vista dia unico --- */
.gc-calendar.gc-view-day .gc-day-column {
  flex: 1;
}

/* ============ RESPONSIVO ============ */

@media (max-width: 768px) {
  .gc-calendar {
    height: calc(100vh - 140px);
    min-height: 400px;
  }

  .gc-time-gutter,
  .gc-header-gutter {
    width: 44px;
    min-width: 44px;
  }

  .gc-time-label {
    font-size: 9px;
    right: 4px;
  }

  .gc-header-day-name {
    font-size: 10px;
  }

  .gc-header-day-number {
    font-size: 18px;
    width: 32px;
    height: 32px;
  }

  .gc-hour-slot {
    height: 40px;
  }

  .gc-event {
    font-size: 10px;
    padding: 1px 4px;
    line-height: 14px;
  }

  .gc-event-time {
    display: none;
  }
}

/* --- Cabecalho customizado da pagina --- */
.gc-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: #fff;
  border-bottom: 1px solid #dadce0;
  gap: 8px;
}

.gc-page-header .gc-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.gc-page-header .gc-nav-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #dadce0;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5f6368;
  font-size: 14px;
  transition: background 0.15s;
}

.gc-page-header .gc-nav-btn:hover {
  background: #f1f3f4;
}

.gc-page-header .gc-title {
  font-size: 20px;
  font-weight: 400;
  color: #3c4043;
  margin: 0 8px;
  min-width: 160px;
  text-transform: capitalize;
}

.gc-page-header .gc-today-btn {
  padding: 6px 16px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #3c4043;
  transition: background 0.15s;
}

.gc-page-header .gc-today-btn:hover {
  background: #f1f3f4;
}

.gc-page-header .gc-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gc-page-header .gc-view-toggle {
  display: flex;
  border: 1px solid #dadce0;
  border-radius: 4px;
  overflow: hidden;
}

.gc-page-header .gc-view-toggle button {
  padding: 6px 14px;
  border: none;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #5f6368;
  transition: all 0.15s;
}

.gc-page-header .gc-view-toggle button:not(:last-child) {
  border-right: 1px solid #dadce0;
}

.gc-page-header .gc-view-toggle button.active {
  background: #e8f0fe;
  color: #1a73e8;
}

.gc-page-header .gc-view-toggle button:hover:not(.active) {
  background: #f1f3f4;
}

.gc-page-header .gc-add-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #1a73e8;
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: background 0.15s, box-shadow 0.15s;
}

.gc-page-header .gc-add-btn:hover {
  background: #1765cc;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.gc-page-header .gc-sync-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #dadce0;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5f6368;
  font-size: 14px;
  transition: background 0.15s;
}

.gc-page-header .gc-sync-btn:hover {
  background: #f1f3f4;
}

/* Esconde o navbar nativo do rcalendario */
.calendar-navbar {
  display: none !important;
}

