:root {
  --primary-color: #3498db;
  --secondary-color: #2c3e50;
  --success-color: #27ae60;
  --warning-color: #f39c12;
  --danger-color: #e74c3c;
  --light-bg: #f8f9fa;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --border-radius: 8px;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* Modern glassmorphism effect */
.glass-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: var(--box-shadow);
}

/* Improved gradient */
.gradient-card {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  box-shadow: 0 10px 25px -5px rgba(0, 128, 128, 0.2);
}

/* Morphing background */
.morphing-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.6;
  background: radial-gradient(
      circle at 10% 20%,
      rgba(0, 128, 128, 0.08) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 40%,
      rgba(46, 204, 113, 0.08) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 40% 70%,
      rgba(0, 128, 128, 0.08) 0%,
      transparent 40%
    );
  background-size: 200% 200%;
  animation: morphBackground 20s ease infinite alternate;
}

@keyframes morphBackground {
  0% {
    background-position: 0% 0%;
  }

  100% {
    background-position: 100% 100%;
  }
}

/* Improved step progress */
.step-progress {
  position: relative;
  padding-left: 2rem;
}

.step-progress::before {
  content: "";
  position: absolute;
  left: 0.75rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e5e7eb;
}

.step {
  transition: all 0.3s ease;
  border-radius: var(--border-radius);
}

.step:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Improved form controls */
.form-input {
  border-radius: var(--border-radius);
  transition: all 0.2s ease;
  border: 1px solid #e2e8f0;
}

.form-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 128, 128, 0.15);
}

/* Modern button styles */
.btn-primary {
  background: var(--primary-color);
  color: white;
  border-radius: var(--border-radius);
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 128, 128, 0.15);
}

.btn-primary:hover {
  background: #2980b9;
  transform: translateY(-1px);
}

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

/* Enhanced animations */
.loading-spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.pulse-slow {
  animation: pulse 3s infinite;
}

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

  50% {
    transform: scale(1.05);
  }
}

.animate-float {
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-12px);
  }

  100% {
    transform: translateY(0px);
  }
}

/* Modern toast notification */
.toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 50;
  border-radius: var(--border-radius);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Enhanced responsive design */
@media (max-width: 640px) {
  :root {
    --border-radius: 12px;
  }

  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .glass-card,
  .gradient-card {
    border-radius: var(--border-radius);
  }
}

/* Header improvement */
.gradient-text {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

/* Blurred dots pattern */
.header-pattern {
  background-image: radial-gradient(var(--primary-color) 1px, transparent 1px),
    radial-gradient(var(--secondary-color) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  opacity: 0.1;
}

/* Animated fade-out */
.fade-out {
  animation: fadeOut 0.5s ease-in-out forwards;
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-20px);
    display: none;
  }
}

/* Select dropdown styling */
select.form-input {
  background-color: white;
  cursor: pointer;
}

select.form-input:focus {
  outline: none;
}

/* Add a subtle animation for the dropdown */
@keyframes selectPulse {
  0% {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0 rgba(0, 128, 128, 0.2);
  }

  50% {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 128, 128, 0.1);
  }

  100% {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0 rgba(0, 128, 128, 0.2);
  }
}

select.form-input:focus {
  animation: selectPulse 2s infinite;
}

.dashboard-container {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
  background: #f5f7fa;
}

.sidebar {
  background: #2c3e50;
  color: white;
  padding: 20px;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.main-content {
  padding: 30px;
  overflow-y: auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* Patient card styles */
.patient-card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
}

.patient-card[data-status="critical"] {
  border-left-color: var(--danger-color);
}

.patient-card[data-status="stable"] {
  border-left-color: var(--success-color);
}

.patient-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.patient-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #008080;
}

.patient-info {
  flex: 1;
  margin-left: 10px;
}

.patient-name {
  font-size: 18px;
  font-weight: 500;
  margin: 0;
}

.patient-id {
  font-size: 14px;
  color: #777;
  margin: 0;
}

.status-indicator {
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
}

.patient-details {
  margin-bottom: 15px;
}

.detail-item {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
  color: #555;
}

.detail-item i {
  margin-right: 8px;
  color: #008080;
}

.patient-actions {
  display: flex;
  gap: 10px;
}

.btn {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-primary {
  background: #008080;
  color: white;
}

.btn-primary:hover {
  background: #007373;
  transform: translateY(-2px);
}

.btn-secondary {
  background: #f0f0f0;
  color: #333;
}

.btn-secondary:hover {
  background: #e0e0e0;
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .dashboard-container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -250px;
    height: 100vh;
    transition: left 0.3s ease;
    z-index: 1000;
  }

  .sidebar.active {
    left: 0;
  }

  .mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }

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

  .patient-card {
    margin-bottom: 15px;
  }
}

/* Search and Filter Styles */
.search-filter-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.search-box {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.2s ease;
}

.search-box:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 128, 128, 0.15);
}

.search-box i {
  color: #008080;
  margin-right: 0.5rem;
}

.search-box input {
  border: none;
  outline: none;
  flex: 1;
  padding: 0.5rem;
  font-size: 16px;
  color: #333;
}

.filter-options {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-select {
  padding: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.2s ease;
  flex: 1;
}

.filter-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 128, 128, 0.15);
  outline: none;
}

/* End of Search and Filter Styles */

/* UI State Manager Styles */
.loading-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  height: 100%;
  text-align: center;
}

.loading-container .spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
  margin-bottom: 10px;
}

.error-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  height: 100%;
  text-align: center;
  padding: 20px;
  border-radius: var(--border-radius);
  background: rgba(255, 0, 0, 0.1);
  color: #d9534f;
  margin-top: 1rem;
}

.error-container i {
  font-size: 2rem;
  margin-bottom: 10px;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  height: 100%;
  text-align: center;
  padding: 20px;
  border-radius: var(--border-radius);
  background: rgba(0, 0, 255, 0.1);
  color: #007bff;
  margin-top: 1rem;
}

.empty-state i {
  font-size: 2rem;
  margin-bottom: 10px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.loading-dots div {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: currentColor;
  animation: dot-bounce 1.4s ease-in-out infinite both;
}

.loading-dots div:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots div:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes dot-bounce {
  0%,
  80%,
  100% {
    transform: scale(0);
    opacity: 0.5;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Improved focus states */
.form-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 128, 128, 0.1);
  transform: translateY(-1px);
}

/* Better transitions */
.form-input,
.btn-primary {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes toast-progress {
  from {
    width: 100%;
  }

  to {
    width: 0%;
  }
}

/* Skeleton loading styles */
.skeleton-loading {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius);
  background: #f0f0f0;
}

.skeleton-loading::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.8) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: 0 0;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary-color: #4fd1c7;
    --background-color: #1a202c;
    --text-color: #e2e8f0;
  }

  body {
    background: var(--background-color);
    color: var(--text-color);
  }

  .glass-card {
    background: rgba(45, 55, 72, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
}
