/* ============================================
   APPOINTMENTS PAGE - MODERN DESIGN SYSTEM
   ============================================ */

/* === CUSTOM PROPERTIES === */
:root {
  --appointment-confirmed: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --appointment-completed: linear-gradient(135deg, #06b6d4 0%, #10b981 100%);
  --appointment-cancelled: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
  --appointment-pending: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* === APPOINTMENTS LIST === */
.appointments-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: fadeInUp 0.6s ease-out;
}

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

/* === APPOINTMENT CARD === */
.appointment-card {
  position: relative;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 0;
  overflow: hidden;
  transition: all var(--transition-slow);
  animation: slideInScale 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.appointment-card:nth-child(1) { animation-delay: 0ms; }
.appointment-card:nth-child(2) { animation-delay: 50ms; }
.appointment-card:nth-child(3) { animation-delay: 100ms; }
.appointment-card:nth-child(4) { animation-delay: 150ms; }
.appointment-card:nth-child(5) { animation-delay: 200ms; }

@keyframes slideInScale {
  from {
    opacity: 0;
    transform: translateX(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.appointment-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--appointment-confirmed);
  transition: width var(--transition-base);
}

.appointment-card.status-confirmed::before {
  background: var(--appointment-confirmed);
}

.appointment-card.status-completed::before {
  background: var(--appointment-completed);
}

.appointment-card.status-cancelled::before {
  background: var(--appointment-cancelled);
}

.appointment-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-xl);
  border-color: #cbd5e1;
}

.appointment-card:hover::before {
  width: 8px;
}

/* === APPOINTMENT HEADER === */
.appointment-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.75rem 2rem;
  border-bottom: 1px solid #f3f4f6;
  background: linear-gradient(135deg, #fafbfc 0%, #ffffff 100%);
  gap: 1.5rem;
}

.appointment-time {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.appointment-date {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.01em;
}

.appointment-date::before {
  content: '';
  display: inline-block;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 0.75rem;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.appointment-date::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 3px;
  left: 12px;
  top: 12px;
  box-shadow: 
    0 6px 0 -4px white,
    0 12px 0 -8px white;
}

.appointment-time-slot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  color: #6b7280;
  font-weight: 500;
  padding-left: 3rem;
}

.appointment-time-slot::before {
  content: '🕐';
  font-size: 1rem;
}

.appointment-duration {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  background: #f3f4f6;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  color: #6b7280;
  font-weight: 600;
}

/* === APPOINTMENT STATUS === */
.appointment-status {
  position: relative;
  padding: 0.625rem 1.25rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: white;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  overflow: hidden;
  flex-shrink: 0;
}

.appointment-status::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
  transition: left var(--transition-slow);
}

.appointment-status:hover::before {
  left: 100%;
}

.status-confirmed {
  background: var(--appointment-confirmed);
  animation: pulseConfirmed 2s ease-in-out infinite;
}

.status-completed {
  background: var(--appointment-completed);
}

.status-cancelled {
  background: var(--appointment-cancelled);
}

.status-pending {
  background: var(--appointment-pending);
}

@keyframes pulseConfirmed {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  }
  50% {
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.6);
  }
}

/* === APPOINTMENT DETAILS === */
.appointment-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 1rem;
  padding: 1.75rem 2rem;
  background: white;
}

.appointment-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1.125rem;
  background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
  border-radius: 0.75rem;
  border: 1px solid #f3f4f6;
  transition: all var(--transition-base);
}

.appointment-detail-row:hover {
  background: linear-gradient(135deg, #f3f4f6 0%, #f9fafb 100%);
  border-color: #e5e7eb;
  transform: translateX(4px);
}

.appointment-detail-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 100px;
  font-weight: 600;
  color: #6b7280;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Replace emoji icons with CSS icons */
.appointment-detail-label::before {
  content: '';
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 0.375rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Custom icon styles based on label text */
.appointment-detail-row:has(.appointment-detail-label:contains("Name")) .appointment-detail-label::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z' /%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z' /%3E%3C/svg%3E") center/contain no-repeat;
}

.appointment-detail-value {
  flex: 1;
  color: #111827;
  font-size: 0.9375rem;
  font-weight: 500;
  word-break: break-word;
  line-height: 1.5;
}

.appointment-detail-value a {
  color: #6366f1;
  text-decoration: none;
  font-weight: 600;
  position: relative;
  transition: all var(--transition-base);
}

.appointment-detail-value a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transition: width var(--transition-base);
}

.appointment-detail-value a:hover {
  color: #4f46e5;
}

.appointment-detail-value a:hover::after {
  width: 100%;
}

/* === APPOINTMENT ACTIONS === */
.appointment-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, #fafbfc 0%, #ffffff 100%);
  border-top: 1px solid #f3f4f6;
}

.btn-action-small {
  position: relative;
  padding: 0.75rem 1.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 0.625rem;
  overflow: hidden;
  transition: all var(--transition-base);
  cursor: pointer;
  border: none;
}

.btn-action-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-action-danger::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-action-danger:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.btn-action-danger:hover:not(:disabled)::before {
  width: 300px;
  height: 300px;
}

.btn-action-danger:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.btn-action-danger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  background: #9ca3af;
  box-shadow: none;
}

/* === STATS CARDS ENHANCEMENT === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  position: relative;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 1.75rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: all var(--transition-slow);
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.stat-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: #cbd5e1;
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.15);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-icon {
  position: relative;
  font-size: 2.5rem;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(99, 102, 241, 0.2));
  transition: transform var(--transition-spring);
  z-index: 1;
}

.stat-card:hover .stat-icon {
  transform: scale(1.15) rotate(-5deg);
}

.stat-content {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  z-index: 1;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #111827 0%, #4b5563 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.stat-label {
  font-size: 0.8125rem;
  color: #6b7280;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* === PAGE HEADER ENHANCEMENT === */
.agent-detail-header {
  position: relative;
  padding: 2rem 0;
  margin-bottom: 2.5rem;
}

.agent-detail-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, #e5e7eb 20%, #e5e7eb 80%, transparent 100%);
}

.agent-detail-title {
  background: linear-gradient(135deg, #111827 0%, #4b5563 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: slideInRight 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* === SECTION TITLE ENHANCEMENT === */
.section-title {
  position: relative;
  display: inline-block;
  padding-left: 1.25rem;
  margin-bottom: 1.75rem;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 70%;
  background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
  border-radius: 2px;
}

/* === EMPTY STATE ENHANCEMENT === */
.empty-state {
  position: relative;
  text-align: center;
  padding: 5rem 2rem;
  background: linear-gradient(135deg, #fafbfc 0%, #ffffff 100%);
  border-radius: 1.5rem;
  border: 2px dashed #e5e7eb;
  overflow: hidden;
  animation: fadeInScale 0.6s ease-out;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.empty-state::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.5;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.8;
  }
}

.empty-state-icon {
  position: relative;
  font-size: 5rem;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.2));
  animation: float 3s ease-in-out infinite;
  z-index: 1;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.empty-state-title {
  position: relative;
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.75rem;
  z-index: 1;
}

.empty-state-description {
  position: relative;
  font-size: 1.125rem;
  color: #6b7280;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
  z-index: 1;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
  .appointment-header {
    flex-direction: column;
    padding: 1.5rem;
  }

  .appointment-date {
    font-size: 1.125rem;
  }

  .appointment-details {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }

  .appointment-actions {
    padding: 1.25rem 1.5rem;
  }

  .btn-action-small {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .stat-card {
    padding: 1.5rem;
  }

  .appointment-detail-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .appointment-detail-label {
    min-width: auto;
  }
}

/* === ACCESSIBILITY ENHANCEMENTS === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* === PRINT STYLES === */
@media print {
  .appointment-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #000;
  }

  .appointment-actions,
  .btn-action-danger {
    display: none;
  }
}
