/* FullCalendar Beautiful Color Harmony - Subtle Version */
.fc {
  @apply font-sans text-slate-900;
  --fc-border-color: rgb(226 232 240);
  --fc-button-text-color: rgb(71 85 105);
  --fc-button-bg-color: rgb(255 255 255);
  --fc-button-border-color: rgb(203 213 225);
  --fc-button-hover-bg-color: rgb(248 250 252);
  --fc-button-hover-border-color: rgb(148 163 184);
  --fc-button-active-bg-color: rgb(100 116 139);
  --fc-button-active-border-color: rgb(100 116 139);
  --fc-today-bg-color: rgb(248 250 252);
}

/* Enhanced Toolbar styling with subtle colors */
.fc .fc-toolbar {
  @apply mb-6 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between;
  padding: 0;
}

/* Mobile toolbar layout improvements */
@media (max-width: 640px) {
  .fc .fc-toolbar {
    gap: 1rem;
  }
}

.fc .fc-toolbar-title {
  @apply text-xl font-bold tracking-tight text-slate-900 sm:text-2xl;
  margin: 0;
  background: linear-gradient(135deg, #1E293B 0%, #475569 50%, #64748B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.fc .fc-button-group {
  @apply flex overflow-hidden rounded-xl shadow-sm ring-1 ring-slate-200/50;
  background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 100%);
}

.fc .fc-button {
  @apply relative inline-flex items-center border-0 bg-transparent px-4 py-2.5 text-sm font-medium text-slate-600 transition-all duration-300 hover:bg-slate-50 hover:text-slate-700 focus:z-10 focus:outline-none focus:ring-2 focus:ring-slate-400;
  margin: 0 !important;
  border-radius: 0 !important;
  position: relative;
}

.fc .fc-button:not(:last-child) {
  @apply border-r border-slate-200/50;
}

.fc .fc-button:hover {
  background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
  transform: translateY(-1px);
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background: linear-gradient(135deg, #94A3B8 0%, #64748B 100%);
  @apply text-white shadow-sm;
  transform: translateY(0);
  border-color: #64748B !important;
  box-shadow: 0 1px 2px rgba(71, 85, 105, 0.1);
}

.fc .fc-button-primary:not(:disabled).fc-button-active:hover,
.fc .fc-button-primary:not(:disabled):active:hover {
  background: linear-gradient(135deg, #64748B 0%, #475569 100%);
  @apply text-white;
  box-shadow: 0 2px 4px rgba(71, 85, 105, 0.15);
}

.fc .fc-button-primary:not(:disabled).fc-button-active:focus,
.fc .fc-button-primary:not(:disabled):active:focus {
  @apply ring-2 ring-slate-300 ring-offset-2;
  outline: none;
}

.fc .fc-button-primary:disabled {
  @apply cursor-not-allowed opacity-50;
}

.fc .fc-toolbar-chunk {
  @apply flex items-center gap-3;
}

/* Beautiful Month view styling with subtle colors */
.fc .fc-daygrid-day {
  @apply transition-all duration-300;
  background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 100%);
}

.fc .fc-daygrid-day:hover {
  background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
}

.fc .fc-daygrid-day.fc-day-today {
  background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 50%, #E2E8F0 100%);
  @apply ring-1 ring-slate-200;
}

.fc .fc-daygrid-day-number {
  @apply p-2 text-sm font-bold text-slate-700;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
  @apply text-slate-800;
  text-shadow: 0 1px 2px rgba(71, 85, 105, 0.1);
}

.fc .fc-daygrid-day.fc-day-past .fc-daygrid-day-number {
  @apply text-slate-400;
}

.fc .fc-daygrid-day.fc-day-other {
  background: linear-gradient(135deg, #F1F5F9 0%, #E2E8F0 100%);
}

.fc .fc-daygrid-day.fc-day-other .fc-daygrid-day-number {
  @apply text-slate-300;
}

.fc .fc-daygrid-day-events {
  @apply mt-1 px-1;
  min-height: 1.5rem;
}

/* Subtle Event styling - preserve backend colors */
.fc .fc-event {
  @apply cursor-pointer overflow-hidden rounded-lg border-0 shadow-sm transition-all duration-300 hover:shadow-md;
  font-size: 0.8125rem;
  line-height: 1.2;
  /* Let backend provide the background color */
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.fc .fc-event:hover {
  @apply scale-[1.02];
  z-index: 10;
  /* Don't override background on hover */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px) scale(1.02);
  filter: brightness(0.9);
}

.fc .fc-event:focus,
.fc .fc-event:focus-visible {
  @apply outline-none ring-2 ring-indigo-300 ring-offset-2;
}

.fc .fc-event-title {
  @apply font-semibold text-white;
  padding: 0.375rem 0.75rem;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.fc .fc-event-time {
  @apply hidden;
}

/* Custom event styling - preserve backend colors */
.fc .custom-event {
  /* Don't override background - let backend colors show through */
  border: 1px solid rgba(129, 140, 248, 0.25);
  color: white !important;
  position: relative;
  overflow: hidden;
}

.fc .custom-event:hover {
  /* Don't override background on hover - preserve status colors */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  filter: brightness(0.9); /* Darken slightly on hover */
}

.fc .custom-event .fc-event-title {
  @apply font-semibold text-white;
  position: relative;
  z-index: 2;
}

.fc .custom-event .fc-event-status {
  @apply text-xs text-white/90;
  font-style: italic;
  padding: 0 0.75rem 0.375rem;
  position: relative;
  z-index: 2;
}

/* Enhanced List view styling with lighter colors */
.fc-list {
  @apply overflow-hidden rounded-xl border-0;
  background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 100%);
}

.fc-list-day {
  background: linear-gradient(135deg, #F1F5F9 0%, #E2E8F0 100%);
}

.fc-list-day-cushion {
  @apply px-4 py-3 text-sm font-bold text-slate-800;
}

.fc-list-event {
  @apply transition-all duration-300 cursor-pointer;
  border-bottom: 1px solid rgb(226 232 240);
  background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 100%);
}

.fc-list-event:hover {
  background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
  transform: translateX(4px);
  box-shadow: 0 2px 4px rgba(71, 85, 105, 0.1);
}

.fc-list-event:active {
  transform: translateX(2px);
  box-shadow: 0 1px 2px rgba(71, 85, 105, 0.1);
}

.fc-list-event-dot {
  @apply rounded-full border-2;
  /* Inherit colors from the event */
  width: 10px !important;
  height: 10px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.fc-list-event-time {
  @apply text-sm font-semibold text-slate-600;
}

.fc-list-event-title {
  @apply text-sm font-semibold text-slate-900;
}

.fc-list-event-graphic {
  @apply flex items-center px-4 py-3;
}

/* List view specific styling */
.fc-list-event .fc-event-content-wrapper {
  @apply flex-col items-start gap-1;
  padding: 0.75rem 1rem;
}

.fc-list-event .fc-event-title-primary {
  @apply text-slate-900 font-semibold;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.fc-list-event:hover .fc-event-title-primary,
.fc-list-event:hover .fc-event-status-badge {
  @apply text-black !important;
  color: black !important;
}

.fc-list-event .fc-event-status-badge {
  margin-left: 0;
  margin-top: 0.25rem;
}

/* Enhanced More events indicator with subtle styling */
.fc-daygrid-more-link {
  @apply mx-1 rounded-lg px-2 py-1 text-xs font-bold text-slate-600 transition-all duration-200;
  background: linear-gradient(135deg, #E2E8F0 0%, #CBD5E1 100%);
}

.fc-daygrid-more-link:hover {
  background: linear-gradient(135deg, #CBD5E1 0%, #94A3B8 100%);
  @apply text-slate-700;
  transform: translateY(-1px);
}

/* Today button with subtle styling */
.fc .fc-today-button {
  background: linear-gradient(135deg, #F1F5F9 0%, #E2E8F0 100%) !important;
  @apply text-slate-700 shadow-md;
}

.fc .fc-today-button:hover {
  background: linear-gradient(135deg, #E2E8F0 0%, #CBD5E1 100%) !important;
}

/* Navigation buttons with subtle colors */
.fc .fc-prev-button,
.fc .fc-next-button {
  background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 100%);
  @apply text-slate-700;
}

/* Status indicators with subtle colors */
.fc-event-status-indicator.fc-event-status-pending {
  @apply bg-amber-200;
}

.fc-event-status-indicator.fc-event-status-progress {
  @apply bg-slate-300;
}

.fc-event-status-indicator.fc-event-status-completed {
  @apply bg-emerald-200;
}

.fc-event-status-indicator.fc-event-status-blocked {
  @apply bg-rose-200;
}

.fc-event-status-indicator.fc-event-status-cancelled {
  @apply bg-stone-200;
}

/* Status badges with subtle colors */
.fc-event-status-badge.fc-event-status-pending {
  @apply bg-amber-50 text-amber-700 ring-1 ring-amber-200;
}

.fc-event-status-badge.fc-event-status-progress {
  @apply bg-slate-50 text-slate-700 ring-1 ring-slate-200;
}

.fc-event-status-badge.fc-event-status-completed {
  @apply bg-emerald-50 text-emerald-700 ring-1 ring-emerald-200;
}

.fc-event-status-badge.fc-event-status-blocked {
  @apply bg-rose-50 text-rose-700 ring-1 ring-rose-200;
}

.fc-event-status-badge.fc-event-status-cancelled {
  @apply bg-stone-50 text-stone-700 ring-1 ring-stone-200;
}

/* Event color variations removed to preserve backend status colors */

/* Enhanced Popover styling with larger size */
.fc-popover {
  @apply overflow-hidden rounded-xl border border-slate-200 shadow-2xl;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.95);
  min-width: 320px;
  max-width: 480px;
  min-height: 200px;
  max-height: 500px;
}

.fc-popover-header {
  @apply border-b border-slate-100 px-6 py-4;
  background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
}

.fc-popover-title {
  @apply text-base font-bold text-slate-900;
  margin: 0;
}

.fc-popover-body {
  background: rgba(255, 255, 255, 0.98);
  padding: 1rem;
  max-height: 400px;
  overflow-y: auto;
}

.fc-popover-close {
  @apply text-slate-400 hover:text-slate-600;
  transition: all 0.2s ease;
  width: 24px;
  height: 24px;
  font-size: 18px;
}

/* Enhanced event styling within popover */
.fc-popover .fc-event {
  @apply mb-3 rounded-lg p-3 shadow-sm;
  min-height: 48px;
  display: flex;
  align-items: center;
}

.fc-popover .fc-event-title-primary {
  @apply text-sm font-semibold leading-relaxed;
  line-height: 1.4;
}

.fc-popover .fc-event-content-wrapper {
  @apply flex-col items-start gap-2;
  padding: 0;
}

.fc-popover .fc-event-status-badge {
  margin-left: 0;
  margin-top: 0.5rem;
}

/* Responsive popover sizing */
@media (max-width: 640px) {
  .fc-popover {
    min-width: 280px;
    max-width: calc(100vw - 2rem);
    max-height: 70vh;
  }
  
  .fc-popover-header {
    @apply px-4 py-3;
  }
  
  .fc-popover-title {
    @apply text-sm;
  }
  
  .fc-popover-body {
    padding: 0.75rem;
    max-height: calc(70vh - 4rem);
  }
}

@media (max-width: 480px) {
  .fc-popover {
    min-width: 260px;
    max-height: 60vh;
  }
  
  .fc-popover-body {
    max-height: calc(60vh - 3rem);
  }
}

/* Event content enhancement with proper text hierarchy */
.fc-event-main-frame {
  @apply relative h-full;
  padding: 0;
  display: flex;
  align-items: center;
}

.fc-event-content-wrapper {
  @apply flex items-center justify-between w-full min-w-0;
  padding: 0.375rem 0.75rem;
  gap: 0.5rem;
}

.fc-event-title-primary {
  @apply block font-semibold leading-tight text-white flex-1 min-w-0;
  font-size: 0.8125rem;
  line-height: 1.2;
  word-break: break-word;
  overflow-wrap: break-word;
  transition: all 0.2s ease;
}

/* Status indicators for month/week view */
.fc-event-status-indicator {
  @apply flex-shrink-0 w-2 h-2 rounded-full;
  margin-left: 0.25rem;
}

.fc-event-status-indicator.fc-event-status-pending {
  @apply bg-amber-200;
}

.fc-event-status-indicator.fc-event-status-progress {
  @apply bg-slate-300;
}

.fc-event-status-indicator.fc-event-status-completed {
  @apply bg-emerald-200;
}

.fc-event-status-indicator.fc-event-status-blocked {
  @apply bg-rose-200;
}

.fc-event-status-indicator.fc-event-status-cancelled {
  @apply bg-stone-200;
}

/* Status badges for list view */
.fc-event-status-badge {
  @apply inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium flex-shrink-0;
  margin-left: 0.5rem;
}

.fc-event-status-badge.fc-event-status-pending {
  @apply bg-amber-50 text-amber-700 ring-1 ring-amber-200;
}

.fc-event-status-badge.fc-event-status-progress {
  @apply bg-slate-50 text-slate-700 ring-1 ring-slate-200;
}

.fc-event-status-badge.fc-event-status-completed {
  @apply bg-emerald-50 text-emerald-700 ring-1 ring-emerald-200;
}

.fc-event-status-badge.fc-event-status-blocked {
  @apply bg-rose-50 text-rose-700 ring-1 ring-rose-200;
}

.fc-event-status-badge.fc-event-status-cancelled {
  @apply bg-stone-50 text-stone-700 ring-1 ring-stone-200;
}

/* Tooltip indicator for truncated text */
.fc-event-title-tooltip {
  @apply text-white/70 text-xs font-bold flex-shrink-0;
  margin-left: 0.25rem;
}

/* Responsive text handling */
@media (max-width: 640px) {
  .fc .fc-toolbar {
    @apply flex-col gap-3;
  }
  
  .fc .fc-toolbar-chunk {
    @apply w-full;
  }
  
  /* Specific spacing for mobile toolbar layout */
  .fc .fc-toolbar-chunk:first-child {
    @apply flex justify-between items-center px-2;
  }
  
  .fc .fc-toolbar-chunk:nth-child(2) {
    @apply flex justify-center px-4;
  }
  
  .fc .fc-toolbar-chunk:last-child {
    @apply flex justify-center;
  }
  
  .fc .fc-button {
    @apply px-3 py-2 text-xs;
    min-width: 2.5rem;
  }
  
  .fc .fc-toolbar-title {
    @apply text-lg text-center;
    flex: 1;
    margin: 0 1rem;
    word-break: break-word;
    hyphens: auto;
  }
  
  .fc-daygrid-event {
    @apply mx-0.5 text-xs;
  }
  
  .fc-event-content-wrapper {
    padding: 0.25rem 0.5rem;
    gap: 0.25rem;
  }
  
  .fc-event-title-primary {
    font-size: 0.75rem;
    line-height: 1.1;
  }
  
  .fc-event-status-indicator {
    @apply w-1.5 h-1.5;
  }
  
  .fc-event-status-badge {
    @apply px-1.5 py-0.5 text-xs;
  }
}

@media (max-width: 480px) {
  .fc .fc-toolbar-title {
    @apply text-base;
    margin: 0 0.75rem;
    font-size: 0.875rem;
  }
  
  .fc .fc-button {
    @apply px-2 py-1.5 text-xs;
    min-width: 2rem;
    font-size: 0.75rem;
  }
  
  .fc .fc-toolbar-chunk:nth-child(2) {
    @apply px-2;
  }
  
  .fc-event-content-wrapper {
    padding: 0.125rem 0.375rem;
  }
  
  .fc-event-title-primary {
    font-size: 0.6875rem;
    line-height: 1;
  }
  
  /* Hide status indicators on very small screens to save space */
  .fc-event-status-indicator {
    @apply hidden;
  }
}

/* Loading and error states with beautiful styling */
[data-calendar-target="loading"] {
  backdrop-filter: blur(12px);
}

[data-calendar-target="error"] {
  @apply animate-slide-in-from-top;
}

@keyframes slide-in-from-top {
  from { 
    opacity: 0; 
    transform: translateY(-1rem) scale(0.95); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
}

.animate-slide-in-from-top {
  animation: slide-in-from-top 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Accessibility improvements */
@media (prefers-contrast: high) {
  .fc .fc-event {
    @apply border-2 border-slate-900;
  }
  
  .fc .custom-event {
    background: #000000 !important;
    border-color: #000000 !important;
    color: white !important;
  }
  
  .fc .fc-daygrid-day.fc-day-today {
    @apply bg-yellow-100 outline outline-2 outline-yellow-600;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .fc .fc-event {
    transition: none;
  }
  
  .fc-daygrid-more-link {
    transition: none;
  }
  
  .animate-slide-in-from-top {
    animation: none;
  }
  
  .fc .fc-event:hover {
    transform: none;
  }
  
  .fc .fc-button:hover {
    transform: none;
  }
}

/* Enhanced focus indicators */
.fc .fc-event:focus-visible {
  @apply outline-2 outline-offset-2 outline-teal-400;
}

.fc .fc-button:focus-visible {
  @apply outline-2 outline-offset-2 outline-blue-500;
}

.fc .fc-daygrid-more-link:focus-visible {
  @apply outline-2 outline-offset-2 outline-blue-500;
}

/* Print optimizations */
@media print {
  .fc .fc-toolbar {
    @apply mb-4 text-black;
  }
  
  .fc .fc-event {
    @apply border border-slate-600 bg-slate-100 text-slate-900 shadow-none;
  }
  
  .fc .custom-event {
    background-color: #e2e8f0 !important;
    border-color: #64748b !important;
    color: #1e293b !important;
  }
  
  .fc .fc-daygrid-day.fc-day-today {
    @apply bg-slate-100;
  }
  
  .fc-event-title-primary {
    @apply text-slate-900 font-semibold;
    text-shadow: none;
  }
  
  .fc-event-status-badge {
    @apply border border-slate-300;
  }
  
  .fc-event-status-indicator {
    @apply border border-slate-400;
  }
}

/* Calendar container optimization */
.fc-theme-standard,
.fc-theme-standard .fc-view-harness {
  height: 100%;
}

.fc-scrollgrid {
  border: none;
}

.fc-scrollgrid-section-header > td {
  @apply border-0;
}

/* Beautiful scrollbar styling */
.fc-scroller::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.fc-scroller::-webkit-scrollbar-track {
  background: linear-gradient(135deg, #F1F5F9 0%, #E2E8F0 100%);
  @apply rounded-full;
}

.fc-scroller::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #CBD5E1 0%, #94A3B8 100%);
  @apply rounded-full;
}

.fc-scroller::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #94A3B8 0%, #64748B 100%);
}

/* Micro-interactions */
.fc .fc-button {
  transform: translateY(0);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.fc .fc-button:active {
  transform: translateY(1px) scale(0.98);
}

/* Special border utilities */
.border-3 {
  border-width: 3px;
}

/* Enhanced hover states for better text reveal */
.fc .fc-event:hover .fc-event-title-primary {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.fc .fc-event:hover .fc-event-status-indicator {
  @apply scale-110;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3);
}

/* Improved text contrast for better readability */
.fc .custom-event .fc-event-title-primary {
  @apply text-white font-semibold;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

/* Better text wrapping for longer titles */
.fc-daygrid-event .fc-event-title-primary {
  @apply leading-tight;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* List view gets more lines for longer text */
.fc-list-event .fc-event-title-primary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Focus states for accessibility */
.fc .fc-event:focus-visible .fc-event-title-primary {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 1px;
  border-radius: 2px;
}

/* Print styles for text clarity */
@media print {
  .fc-event-title-primary {
    @apply text-slate-900 font-semibold;
    text-shadow: none;
  }
  
  .fc-event-status-badge {
    @apply border border-slate-300;
  }
  
  .fc-event-status-indicator {
    @apply border border-slate-400;
  }
} 
