/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/*
 * Dashboard-specific styles for Doctor Dashboard
 * Following Healix brand colors (sage, coral, cream, charcoal)
 */

/* Scrollbar Styling */
* {
  scrollbar-width: thin;
  scrollbar-color: #c7d0c7 transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: #c7d0c7;
  border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
  background: #a3b1a3;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes badge-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

.animate-slide-in-right {
  animation: slideInRight 0.5s ease-out forwards;
}

.delay-100 { animation-delay: 0.1s; opacity: 0; }
.delay-200 { animation-delay: 0.2s; opacity: 0; }
.delay-300 { animation-delay: 0.3s; opacity: 0; }
.delay-400 { animation-delay: 0.4s; opacity: 0; }
.delay-500 { animation-delay: 0.5s; opacity: 0; }

/* Live indicator pulse */
.live-pulse {
  position: relative;
}

.live-pulse::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  animation: pulse-ring 1.5s ease-out infinite;
  background: inherit;
}

/* Card hover effects */
.card-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.15);
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #627362 0%, #4d5b4d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Timeline connector */
.timeline-item::before {
  content: '';
  position: absolute;
  left: 23px;
  top: 40px;
  bottom: -16px;
  width: 2px;
  background: #e3e7e3;
}

.timeline-item:last-child::before {
  display: none;
}

/* Progress bar animation */
.progress-bar {
  background: linear-gradient(90deg, #627362 0%, #7d8f7d 50%, #627362 100%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* Notification badge bounce */
.badge-animated {
  animation: badge-bounce 2s ease-in-out infinite;
}

/* Sidebar nav item */
.nav-item {
  position: relative;
  transition: all 0.2s ease;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: linear-gradient(180deg, #627362 0%, #4d5b4d 100%);
  border-radius: 0 3px 3px 0;
}

/* Quick action button */
.quick-action {
  transition: all 0.2s ease;
}

.quick-action:hover {
  transform: scale(1.05);
}

.quick-action:active {
  transform: scale(0.98);
}

/* Stat card gradient borders */
.stat-card {
  position: relative;
  background: white;
  border-radius: 16px;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
}

/* Activity item hover */
.activity-item {
  transition: all 0.2s ease;
}

.activity-item:hover {
  background: #f6f7f6;
}

/* Message preview truncate */
.message-preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Calendar day hover */
.calendar-day {
  transition: all 0.15s ease;
}

.calendar-day:hover:not(.disabled) {
  background: #e3e7e3;
  cursor: pointer;
}

/* Tooltip */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  padding: 6px 10px;
  background: #1f2421;
  color: white;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 100;
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-8px);
}

/* Search focus effect */
.search-input:focus {
  box-shadow: 0 0 0 3px rgba(98, 115, 98, 0.15);
}

/* Priority indicators */
.priority-urgent {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.priority-high {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.priority-normal {
  background: linear-gradient(135deg, #627362 0%, #4d5b4d 100%);
}

/* Mini chart bars */
.chart-bar {
  transition: height 0.5s ease;
}

/* Patient avatar ring */
.avatar-ring {
  box-shadow: 0 0 0 2px white, 0 0 0 4px #627362;
}

/* Responsive sidebar */
@media (max-width: 1024px) {
  .sidebar-expanded {
    transform: translateX(0);
  }
  .sidebar-collapsed {
    transform: translateX(-100%);
  }
}

/* Dashboard layout override - no padding/margin from application layout */
.dashboard-layout {
  margin: 0;
  padding: 0;
}
/* Touch Target Sizing (44x44px minimum for mobile) */
.touch-target {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.touch-target-sm {
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.touch-target-md {
  min-width: 48px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Safe Area Support for iOS notches and gesture bars */
.safe-area-x {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.safe-area-top {
  padding-top: env(safe-area-inset-top);
}

.safe-area-bottom {
  padding-bottom: env(safe-area-inset-bottom);
}

/* ============================================================================
   Optimistic Message Updates
   Styles for pending/sending and error states in chat messages
   ============================================================================ */

/* Base optimistic message - pending state */
.optimistic-message {
  transition: opacity 0.2s ease-out;
}

/* Error state for failed messages */
.optimistic-message-error {
  opacity: 1 !important;
  position: relative;
  border-left: 3px solid #ef4444; /* coral-500 */
}

/* Error indicator styling */
.optimistic-message-error .sending-indicator {
  color: #ef4444; /* coral-500 */
}

.optimistic-message-error .sending-indicator span[data-optimistic-status] {
  color: #ef4444; /* coral-500 */
  font-weight: 500;
}

/* Retry hint on hover */
.optimistic-message.cursor-pointer:hover {
  transform: scale(1.01);
  transition: transform 0.15s ease;
}

/* Animation for sending spinner */
@keyframes message-sending-pulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.4;
  }
}

.optimistic-message[data-pending="true"] > div > div {
  animation: message-sending-pulse 1.5s ease-in-out infinite;
}
