/* VClar overlay modal (confirm & alert)
 * Modern dark UI inspired by provided reference.
 */

:root {
  /* Brand-aligned palette (matches Tailwind config in `front/inner_header.php`) */
  --vclar-modal-overlay: rgba(15, 23, 42, 0.72); /* slate-900 */
  --vclar-modal-card: #0f172a;   /* slate-900 */
  --vclar-modal-card-2: #111c33; /* deep slate */
  --vclar-modal-border: rgba(255, 255, 255, 0.06);
  --vclar-modal-text: #e5e7eb;
  --vclar-modal-muted: rgba(229, 231, 235, 0.7);
  --vclar-modal-muted-2: rgba(229, 231, 235, 0.55);

  /* Primary brand green */
  --vclar-modal-primary: #16a34a;   /* primary-600 */
  --vclar-modal-primary-2: #22c55e; /* primary-500 */
  --vclar-modal-danger: #ef4444;
  --vclar-modal-secondary-bg: rgba(148, 163, 184, 0.14);
  --vclar-modal-secondary-border: rgba(148, 163, 184, 0.18);
}

.vclar-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: var(--vclar-modal-overlay);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: vclarModalFadeIn 180ms ease-out;
}

.vclar-modal-overlay.hidden {
  display: none !important;
}

.vclar-modal-overlay.vclar-modal-hidden {
  animation: vclarModalFadeOut 140ms ease-in forwards;
}

.vclar-modal-backdrop {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.vclar-modal-card {
  position: relative;
  width: min(860px, 100%);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--vclar-modal-card) 0%, var(--vclar-modal-card-2) 100%);
  border: 1px solid var(--vclar-modal-border);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.55),
    0 16px 40px rgba(22, 163, 74, 0.10),
    0 0 0 1px rgba(0, 0, 0, 0.15) inset;
  overflow: hidden;
  animation: vclarModalPopIn 220ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

/* Subtle brand accent on top edge */
.vclar-modal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--vclar-modal-primary-2), var(--vclar-modal-primary), var(--vclar-modal-primary-2));
  opacity: 0.9;
}

.vclar-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(229, 231, 235, 0.65);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
}

.vclar-modal-close:hover {
  background: rgba(34, 197, 94, 0.10);
  color: rgba(229, 231, 235, 0.9);
}

.vclar-modal-close:active {
  transform: scale(0.96);
}

.vclar-modal-body {
  padding: 28px 30px 18px;
}

.vclar-modal-content {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.vclar-modal-icon {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  background: rgba(148, 163, 184, 0.12);
  color: rgba(229, 231, 235, 0.85);
}

.vclar-modal-icon.vclar-modal-icon-danger {
  background: rgba(239, 68, 68, 0.14);
  color: var(--vclar-modal-danger);
}

.vclar-modal-icon.vclar-modal-icon-primary {
  background: rgba(34, 197, 94, 0.18);
  color: var(--vclar-modal-primary);
}

.vclar-modal-text {
  min-width: 0;
  padding-top: 2px;
}

.vclar-modal-title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--vclar-modal-text);
}

.vclar-modal-message {
  margin: 10px 0 0;
  font-size: 18px;
  line-height: 1.55;
  color: var(--vclar-modal-muted);
}

.vclar-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  padding: 0 30px 24px;
}

.vclar-modal-btn {
  height: 46px;
  padding: 0 20px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease, background 120ms ease, border-color 120ms ease;
  color: var(--vclar-modal-text);
}

.vclar-modal-btn:active {
  transform: translateY(0.5px) scale(0.985);
}

.vclar-modal-btn:focus-visible,
.vclar-modal-close:focus-visible {
  outline: 2px solid rgba(34, 197, 94, 0.75);
  outline-offset: 2px;
}

.vclar-modal-btn-secondary {
  background: var(--vclar-modal-secondary-bg);
  border-color: var(--vclar-modal-secondary-border);
  color: rgba(229, 231, 235, 0.92);
}

.vclar-modal-btn-secondary:hover {
  filter: brightness(1.05);
}

.vclar-modal-btn-primary {
  background: linear-gradient(180deg, var(--vclar-modal-primary-2) 0%, var(--vclar-modal-primary) 100%);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(22, 163, 74, 0.22);
}

.vclar-modal-btn-primary:hover {
  filter: brightness(1.02);
}

.vclar-modal-btn-danger {
  background: var(--vclar-modal-danger);
  color: #ffffff;
}

.vclar-modal-btn-danger:hover {
  filter: brightness(0.98);
}

@media (max-width: 640px) {
  .vclar-modal-overlay,
  .vclar-modal-backdrop {
    padding: 14px;
  }

  .vclar-modal-body {
    padding: 22px 18px 16px;
  }

  .vclar-modal-title {
    font-size: 22px;
  }

  .vclar-modal-message {
    font-size: 16px;
  }

  .vclar-modal-footer {
    padding: 0 18px 18px;
    flex-direction: column-reverse;
  }

  .vclar-modal-btn {
    width: 100%;
    height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vclar-modal-overlay,
  .vclar-modal-card {
    animation: none !important;
  }
  .vclar-modal-btn,
  .vclar-modal-close {
    transition: none !important;
  }
}

@keyframes vclarModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes vclarModalFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes vclarModalPopIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

