/* Custom styles and enhancements for Leave Management System */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --font-heading: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter', sans-serif;
}

body {
  font-family: var(--font-body);
  background-color: #f8fafc;
  color: #0f172a;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: var(--font-heading);
}

/* Calendar Grid Customizations */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-cell {
  min-height: 110px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

@media (max-width: 768px) {
  .calendar-cell {
    min-height: 80px;
  }
}

.calendar-cell:hover .date-add-btn {
  opacity: 1;
}

.calendar-cell.is-today {
  background-color: #f0fdf4;
}

.calendar-cell.is-holiday {
  background-color: #fff1f2;
}

.calendar-cell.is-holiday.other-month {
  background-color: #fff5f5;
  opacity: 0.6;
}

.calendar-cell.other-month {
  background-color: #f8fafc;
  opacity: 0.55;
}

/* Scrollbar styles */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Modal animation */
.modal-backdrop {
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  animation: scaleIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  animation: slideUp 0.25s ease-out forwards;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Leave event chip styling */
.leave-chip {
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  touch-action: manipulation;
}

.leave-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* ================= Mobile Browser Optimizations ================= */

/* Hide scrollbar for smooth horizontal tab navigation */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Touch responsiveness */
button, select, input, a, .calendar-cell {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 640px) {
  /* Prevent iOS Safari from zooming in on input focus */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="date"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Responsive calendar cell minimum height */
  .calendar-cell {
    min-height: 82px;
    padding: 0.35rem;
  }

  /* Mobile bottom-sheet modal presentation */
  .modal-backdrop {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .modal-content {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 1.5rem !important;
    border-top-right-radius: 1.5rem !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    width: 100% !important;
    animation: slideUpModal 0.25s ease-out !important;
  }

  @keyframes slideUpModal {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  /* Reposition toasts for mobile visibility */
  #toast-container {
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    align-items: center;
  }

  .toast {
    width: 100%;
    max-width: 22rem;
  }

  /* Compact holiday chip for mobile */
  .holiday-chip {
    font-size: 10px !important;
    padding: 2px 4px !important;
    line-height: 1.2 !important;
  }

  .leave-chip {
    font-size: 10px !important;
    padding: 2px 4px !important;
  }
}

