@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes pulse-approval {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* ===== CONTÊINERES PRINCIPAIS ===== */
.timeline-container {
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 74, 143, 0.1), 0 4px 10px rgba(0, 0, 0, 0.05);
  padding: 2rem;
  margin-bottom: 2rem;
  min-height: 650px;
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.6s ease-out;
}

.timeline-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #004a8f, #0066cc, #004a8f);
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
}

#calendar {
  width: 100%;
  min-height: 600px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  background: #ffffff;
}

/* ===== FILTROS ===== */
.timeline-filters {
  background: linear-gradient(135deg, #f0f7ff 0%, #e6f3ff 100%);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 20px rgba(0, 74, 143, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 74, 143, 0.1);
  animation: slideIn 0.5s ease-out;
}

.filter-form .row {
  align-items: end;
}

.filter-form label {
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-form input[type="date"],
.filter-form input[type="text"] {
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(5px);
}

.filter-form input[type="date"]:focus,
.filter-form input[type="text"]:focus {
  border-color: #004a8f;
  box-shadow: 0 0 0 3px rgba(0, 74, 143, 0.1), 0 4px 12px rgba(0, 74, 143, 0.15);
  outline: none;
  background: #ffffff;
  transform: translateY(-1px);
}

/* ===== FILTRO DE AGENDAS ===== */
.agendas-filter-container {
  max-height: 240px;
  padding: 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.agendas-scroll-area {
  max-height: 160px;
  overflow-y: auto;
  margin-top: 0.5rem;
  padding-right: 8px;
}

.agendas-scroll-area::-webkit-scrollbar {
  width: 6px;
}

.agendas-scroll-area::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.agendas-scroll-area::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 3px;
  transition: background 0.2s;
}

.agendas-scroll-area::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

.form-check {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.form-check:hover {
  background: rgba(0, 74, 143, 0.05);
  transform: translateX(2px);
}

.form-check-input {
  width: 18px;
  height: 18px;
  margin-top: 0;
  margin-right: 0.75rem;
  flex-shrink: 0;
  border: 2px solid #cbd5e0;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.form-check-input:checked {
  background-color: #004a8f;
  border-color: #004a8f;
  box-shadow: 0 2px 4px rgba(0, 74, 143, 0.3);
}

.form-check-label {
  display: flex;
  align-items: center;
  flex: 1;
  font-size: 0.9rem;
  color: #4a5568;
  cursor: pointer;
  line-height: 1.4;
}

.agenda-color-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 10px;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
/* Agenda item específico - espaçamento reduzido */
.agenda-item {
  margin-bottom: 0.3rem !important;
}

.agenda-details strong {
  font-weight: 600;
  color: #2d3748;
}

/* ===== BOTÕES  ===== */
.btn-clear-filters {
  background-color: #6c757d !important;
  border-color: #6c757d !important;
  color: #ffffff !important;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-clear-filters:hover {
  background-color: #5a6268 !important;
  border-color: #545b62 !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
  text-decoration: none;
}

.btn-clear-filters:focus {
  box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
  color: #ffffff !important;
}

/* ===== BOTÕES DE VISUALIZAÇÃO ===== */
.view-options {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
  animation: fadeIn 0.4s ease-out 0.2s both;
}

.view-options .btn-group {
  display: flex;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background: #ffffff;
}

.view-option {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: #4a5568;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border-right: 1px solid #e2e8f0;
}

.view-option:last-child {
  border-right: none;
}

.view-option:hover {
  background: linear-gradient(135deg, #f0f7ff 0%, #e6f3ff 100%);
  color: #004a8f;
  transform: translateY(-1px);
}

.view-option.active {
  background: linear-gradient(135deg, #004a8f 0%, #0066cc 100%);
  color: #ffffff;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1),
    0 2px 8px rgba(0, 74, 143, 0.3);
}

.view-option.active::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #004a8f;
}

/* ===== ESTILOS FULLCALENDAR ===== */
.fc {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

.fc-header-toolbar {
  margin-bottom: 1.5rem !important;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e2e8f0;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  border-radius: 12px 12px 0 0;
  padding: 1rem 1.5rem;
}

.fc .fc-toolbar-title {
  font-size: 1.75rem !important;
  color: #004a8f;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.fc .fc-button-primary {
  background: linear-gradient(135deg, #004a8f 0%, #0066cc 100%) !important;
  border: none !important;
  box-shadow: 0 4px 12px rgba(0, 74, 143, 0.3) !important;
  border-radius: 8px !important;
  padding: 0.5rem 1rem !important;
  font-weight: 600 !important;
  transition: all 0.3s ease !important;
}

.fc .fc-button-primary:hover {
  background: linear-gradient(135deg, #003a70 0%, #004a8f 100%) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(0, 74, 143, 0.4) !important;
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background: linear-gradient(135deg, #00305e 0%, #003a70 100%) !important;
  transform: translateY(0) !important;
  box-shadow: 0 2px 8px rgba(0, 74, 143, 0.4) !important;
}

/* ===== CABEÇALHO DE COLUNAS ===== */
.fc-col-header-cell {
  background: linear-gradient(135deg, #f0f7ff 0%, #e6f3ff 100%) !important;
  padding: 1rem 0 !important;
  border-bottom: 2px solid #cbd5e0 !important;
}

.fc-col-header-cell-cushion {
  font-weight: 700 !important;
  color: #004a8f !important;
  text-decoration: none !important;
  font-size: 0.9rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

/* ===== SLOTS DE TEMPO ===== */
.fc-timegrid-slot {
  height: 50px !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

.fc-timegrid-slot:nth-child(even) {
  background: rgba(248, 250, 252, 0.5) !important;
}

.fc-timegrid-slot-label {
  font-size: 0.85rem;
  color: #718096;
  font-weight: 500;
  padding: 0.5rem;
}

/* ===== INDICADOR DE TEMPO ATUAL ===== */
.fc-timegrid-now-indicator-line {
  border-color: #e53e3e !important;
  border-width: 2px !important;
  z-index: 5 !important;
  box-shadow: 0 0 8px rgba(229, 62, 62, 0.4) !important;
}

.fc-timegrid-now-indicator-arrow {
  border-color: #e53e3e !important;
  border-width: 6px !important;
  box-shadow: 0 1px 4px rgba(229, 62, 62, 0.3) !important;
}

/* ===== EVENTOS  ===== */
.fc-event {
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1) !important;
  margin: 3px 2px !important;
  overflow: hidden !important;
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border: none !important;
}

.fc-event:hover {
  transform: scale(1.02) translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), 0 4px 10px rgba(0, 0, 0, 0.1) !important;
  z-index: 10 !important;
}

.fc-event-main {
  padding: 8px 10px !important;
  border-radius: 8px !important;
}

.fc-event-title {
  font-weight: 700 !important;
  margin-bottom: 4px !important;
  font-size: 0.9rem !important;
  line-height: 1.3 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.fc-event-details {
  font-size: 0.75rem;
  opacity: 0.9;
  line-height: 1.2;
}

.fc-event-location {
  margin-bottom: 2px;
  display: flex;
  align-items: center;
}

.fc-event-location i {
  margin-right: 4px;
  width: 10px;
}

.fc-event-agenda {
  display: flex;
  align-items: center;
  margin-bottom: 2px;
}

.agenda-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 4px;
  flex-shrink: 0;
}

.fc-event-status {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ===== STATUS ESPECÍFICOS ===== */

.fc-event.event-status-realizado {
  opacity: 0.8 !important;
}

.fc-event.event-status-cancelado {
  opacity: 0.7 !important;
}

.fc-event.event-status-cancelado .fc-event-title {
  text-decoration: line-through !important;
}

.fc-event.event-status-aguardando_aprovacao {
  animation: pulse-approval 2s infinite !important;
}

/* ===== VISUALIZAÇÃO EM LISTA ===== */
.fc-list-day-cushion {
  background: linear-gradient(135deg, #f0f7ff 0%, #e6f3ff 100%) !important;
  padding: 0.75rem 1rem !important;
  font-weight: 700 !important;
  color: #004a8f !important;
  border-radius: 8px !important;
  margin-bottom: 0.5rem !important;
}

.fc-list-event {
  cursor: pointer !important;
  padding: 0.75rem 1rem !important;
  border-radius: 8px !important;
  margin-bottom: 0.5rem !important;
  transition: all 0.2s ease !important;
}

.fc-list-event:hover {
  background: rgba(0, 74, 143, 0.05) !important;
  transform: translateX(4px) !important;
}

.fc-list-event-title {
  font-weight: 600 !important;
  color: #2d3748 !important;
}

.fc-list-event-dot {
  border-radius: 50% !important;
  width: 8px !important;
  height: 8px !important;
  margin-right: 0.75rem !important;
}

/* ===== ESTADO VAZIO  ===== */
.fc-no-events-message {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 400px;
  color: #718096;
  text-align: center;
  animation: fadeIn 0.5s ease-out;
}

.no-events-icon {
  font-size: 4rem;
  color: #cbd5e0;
  margin-bottom: 1rem;
  animation: pulse 2s infinite;
}

.fc-no-events-message h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 0.5rem;
}

.fc-no-events-message p {
  font-size: 1rem;
  color: #718096;
  margin-bottom: 0;
}

/* ===== MODAL ===== */
#event-modal {
  z-index: 9999 !important;
  backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.6);
}

#event-modal.show {
  display: flex !important;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  border-radius: 16px !important;
  border: none !important;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25), 0 10px 20px rgba(0, 0, 0, 0.1) !important;
  animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
}

.event-details-header {
  padding: 1.5rem 2rem 1rem;
  border-left-width: 6px !important;
  border-left-style: solid !important;
  border-radius: 16px 16px 0 0;
  margin: 0;
}

.event-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.event-title-row h4 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #2d3748;
  line-height: 1.3;
  flex: 1;
}

.status-badge {
  padding: 0.5rem 1rem !important;
  border-radius: 20px !important;
  font-weight: 600 !important;
  font-size: 0.8rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  flex-shrink: 0;
}

.event-details-body {
  padding: 1rem 2rem 2rem;
  background: #ffffff;
}

.detail-section {
  margin-bottom: 1.5rem;
}

.detail-section:last-child {
  margin-bottom: 0;
}

.detail-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.detail-icon {
  width: 20px !important;
  text-align: center;
  color: #004a8f !important;
  font-size: 1.1rem !important;
  margin-top: 2px;
  flex-shrink: 0;
}

.detail-content {
  flex: 1;
  line-height: 1.5;
}

.detail-content strong {
  color: #2d3748;
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.agenda-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.agenda-color-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.agenda-name {
  font-weight: 600;
  color: #4a5568;
}

.agenda-owner {
  color: #718096;
  font-size: 0.9rem;
}

.description-section .description-text {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  margin-top: 0.5rem;
  line-height: 1.6;
  color: #4a5568;
}

.actions-section {
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
  text-align: center;
}

.btn-action {
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 74, 143, 0.2);
}

.btn-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 74, 143, 0.3);
  text-decoration: none;
  color: #ffffff;
}

/* ===== LOADING STATE ===== */
.fc-loading {
  position: relative;
  opacity: 0.6;
}

.fc-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 4px solid #e2e8f0;
  border-top: 4px solid #004a8f;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 1200px) {
  .timeline-container {
    padding: 1.5rem;
    min-height: 600px;
  }

  #calendar {
    min-height: 550px;
  }
}

@media (max-width: 992px) {
  .timeline-container {
    min-height: 550px;
  }

  #calendar {
    min-height: 500px;
  }

  .fc-header-toolbar {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .view-options {
    justify-content: center;
  }
}

@media (max-width: var(--breakpoint-sm)) {
  .timeline-container {
    padding: 1rem;
    border-radius: 12px;
    min-height: 500px;
  }

  #calendar {
    min-height: 450px;
  }

  .timeline-filters {
    padding: 1rem;
    border-radius: 12px;
  }

  .fc .fc-toolbar-title {
    font-size: 1.4rem !important;
  }

  .view-option {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }

  .agendas-filter-container {
    max-height: 200px;
  }

  .agendas-scroll-area {
    max-height: 120px;
  }

  .event-details-header {
    padding: 1rem 1.5rem 0.75rem;
  }

  .event-details-body {
    padding: 0.75rem 1.5rem 1.5rem;
  }

  .event-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .detail-item {
    flex-direction: column;
    gap: 0.5rem;
  }

  .detail-icon {
    align-self: flex-start;
  }
}

@media (max-width: var(--breakpoint-xs)) {
  .timeline-container {
    padding: 0.75rem;
    min-height: 450px;
  }

  #calendar {
    min-height: 400px;
  }

  .fc .fc-toolbar-title {
    font-size: 1.2rem !important;
  }

  .view-options .btn-group {
    flex-direction: column;
    width: 100%;
  }

  .view-option {
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }

  .view-option:last-child {
    border-bottom: none;
  }

  .modal-content {
    width: 95%;
    margin: 1rem;
  }

  .event-details-header,
  .event-details-body {
    padding: 1rem;
  }
}

/* ===== ACESSIBILIDADE ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== TEMA ESCURO  ===== */
@media (prefers-color-scheme: dark) {
  .timeline-container {
    background: linear-gradient(145deg, #1a202c 0%, #2d3748 100%);
    color: #e2e8f0;
  }

  #calendar {
    background: #2d3748;
  }

  .timeline-filters {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
  }

  .fc .fc-toolbar-title {
    color: #e2e8f0;
  }
}
