/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *
 *= require_tree .
 *= require_self
 */

/* Alpine.js x-cloak to prevent flash of content */
[x-cloak] { display: none !important; }

/* Calendar Base Styles */
.calendar-popover-container {
    position: relative;
}

[data-popover-target="card"] {
    position: absolute;
    z-index: 9999;
    left: 50%;
    transform: translateX(-50%);
    top: 100%;
    margin-top: 5px;
    pointer-events: none;
    max-width: 16rem;
    width: max-content;
    word-wrap: break-word;
    overflow-wrap: break-word;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.fc-event {
    position: relative;
    z-index: 1;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.fc-event:hover {
    z-index: 9998;
}

.fc-daygrid-event-harness {
    position: relative;
}

/* Full Calendar Responsive Overrides */
.fc {
    max-width: 100%;
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
}

.fc .fc-toolbar.fc-header-toolbar {
    margin-bottom: 1.5em;
}

.fc .fc-event-title {
    padding: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mobile Responsive Styles */
@media (max-width: 640px) {
    .fc {
        padding: 0.5rem;
    }

    .fc .fc-toolbar.fc-header-toolbar {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .fc .fc-toolbar-title {
        font-size: 1.2em !important;
        text-align: center;
    }

    .fc .fc-button {
        padding: 0.4em 0.65em !important;
        font-size: 0.9em !important;
    }

    .fc .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
        width: 100%;
        gap: 0.25rem;
    }

    .fc .fc-event {
        font-size: 0.8em !important;
        margin: 1px 0;
    }

    .fc .fc-daygrid-day-frame {
        min-height: 5rem !important;
    }

    [data-popover-target="card"] {
        left: 0;
        right: 0;
        transform: none;
        margin: 0 0.5rem;
        max-width: calc(100% - 1rem);
    }
}

/* Tablet Responsive Styles */
@media (min-width: 641px) and (max-width: 768px) {
    .fc .fc-toolbar-title {
        font-size: 1.4em !important;
    }

    .fc .fc-button {
        padding: 0.5em 0.8em !important;
    }

    .fc .fc-daygrid-day-frame {
        min-height: 6rem !important;
    }
}

/* Touch Device Optimizations */
@media (hover: none) {
    .fc-event:hover {
        background-color: inherit;
    }

    .fc-event:active {
        background-color: rgba(0, 0, 0, 0.1);
    }
}

/* Calendar Event Colors and States */
.fc-event.fc-event-start {
    border-left-width: 3px;
}

.fc-event.fc-event-end {
    border-right-width: 3px;
}

.fc-day-today {
    background-color: rgba(236, 242, 255, 0.7) !important;
}

/* Loading State */
.fc.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Accessibility Improvements */
.fc button:focus {
    outline: 2px solid #4F46E5;
    outline-offset: 2px;
}

/* Client View Specific Background Fixes */
body.client-view {
  overscroll-behavior-y: none;
  overflow-x: hidden;
}

.client-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100vh; 
  z-index: 0;
  background-attachment: fixed;
}

.client-content {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* Enhanced Client Dashboard Styles */
.client-dashboard-card {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.client-dashboard-card:hover {
  background-color: rgba(255, 255, 255, 0.98);
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Smooth animations for client dashboard */
.client-card-transition {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom scrollbar for client views */
.client-content::-webkit-scrollbar {
  width: 8px;
}

.client-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.client-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.client-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Enhanced mobile responsiveness for client dashboard */
@media (max-width: 768px) {
  .client-content {
    padding: 1rem;
  }
  
  .client-dashboard-card {
    margin-bottom: 1rem;
  }
  
  .client-header-spacing {
    margin-bottom: 1.5rem;
  }
}

/* Notifications Mobile Responsive */
@media (max-width: 767px) {
  .desktop-only {
    display: none !important;
  }
}
