/* 
=====================================================
  GTT EV Rental — Shared Components Styles
  Includes Modals, Toasts, and Third-party overrides.
=====================================================
*/

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 100%;
  max-width: 500px;
  box-shadow:
    0 28px 60px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(0, 82, 212, 0.06);
  border: 1px solid var(--gray-100);
  animation: modalIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: var(--gradient-primary);
  opacity: 0.9;
}

.modal-wide {
  max-width: 520px;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 1.1rem;
  transition: var(--transition-fast);
}

.modal-close:hover {
  background: var(--accent-red);
  color: var(--white);
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-100);
}

/* ===== Toast / Notification ===== */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.35rem;
  border-radius: var(--radius-lg);
  color: var(--white);
  font-weight: 500;
  z-index: 10000;
  transform: translateY(100px);
  opacity: 0;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  max-width: min(400px, calc(100vw - 2rem));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success { background: var(--accent-green); }
.toast.error { background: var(--accent-red); }
.toast.info { background: var(--primary-600); }

/* ===== FullCalendar Premium Overrides ===== */
#calendar { font-family: var(--font-thai); }
.fc-theme-standard .fc-scrollgrid { border: none !important; }
.fc-theme-standard td, .fc-theme-standard th { border-color: var(--gray-100) !important; }
.fc-col-header-cell {
  padding: 0.85rem 0 !important;
  background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 100%);
  border-bottom: 2px solid var(--gray-200) !important;
}
.fc-col-header-cell-cushion {
  font-weight: 700 !important;
  color: var(--gray-600);
  font-size: 0.85rem;
}
.fc-daygrid-day-number { color: var(--gray-500); font-weight: 500; padding: 0.6rem 0.75rem !important; }
.fc-day-today { background: rgba(67, 100, 247, 0.04) !important; }
.fc-day-today .fc-daygrid-day-number {
  background: var(--primary-600);
  color: var(--white) !important;
  border-radius: 50%;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
}
.fc-event { border: none !important; border-radius: 6px !important; margin: 2px 4px !important; padding: 0 !important; }
.cal-event-card { padding: 5px 8px; line-height: 1.35; border-left: 3px solid transparent; }
.cal-event-name { font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evt-pending { background: #fffbeb; color: #92400e; border-left-color: #f59e0b; }
.evt-confirmed { background: #ecfdf5; color: #065f46; border-left-color: #10b981; }
.evt-returned { background: #eef2ff; color: #3730a3; border-left-color: #6366f1; }
.evt-cancelled { background: #fef2f2; color: #991b1b; border-left-color: #ef4444; }
