/* Modern Clinic App Styles - Updated UI */

:root {
  /* Modern elegant color palette */
  --primary-color: #2563eb;      /* Stronger blue */
  --primary-hover: #1d4ed8;      /* Darker blue for hover */
  --secondary-color: #4f46e5;    /* Rich indigo */
  --accent-color: #06b6d4;       /* Vibrant cyan */
  --success-color: #10b981;      /* Emerald green */
  --warning-color: #f59e0b;      /* Amber */
  --danger-color: #ef4444;       /* Clear red */
  --light-color: #f8fafc;        /* Brighter background */
  --dark-color: #0f172a;         /* Deeper text color */
  --gray-color: #64748b;         /* Slate gray */
  
  /* UI Elements */
  --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --card-shadow-hover: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --transition-speed: 0.3s;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  --gradient-accent: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

body {
  background-color: #f8fafc;
  color: var(--dark-color);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Elegant Card Design */
.card { 
  border-radius: 1rem;
  border: none;
  box-shadow: var(--card-shadow);
  transition: all var(--transition-speed) ease;
  overflow: hidden;
  background-color: white;
  backdrop-filter: blur(10px);
}

.card-header {
  background-color: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--dark-color);
}

/* Modern Form Styles */
.form-control, .form-select { 
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: all var(--transition-speed) ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  font-size: 0.95rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.form-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--dark-color);
}

.form-control::placeholder {
  color: var(--gray-color);
  opacity: 0.7;
}

.done {
  text-decoration: line-through;
  opacity: 0.7;
}

.card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: translateY(-2px);
}

.card-header {
  background-color: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1.25rem 1.5rem;
  font-weight: 600;
}

.card-body {
  padding: 1.5rem;
}

.stats-card {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border-radius: 1rem;
  position: relative;
  overflow: hidden;
}

.stats-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  z-index: 0;
}

.stats-card .card-body {
  padding: 1.75rem;
  position: relative;
  z-index: 1;
}

.metric-card {
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
  color: white;
  border-radius: 1rem;
  transition: all var(--transition-speed) ease;
  position: relative;
  overflow: hidden;
}

.metric-card-danger {
  background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
  color: white;
  border-radius: 1rem;
  transition: all var(--transition-speed) ease;
  position: relative;
  overflow: hidden;
}

.metric-card::after, .metric-card-danger::after {
  content: '';
  position: absolute;
  bottom: -30%;
  right: -30%;
  width: 80%;
  height: 80%;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.metric-card:hover, .metric-card-danger:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
}

/* Modern Table Styles */
.table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.table th {
  font-weight: 600;
  color: var(--dark-color);
  border-bottom: 2px solid rgba(0, 0, 0, 0.05);
  padding: 1rem;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  vertical-align: middle;
}

.table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.01);
}

.table-responsive {
  border-radius: 0.5rem;
  overflow: hidden;
}

.reservation-table tr.done td {
  text-decoration: line-through;
  opacity: 0.6;
}

.reservation-table tr.cancelled td {
  text-decoration: line-through;
  color: var(--danger-color);
  opacity: 0.8;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
}

/* Modern Elegant Button Styles */
.btn {
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  border-radius: 0.5rem;
  transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
  opacity: 0;
  transition: opacity var(--transition-speed) ease;
}

.btn:hover::after {
  opacity: 1;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-gradient {
  background: var(--gradient-primary);
  border: none;
  color: white;
  position: relative;
  z-index: 1;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.btn-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
  opacity: 0;
  z-index: -1;
  transition: opacity var(--transition-speed) ease;
}

.btn-gradient:hover::before {
  opacity: 1;
}

.btn-gradient:hover {
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.25);
}

.sidebar {
  background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
  min-height: 100vh;
}

.history-item {
  cursor: pointer;
  transition: background-color 0.2s;
}

.history-item:hover {
  background-color: #f8f9fa;
}

.doctor-filter-item:hover {
  background-color: #e3f2fd !important;
  transform: translateX(2px);
  transition: all 0.2s ease;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

.dashboard-widget {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

.status-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

.deleted-row {
  background-color: #ffeeee;
  opacity: 0.7;
  text-decoration: line-through;
}

.deleted-row td {
  color: #888;
}

.btn-restore {
  background-color: #28a745;
  color: white;
}

.btn-restore:hover {
  background-color: #218838;
  color: white;
}

.clickable-note {
  cursor: pointer;
  color: #0d6efd;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.clickable-note:hover {
  color: #0a58ca;
}

.reservation-notes .list-group-item {
  background-color: rgba(255, 255, 255, 0.9);
  margin-bottom: 5px;
  border-radius: 8px;
}

/* Animations and Transitions */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

.badge {
  transition: all 0.3s ease;
}

.badge:hover {
  transform: scale(1.1);
}

/* Status badges with modern styling */
.badge.text-bg-success {
  background-color: var(--success-color) !important;
}

.badge.text-bg-warning {
  background-color: var(--warning-color) !important;
}

.badge.text-bg-danger {
  background-color: var(--danger-color) !important;
}

.badge.text-bg-primary {
  background-color: var(--primary-color) !important;
}

/* Clickable elements */
.clickable-note {
  cursor: pointer;
  color: var(--primary-color);
  text-decoration: underline;
  transition: all var(--transition-speed) ease;
}

.clickable-note:hover {
  color: var(--secondary-color);
}

/* Elegant Action Buttons */
.action-buttons {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 0.5rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  position: relative;
  overflow: hidden;
  color: var(--dark-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.action-btn i {
  font-size: 0.9rem;
  margin-right: 0.3rem;
}

.action-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: currentColor;
  opacity: 0.08;
  z-index: -1;
  transition: all var(--transition-speed) ease;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.action-btn:hover::before {
  opacity: 0.15;
}

.action-btn:active {
  transform: translateY(0);
}

/* Primary action buttons */
.action-btn-success {
  color: var(--success-color);
  background-color: rgba(16, 185, 129, 0.08);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.action-btn-success:hover {
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.action-btn-warning {
  color: var(--warning-color);
  background-color: rgba(245, 158, 11, 0.08);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}

.action-btn-warning:hover {
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.action-btn-info {
  color: var(--accent-color);
  background-color: rgba(6, 182, 212, 0.08);
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.15);
}

.action-btn-info:hover {
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.25);
}

/* Secondary actions container */
.secondary-actions {
  display: flex;
  gap: 0.2rem;
  margin-left: 0.3rem;
  border-left: 1px solid rgba(0, 0, 0, 0.1);
  padding-left: 0.3rem;
}

/* Secondary action buttons */
.action-btn-edit, .action-btn-delete {
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  border-radius: 0.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.action-btn-edit {
  color: var(--primary-color);
  background-color: rgba(37, 99, 235, 0.08);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.action-btn-edit:hover {
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.action-btn-delete {
  color: var(--danger-color);
  background-color: rgba(239, 68, 68, 0.08);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

.action-btn-delete:hover {
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .action-buttons {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .secondary-actions {
    margin-left: 0;
    border-left: none;
    padding-left: 0;
    margin-top: 0.25rem;
  }
  
  .action-btn span {
    font-size: 0.85rem;
  }
}

/* Login Page Styles */
.login-card {
  border-radius: 1.25rem;
  border: none;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1), 0 5px 15px rgba(0, 0, 0, 0.07) !important;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), 0 8px 20px rgba(0, 0, 0, 0.08) !important;
}

.login-logo {
  max-width: 180px;
  height: auto;
  margin: 0 auto;
  transition: transform 0.5s ease;
}

.login-logo:hover {
  transform: scale(1.05);
}

.login-form .input-group-text {
  background-color: transparent;
  border-right: none;
  color: var(--primary-color);
}

.login-form .form-control {
  border-left: none;
  padding-left: 0;
}

.login-form .input-group:focus-within {
  box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.15);
  border-radius: 0.5rem;
}

.login-form .input-group {
  transition: all var(--transition-speed) ease;
}

.login-form .input-group:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Enhanced Responsive Design */
@media (max-width: 992px) {
  .card {
    margin-bottom: 1.5rem;
  }
  
  .table th, .table td {
    padding: 0.75rem;
  }
  
  .btn {
    padding: 0.5rem 1rem;
  }
}

@media (max-width: 768px) {
  .sidebar {
    min-height: auto;
  }
  
  .dashboard-widget {
    padding: 1rem;
  }
  
  .card-body {
    padding: 1.25rem;
  }
  
  .table-responsive {
    margin: 0 -1rem;
    width: calc(100% + 2rem);
    border-radius: 0;
  }
  
  .form-control, .form-select {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

@media (max-width: 576px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  h1, h2, h3 {
    font-size: 90%;
  }
  
  .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }
  
  /* Login page responsive adjustments */
  .login-logo {
    max-width: 140px;
  }
  
  .login-card {
    margin: 0 1rem;
  }
  
  .login-card .card-body {
    padding: 1.25rem;
  }
}
