/* Medical Booking - Custom CSS Apollo Style */

/* Variabili colore per il tema Apollo Medical */
:root {
  /* Colori Apollo ispirati alla dashboard */
  --primary-medical: #4ecdc4; /* Teal principale Apollo */
  --primary-dark: #3ba99c; /* Teal scuro */
  --secondary-medical: #556b8d; /* Blu grigiastro */
  --success-medical: #5cb85c; /* Verde successo */
  --warning-medical: #f0ad4e; /* Arancione warning */
  --danger-medical: #d9534f; /* Rosso danger */
  --info-medical: #17a2b8;
  --light-medical: #f8fafb; /* Sfondo principale */
  --dark-medical: #2c3e50; /* Scuro Apollo */
  --medical-accent: #ff6b9d; /* Rosa accent */

  /* Gradients Apollo */
  --gradient-primary: linear-gradient(135deg, #4ecdc4, #44a08d);
  --gradient-secondary: linear-gradient(135deg, #667eea, #764ba2);
  --gradient-success: linear-gradient(135deg, #56ccf2, #2f80ed);

  /* Shadows Apollo */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.15);

  /* Text colors */
  --text-primary: #2c3e50;
  --text-secondary: #7f8c8d;
  --text-muted: #95a5a6;

  /* Bootstrap overrides */
  --bs-primary: #4ecdc4;
  --bs-primary-rgb: 78, 205, 196;
  --bs-secondary: #556b8d;
  --bs-success: #5cb85c;
  --bs-warning: #f0ad4e;
  --bs-danger: #d9534f;
  --bs-light: #f8fafb;
  --bs-dark: #2c3e50;
}

/* Stili generali per il body Apollo */
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background-color: var(--light-medical);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 14px;
  margin: 0;
  padding: 0;
}

/* === APOLLO DASHBOARD LAYOUT === */
.apollo-layout {
  display: flex;
  min-height: 100vh;
}

/* === APOLLO SIDEBAR === */
.apollo-sidebar {
  background: var(--dark-medical);
  width: 260px;
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  overflow-y: auto;
  transition: all 0.3s ease;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.apollo-sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  flex-shrink: 0;
}

.apollo-logo {
  width: 100%;
  height: auto;
  margin: 0 auto;
  padding: 1.2rem;
}

.apollo-user-info {
  color: white;
}

.apollo-user-avatar-container {
  margin-bottom: 12px;
}

.apollo-user-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary-medical);
}

.apollo-user-avatar-placeholder {
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
}

.apollo-user-name {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
  color: white;
}

.apollo-user-role {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* === APOLLO NAVIGATION === */
.apollo-nav {
  flex: 1;
  padding: 20px 0;
  overflow-y: auto;
}

.apollo-nav-item {
  margin-bottom: 4px;
}

.apollo-nav-link {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.3s ease;
  border-radius: 0;
  font-size: 14px;
  font-weight: 500;
  position: relative;
}

.apollo-nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--primary-medical);
  text-decoration: none;
}

.apollo-nav-link.active {
  background: rgba(78, 205, 196, 0.1);
  color: var(--primary-medical);
  border-right: 3px solid var(--primary-medical);
}

.apollo-nav-icon {
  width: 20px;
  margin-right: 12px;
  font-size: 16px;
  text-align: center;
}

/* === APOLLO SIDEBAR FOOTER === */
.apollo-sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.apollo-emergency-contact {
  background: rgba(92, 184, 92, 0.1);
  border: 1px solid rgba(92, 184, 92, 0.3);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 15px;
  text-align: center;
  color: white;
}

.apollo-emergency-icon {
  background: var(--success-medical);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  color: white;
}

.apollo-emergency-text strong {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

/* === APOLLO MAIN CONTENT === */
.apollo-main {
  margin-left: 260px;
  min-height: 100vh;
  background: var(--light-medical);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.apollo-header {
  background: white;
  padding: 20px 30px;
  border-bottom: 1px solid #e9ecef;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.apollo-content {
  padding: 30px;
  flex: 1;
}

/* === APOLLO HEADER COMPONENTS === */
.apollo-sidebar-toggle {
  background: var(--primary-medical);
  border: none;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.apollo-sidebar-toggle:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.apollo-search {
  position: relative;
  max-width: 300px;
}

.apollo-search-input {
  width: 100%;
  padding: 8px 16px 8px 40px;
  border: 2px solid #e9ecef;
  border-radius: 20px;
  font-size: 14px;
  background: white;
  transition: all 0.3s ease;
}

.apollo-search-input:focus {
  outline: none;
  border-color: var(--primary-medical);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

.apollo-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

.apollo-notification-icon {
  position: relative;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.apollo-notification-icon:hover {
  color: var(--primary-medical);
}

.apollo-notification-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--danger-medical);
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* === RESPONSIVE APOLLO SIDEBAR === */
@media (max-width: 991px) {
  .apollo-sidebar {
    transform: translateX(-100%);
    z-index: 1050;
  }

  .apollo-sidebar.apollo-sidebar-open {
    transform: translateX(0);
  }

  .apollo-main {
    margin-left: 0;
  }

  .apollo-content {
    padding: 20px;
  }

  .apollo-header {
    padding: 15px 20px;
  }
}

/* Bootstrap Navbar override Apollo */
.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.navbar-dark {
  background: var(--dark-medical) !important;
  box-shadow: var(--shadow-md);
}

.navbar-dark .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.8) !important;
  font-weight: 500;
  transition: all 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
  color: var(--primary-medical) !important;
}

/* Bootstrap Card override Apollo */
.card {
  border: none;
  box-shadow: var(--shadow-md);
  border-radius: 12px;
  transition: all 0.3s ease;
  background: white;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  background: white;
  border-bottom: 1px solid #f1f3f4;
  border-radius: 12px 12px 0 0 !important;
  padding: 20px 24px;
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
}

/* Hero Section Apollo Style */
.hero-section {
  background: var(--gradient-primary);
  border-radius: 12px;
  padding: 40px;
  margin-bottom: 30px;
  color: white;
  position: relative;
  overflow: hidden;
  min-height: 200px;
}

.hero-section h1,
.hero-section h2,
.hero-section h3 {
  color: white;
  font-weight: 700;
}

.hero-section p {
  opacity: 0.9;
}

/* Bootstrap Badge override Apollo */
.badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.badge.bg-primary {
  background: var(--gradient-primary) !important;
  color: white;
}

.badge.bg-danger {
  background-color: var(--danger-medical) !important;
}

.badge.bg-secondary {
  background-color: var(--secondary-medical) !important;
}

.badge.bg-info {
  background-color: var(--info-medical) !important;
}

.badge.bg-success {
  background-color: var(--success-medical) !important;
}

/* Bootstrap Button override Apollo */
.btn {
  border-radius: 8px;
  font-weight: 600;
  padding: 12px 24px;
  transition: all 0.3s ease;
  border: none;
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(78, 205, 196, 0.3);
}

.btn-primary:hover {
  background: var(--gradient-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
  color: white;
}

.btn-secondary {
  background: var(--gradient-secondary);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary:hover {
  background: var(--gradient-secondary);
  transform: translateY(-2px);
  color: white;
}

.btn-success {
  background: var(--gradient-success);
  color: white;
  box-shadow: 0 4px 12px rgba(86, 204, 242, 0.3);
}

.btn-success:hover {
  background: var(--gradient-success);
  transform: translateY(-2px);
  color: white;
}

.btn-outline-primary {
  border: 2px solid var(--primary-medical);
  color: var(--primary-medical);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--primary-medical);
  border-color: var(--primary-medical);
  color: white;
}

/* Bootstrap Table override Apollo */
.table {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 0;
}

.table thead th {
  background: #f8f9fa;
  color: var(--text-secondary);
  border: none;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
  padding: 16px 20px;
}

.table tbody tr {
  transition: background-color 0.2s ease;
  border-bottom: 1px solid #f1f3f4;
}

.table tbody tr:hover {
  background-color: #f8f9fa;
}

.table tbody tr:last-child {
  border-bottom: none;
}

.table tbody td {
  padding: 16px 20px;
  border: none;
  vertical-align: middle;
}

/* Bootstrap Form override Apollo */
.form-control {
  border-radius: 8px;
  border: 2px solid #e9ecef;
  padding: 12px 16px;
  transition: all 0.3s ease;
  font-size: 14px;
}

.form-control:focus {
  border-color: var(--primary-medical);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.15);
}

.form-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-size: 14px;
}

.form-select {
  border-radius: 8px;
  border: 2px solid #e9ecef;
  padding: 12px 16px;
  transition: all 0.3s ease;
}

.form-select:focus {
  border-color: var(--primary-medical);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.15);
}

/* Bootstrap Alert override Apollo */
.alert {
  border-radius: 12px;
  border: none;
  padding: 16px 20px;
  margin-bottom: 1.5rem;
  border-left: 4px solid;
}

.alert-success {
  background: rgba(78, 205, 196, 0.1);
  color: var(--primary-dark);
  border-left-color: var(--primary-medical);
}

.alert-info {
  background: rgba(78, 205, 196, 0.05);
  color: var(--text-primary);
  border-left-color: var(--primary-medical);
}

.alert-warning {
  background: rgba(240, 173, 78, 0.1);
  color: var(--warning-medical);
  border-left-color: var(--warning-medical);
}

.alert-danger {
  background: rgba(217, 83, 79, 0.1);
  color: var(--danger-medical);
  border-left-color: var(--danger-medical);
}

/* Icone mediche */
.medical-icon {
  font-size: 2rem;
  color: var(--primary-medical);
  margin-bottom: 1rem;
}

/* Container per dashboard */
.dashboard-container {
  padding: 2rem 0;
}

.stats-card {
  background: linear-gradient(135deg, #ffffff, #f8f9fa);
  border-left: 4px solid var(--primary-medical);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Animazioni */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* Loading spinner personalizzato */
.loading-spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--primary-medical);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .card {
    margin-bottom: 1rem;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }

  .navbar-brand {
    font-size: 1.25rem;
  }
}

/* Stili per il footer (da aggiungere se necessario) */
.footer {
  background: linear-gradient(135deg, var(--dark-medical), #495057);
  color: white;
  padding: 2rem 0;
  margin-top: 4rem;
}

/* Hover effects per link */
a {
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary-medical);
  text-decoration: none;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-medical);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* === APOLLO STATISTICHE === */
.stat-apollo {
  background: white;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  border-left: 4px solid var(--primary-medical);
  margin-bottom: 24px;
}

.stat-apollo:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-apollo-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: white;
  font-size: 20px;
}

.stat-apollo-number {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1;
}

.stat-apollo-label {
  font-size: 14px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* Varianti colore per statistiche */
.stat-apollo.stat-patients .stat-apollo-icon {
  background: var(--gradient-primary);
}

.stat-apollo.stat-appointments .stat-apollo-icon {
  background: var(--gradient-success);
}

.stat-apollo.stat-doctors .stat-apollo-icon {
  background: var(--gradient-secondary);
}

.stat-apollo.stat-revenue .stat-apollo-icon {
  background: linear-gradient(135deg, #ff6b9d, #ff8e9b);
}

/* === APOLLO TABLES === */
.apollo-table {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

.apollo-table .table {
  margin: 0;
}

.apollo-table .table thead th {
  background: #f8f9fa;
  border: none;
  padding: 16px 20px;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.apollo-table .table tbody tr {
  border-bottom: 1px solid #f1f3f4;
  transition: background-color 0.2s ease;
}

.apollo-table .table tbody tr:hover {
  background: #f8f9fa;
}

.apollo-table .table tbody tr:last-child {
  border-bottom: none;
}

.apollo-table .table tbody td {
  padding: 16px 20px;
  border: none;
  vertical-align: middle;
}

/* === APOLLO AVATARS === */
.apollo-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #f1f3f4;
}

.apollo-avatar-sm {
  width: 32px;
  height: 32px;
}

.apollo-avatar-lg {
  width: 60px;
  height: 60px;
}

/* === APOLLO BADGES === */
.apollo-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.apollo-badge-available {
  background: rgba(78, 205, 196, 0.1);
  color: var(--primary-medical);
  border: 1px solid var(--primary-medical);
}

.apollo-badge-busy {
  background: rgba(255, 107, 157, 0.1);
  color: var(--medical-accent);
  border: 1px solid var(--medical-accent);
}

.apollo-badge-offline {
  background: rgba(149, 165, 166, 0.1);
  color: var(--text-muted);
  border: 1px solid var(--text-muted);
}

/* === APPOINTMENT CARDS === */
.appointment-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  border-left: 4px solid var(--primary-medical);
}

.appointment-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.appointment-header {
  display: flex;
  justify-content: between;
  align-items: center;
  margin-bottom: 15px;
}

.appointment-time {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-medical);
}

.appointment-date {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.appointment-status {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-confermata {
  background: rgba(92, 184, 92, 0.1);
  color: var(--success-medical);
}

.status-in_corso {
  background: rgba(78, 205, 196, 0.1);
  color: var(--primary-medical);
}

.status-in-attesa {
  background: rgba(240, 173, 78, 0.1);
  color: var(--warning-medical);
}

.status-completata {
  background: rgba(23, 162, 184, 0.1);
  color: var(--info-medical);
}

.appointment-body {
  margin-bottom: 15px;
}

.patient-info,
.doctor-info {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.patient-avatar,
.doctor-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-right: 12px;
  font-size: 16px;
}

.patient-name,
.doctor-name {
  font-weight: 600;
  margin-bottom: 2px;
}

.appointment-notes {
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 3px solid var(--primary-medical);
}

.appointment-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* === WAITING BOARD === */
.waiting-board {
  background: linear-gradient(135deg, var(--light-medical), #ffffff);
  border: none;
  box-shadow: var(--shadow-md);
}

.queue-list {
  max-height: 400px;
  overflow-y: auto;
}

.queue-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f3f4;
  transition: all 0.3s ease;
}

.queue-item:last-child {
  border-bottom: none;
}

.queue-item.current {
  background: linear-gradient(135deg, rgba(78, 205, 196, 0.1), white);
  border-left: 4px solid var(--primary-medical);
  animation: pulse 2s infinite;
}

.queue-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  margin-right: 12px;
}

.queue-info {
  flex: 1;
}

.queue-code {
  font-weight: 600;
  color: var(--text-primary);
}

.queue-status {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.queue-time {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

/* === AMBULATORIO CARDS === */
.ambulatorio-card {
  border: none;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  border-left: 4px solid var(--primary-medical);
}

.ambulatorio-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.ambulatorio-stats {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #f1f3f4;
}

/* === HERO STATS === */
.hero-stats {
  display: flex;
  gap: 30px;
  justify-content: center;
}

.stat-item {
  text-align: center;
}

.stat-item .stat-number {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: white;
  margin-bottom: 4px;
}

.stat-item .stat-label {
  font-size: 14px;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .dashboard-sidebar {
    transform: translateX(-100%);
    width: 260px;
  }

  .dashboard-sidebar.show {
    transform: translateX(0);
  }

  .dashboard-main {
    margin-left: 0;
  }

  .hero-section {
    padding: 30px 20px;
    text-align: center;
  }

  .hero-stats {
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
  }

  .appointment-card {
    padding: 15px;
    margin-bottom: 15px;
  }

  .appointment-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .appointment-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .stat-card {
    padding: 20px;
    margin-bottom: 20px;
  }

  .sidebar-toggle {
    display: block !important;
  }
}
