
/* Enhanced Modal – Modern, smooth, accessible */
.modal-background {
  background: rgba(180, 205, 255, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeIn 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

#modalEdit .modal-card {
  min-width: 90vw;
  max-width: 800px;
}

@media (min-width: 769px) {
  #modalEdit .modal-card {
    min-width: 600px;
  }
}

.modal-card {
  border-radius: 16px;
  overflow: hidden;
  background: hsl(210, 100%, 97%);
  box-shadow:
    0 24px 48px -12px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(0, 0, 0, 0.06);
  animation: modalPopIn 0.36s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 560px;
  width: calc(100% - 2rem);
  margin: 0 auto;
}

@media (prefers-color-scheme: dark) {
  .modal-background {
    background: rgba(0, 0, 0, 0.78);
  }

  .modal-card {
    background: hsl(0, 0%, 12%);
    box-shadow:
      0 24px 48px -12px rgba(0, 0, 0, 0.6),
      0 0 0 1px rgba(245, 245, 245, 0.08);
  }
}

/* Beautiful slide + scale animation */
@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(-16px);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Header */
.modal-card-head {
  background: hsl(210, 100%, 97%);
  border-bottom-color: hsl(210, 20%, 88%);
  padding: 1.5rem 1.75rem;
  gap: 1rem;
}

@media (prefers-color-scheme: dark) {
  .modal-card-head {
    background: hsl(0, 0%, 15%);
    border-bottom-color: hsl(0, 0%, 22%);
  }
}

.modal-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(0, 0%, 15%);
  letter-spacing: -0.02em;
}

@media (prefers-color-scheme: dark) {
  .modal-card-title {
    color: hsl(0, 0%, 98%);
  }
}

/* Body */
.modal-card-body {
  padding: 1rem 1rem;
  background: hsl(210, 100%, 98%);
  color: hsl(0, 0%, 29%);
}

@media (prefers-color-scheme: dark) {
  .modal-card-body {
    background: hsl(0, 0%, 12%);
    color: hsl(0, 0%, 80%);
  }
}

/* Footer (optional – add .modal-card-foot if you use it) */
.modal-card-foot {
  background: hsl(0, 0%, 98%);
  border-top: 1px solid hsl(0, 0%, 86%);
  padding: 1.25rem 1.75rem;
  gap: 0.75rem;
  justify-content: flex-end;
}

@media (prefers-color-scheme: dark) {
  .modal-card-foot {
    background: hsl(0, 0%, 15%);
    border-top-color: hsl(0, 0%, 22%);
  }
}

/* Enhanced form elements inside modal */
.modal-card-body .label {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(0, 0%, 38%);
  margin-bottom: 0.5rem;
}

@media (prefers-color-scheme: dark) {
  .modal-card-body .label {
    color: hsl(0, 0%, 82%);
  }
}

.modal-card-body .input,
.modal-card-body .textarea {
  border-radius: 10px;
  border: 1.5px solid hsl(0, 0%, 82%);
  background: hsl(0, 0%, 100%);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all 0.22s ease;
}

.modal-card-body .input:focus,
.modal-card-body .textarea:focus {
  border-color: hsl(217, 91%, 60%);
  box-shadow: 0 0 0 4px rgba(72, 95, 199, 0.18);
  outline: none;
}

@media (prefers-color-scheme: dark) {
  .modal-card-body .input,
  .modal-card-body .textarea {
    background: hsl(0, 0%, 16%);
    border-color: hsl(0, 0%, 28%);
    color: hsl(0, 0%, 96%);
  }

  .modal-card-body .input:focus,
  .modal-card-body .textarea:focus {
    border-color: hsl(217, 91%, 68%);
    box-shadow: 0 0 0 4px rgba(72, 95, 199, 0.3);
  }
}

/* Buttons – modern style */
.modal-card-foot .button {
  border-radius: 10px;
  min-width: 100px;
  height: 42px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.9375rem;
  transition: all 0.22s ease;
}

.modal-card-foot .button.is-primary {
  background: hsl(217, 91%, 60%);
  border: none;
}

.modal-card-foot .button.is-primary:hover {
  background: hsl(217, 91%, 55%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(72, 95, 199, 0.35);
}

@media (prefers-color-scheme: dark) {
  .modal-card-foot .button.is-primary {
    background: hsl(217, 91%, 62%);
  }
  .modal-card-foot .button.is-primary:hover {
    background: hsl(217, 91%, 66%);
  }
}

/* Close button (Bulma's .delete) */
.delete {
  border-radius: 50%;
  width: 32px;
  height: 32px;
  transition: all 0.22s ease;
  background: rgba(20, 20, 20, 0.3);
}

.delete:hover {
  background: hsl(348, 100%, 61%);
  transform: scale(1.1);
}

@media (prefers-color-scheme: dark) {
  .delete {
    background: rgba(245, 245, 245, 0.3);
  }
}

/* Image preview placeholder – nicer checkerboard */
#preview-new {
  background:
    linear-gradient(45deg, hsl(0,0%,94%) 25%, transparent 25%),
    linear-gradient(-45deg, hsl(0,0%,94%) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, hsl(0,0%,94%) 75%),
    linear-gradient(-45deg, transparent 75%, hsl(0,0%,94%) 75%),
    hsl(0,0%,98%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Hide the "Klik untuk upload" text when a real image is present */
#preview-new[src]:not([src=""]) {
  color: transparent;
  background: none;   /* optional: remove crosshatch when image loads */
}

.modal-card-body img {
  border-radius: 12px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  transform-origin: center center;   /* or top left, etc. */
  cursor: zoom-in;
}

.modal-card-body img:hover {
  transform: scale(2);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  z-index: 9999 !important;
  image-rendering: -webkit-optimize-contrast;
}
