/* Global Styles */
body {
  font-family: "Inter", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom utility class to fix Handsontable/Calendar layout height */
/* (Calculates 100vh minus the 72px header height) */
.h-screen-minus-header {
  min-height: calc(100vh - 72px);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

/* Custom Scrollbar for a premium feel */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}


/* Login Page Styles */
.auth-card {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
  /* To contain the background graphic */
  backdrop-filter: blur(10px);
  /* Glassmorphism effect if bg is transparent */
}

.auth-card-bg {
  position: absolute;
  top: -20%;
  left: -20%;
  width: 140%;
  height: 140%;
  background-image: radial-gradient(circle at 100% 100%, #e0f2fe 0%, #dbeafe 25%, #bfdbfe 50%, #93c5fd 75%, #60a5fa 100%);
  opacity: 0.3;
  z-index: 1;
  animation: spin 20s linear infinite;
}

.auth-form-container {
  position: relative;
  z-index: 2;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* FullCalendar Button Theme */
.fc-button-primary {
  background-color: #2563eb !important;
  /* blue-600 */
  border-color: #2563eb !important;
  opacity: 1 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
}

.fc-button-primary:hover {
  background-color: #1d4ed8 !important;
  /* blue-700 */
  border-color: #1d4ed8 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.fc .fc-toolbar-title {
  font-size: 1.5rem !important;
  /* text-2xl */
  font-weight: 600 !important;
  /* font-semibold */
  color: #1e293b;
  /* slate-800 */
}

/* --- Modal Override --- */
/* We use !important to override the inline 'hidden' class when we add 'flex' */
#editModal.flex,
#generateModal.flex {
  display: flex !important;
}

/* Calendar Event Colors & Hover */
.fc-event {
  background-color: #3b82f6 !important;
  /* blue-500 */
  border-color: #2563eb !important;
  /* blue-600 */
  transition: all 0.2s ease-in-out;
  border-radius: 4px;
  padding: 1px 2px;
  /* Minimum padding */
}

/* Alternating event color */


/* This styles the title (the employee's name) */
.fc-event-title {
  flex-grow: 1;
  /* Lets it take up the extra space */
  text-align: left;
  /* Pushes the text to the right side */
  font-weight: 500;

  /* Allow text to wrap so the full name is visible */
  /* Avoid forcing a new line */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.75rem;
  order: 1;
  /* Move Name to RIGHT position but flowing naturally */
  text-align: left;
  /* Ensure name aligns to the right side */

  margin-left: 0;
  padding-right: 0;
  margin-top: 0;
}

/* Allow the time to wrap as well */
/* Allow the time to stay on one line */
.fc-event-time {
  white-space: nowrap;
  flex-shrink: 0;
  /* meaningful time shouldn't shrink */
  font-weight: 600;
  font-size: 0.7rem;
  /* Make time slightly smaller/compact */
  order: 2;
  /* Move Time to RIGHT */
}

/* Ensure nothing spills out of the event frame */
.fc-event-main-frame {
  overflow: hidden;
  flex-direction: row;
  /* Side-by-side */
  align-items: center;
  /* Align vertically */
  justify-content: flex-start;
  gap: 4px;
  /* Small consistent gap */
  padding: 0 1px;
}

/* Safety for flexbox scrolling - MOBILE ONLY */
@media (max-width: 767px) {

  html,
  body {
    height: auto !important;
    overflow: auto !important;
  }

  main,
  .flex-1,
  #calendar {
    min-height: auto !important;
  }

  /* Hide event time on mobile to prevent overflow */
  .fc-event-time {
    display: none;
  }
}

/* --- ROLE BASED VISIBILITY (Instant Load) --- */
.manager-only {
  display: none !important;
}

.manager-mode .manager-only {
  display: flex !important;
}

.employee-only {
  display: none !important;
}

.employee-mode .employee-only {
  display: flex !important;
}
