/* Platform polish: legal modals, responsive overlays, orientation */
@import url('dg-responsive.css');
@import url('dg-assets.css');

.dg-legal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(60, 60, 60, 0.55);
  backdrop-filter: blur(4px);
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.dg-legal-overlay.open {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.dg-legal-modal {
  background: #fff;
  border-radius: 16px;
  max-width: 640px;
  width: 100%;
  margin: 24px auto 40px;
  padding: 28px 24px 32px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(242, 103, 39, 0.2);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.dg-legal-modal h2 {
  font-family: var(--dg-display, 'Playfair Display', serif);
  color: var(--dg-orange, #F26727);
  margin: 0 32px 16px 0;
  font-size: 1.5rem;
}

.dg-legal-body h3 {
  font-size: 1rem;
  color: var(--dg-charcoal, #3C3C3C);
  margin: 18px 0 8px;
}

.dg-legal-body ul {
  margin: 0 0 12px 1.2rem;
  line-height: 1.65;
  color: #444;
}

.dg-legal-body p {
  line-height: 1.65;
  color: #444;
  margin-bottom: 10px;
}

.dg-legal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: none;
  background: #f0f0f0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  color: #333;
}

.dg-delete-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 10px 0 4px;
}

/* Zego / prescription panel — mobile */
/* Telemedicine layout */
@media (max-width: 900px) {
  #paymentSection {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 0 12px;
    box-sizing: border-box;
  }

  #regdocsec {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 0 12px;
    box-sizing: border-box;
  }

  #doctorsSection {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 0 12px;
    box-sizing: border-box;
  }
  .doctor-card {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  #doctorsSection {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 0 12px;
    box-sizing: border-box;
  }

  #consultationCard {
    right: 5vw !important;
    left: 5vw !important;
    max-width: 90vw !important;
  }

  #prescription-card {
    left: 8px !important;
    right: 8px !important;
    bottom: 8px !important;
    width: auto !important;
    max-width: none !important;
    max-height: 70vh !important;
  }

  .prescription-modal {
    width: 95vw !important;
    max-width: 95vw !important;
    left: 2.5vw !important;
    right: 2.5vw !important;
  }
}

@media (max-width: 768px) and (orientation: landscape) {
  #prescription-card {
    max-height: 85vh !important;
  }
}

/* Doctor dashboard status */
.dg-doctor-status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin: 12px 0 20px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
}

.dg-status-pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
}

.dg-status-pill.available { background: #28a745; color: #fff; }
.dg-status-pill.busy { background: #ffc107; color: #333; }
.dg-status-pill.offline { background: #6c757d; color: #fff; }

.dg-status-toggle {
  padding: 8px 16px;
  border-radius: 8px;
  border: 2px solid #fff;
  background: transparent;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.88rem;
}

.dg-status-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
}

.dg-status-toggle.active {
  background: #fff;
  color: var(--dg-charcoal, #3C3C3C);
}

/* Doctor online/offline switch */
.dg-online-switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.dg-online-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.dg-online-switch-slider {
  position: relative;
  width: 52px;
  height: 28px;
  background: #6c757d;
  border-radius: 28px;
  transition: background 0.25s ease;
  flex-shrink: 0;
}

.dg-online-switch-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s ease;
}

.dg-online-switch input:checked + .dg-online-switch-slider {
  background: #28a745;
}

.dg-online-switch input:checked + .dg-online-switch-slider::before {
  transform: translateX(24px);
}

.dg-online-switch.is-busy .dg-online-switch-slider {
  background: #ffc107;
}

.dg-online-switch.is-busy input {
  pointer-events: none;
}

.dg-online-switch-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  min-width: 5.5rem;
  text-align: left;
}

.dg-online-switch.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

/* Consultation waiting & ringing */
.dg-consultation-wait,
.dg-ring-modal {
  text-align: center;
  max-width: 420px;
}

.dg-wait-pulse {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F26727, #c4a035);
  animation: dgPulse 1.4s ease-in-out infinite;
}

@keyframes dgPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.85; }
}

.dg-wait-sub {
  color: #666;
  font-size: 0.92rem;
  margin-top: 8px;
}

.dg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dg-btn-primary {
  background: linear-gradient(135deg, #2d6a4f, #40916c);
  color: #fff;
  box-shadow: 0 6px 20px rgba(45, 106, 79, 0.35);
}

.dg-btn-danger {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
}

.dg-btn-ghost {
  background: transparent;
  border: 2px solid #ccc;
  color: #555;
  margin-top: 12px;
}

.dg-btn:hover { transform: translateY(-2px); }

.dg-ring-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10060;
  background: rgba(20, 40, 30, 0.72);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.dg-ring-overlay.show {
  display: flex;
}

.dg-ring-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  border: 2px solid rgba(196, 160, 53, 0.4);
  animation: dgRingIn 0.35s ease;
}

@keyframes dgRingIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.dg-ring-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
  color: var(--dg-orange, #F26727);
  animation: dgRingShake 0.5s ease-in-out infinite alternate;
}

@keyframes dgRingShake {
  from { transform: rotate(-8deg); }
  to { transform: rotate(8deg); }
}

.dg-ring-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.dg-enable-sound {
  display: none;
  margin-top: 12px;
  font-size: 0.85rem;
  color: #2d6a4f;
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
}

