:root {
  /* Tombol “Lihat Langsung” (mode terang) */
  --modal-primary-start: deepskyblue;
  --modal-primary-end: dodgerblue;
  --modal-primary-text: black;
  --modal-primary-shadow: rgba(0, 119, 255, 0.45);

  /* Tombol “Open GitHub” (mode terang) */
  --modal-secondary-bg: black;
  --modal-secondary-text: white;
  --modal-secondary-shadow: rgba(0, 0, 0, 0.45);

  /* Tombol “Close” (mode terang) */
  --modal-ghost-bg: aliceblue;
  --modal-ghost-text: midnightblue;
  --modal-ghost-border: powderblue;
}

html.dark {
  /* Tombol “Lihat Langsung” (mode gelap) */
  --modal-primary-start: lightskyblue;
  --modal-primary-end: royalblue;
  --modal-primary-text: black;
  --modal-primary-shadow: rgba(99, 164, 255, 0.55);

  /* Tombol “Open GitHub” (mode gelap) */
  --modal-secondary-bg: white;
  --modal-secondary-text: black;
  --modal-secondary-shadow: rgba(255, 255, 255, 0.45);

  /* Tombol “Close” (mode gelap) */
  --modal-ghost-bg: rgba(255, 255, 255, 0.08);
  --modal-ghost-text: aliceblue;
  --modal-ghost-border: rgba(255, 255, 255, 0.45);
}

.project-modal {
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(210, 226, 255, 0.96), rgba(244, 249, 255, 0.98));
  color: #062046;
  box-shadow: 0 35px 95px rgba(14, 30, 80, 0.35);
  overflow: hidden;
  border: 1px solid rgba(37, 99, 235, 0.12);
  display: flex;
  flex-direction: column;
}

html.dark .project-modal {
  background: linear-gradient(150deg, #010717, #04122b);
  color: #e5edff;
  border: 1px solid rgba(130, 170, 255, 0.2);
  box-shadow: 0 45px 90px rgba(1, 3, 10, 0.9);
}

.project-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 1.75rem;
  background: linear-gradient(135deg, rgba(146, 180, 255, 0.25), rgba(255, 255, 255, 0.92));
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  position: sticky;
  top: 0;
  z-index: 2;
}

.project-modal__content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

html.dark .project-modal__header {
  background: linear-gradient(135deg, rgba(5, 12, 32, 0.95), rgba(2, 6, 18, 0.92));
  border-bottom-color: rgba(226, 232, 240, 0.18);
}

.project-modal__badge {
  display: inline-block;
  padding: 0.15rem 0.8rem;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  font-weight: 700;
  color: #0f4ad9;
  background: rgba(37, 99, 235, 0.15);
}

html.dark .project-modal__badge {
  color: #a6c0ff;
  background: rgba(93, 139, 255, 0.22);
}

.project-modal__title {
  margin-top: 0.35rem;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.project-modal__close {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.2);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.project-modal__close:hover {
  background: rgba(148, 163, 184, 0.35);
  color: #0f172a;
}

html.dark .project-modal__close {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5f5;
}

.project-modal__image {
  position: relative;
  overflow: hidden;
  background: rgba(0,0,0,0.1);
  flex-shrink: 0;
  max-height: 50vh;
}

.project-modal__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.project-modal__body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  flex: 1;
  min-height: 0;
  overflow: visible;
}

/* Scrollbar dalam body modal agar menyatu dengan tema */
.project-modal__body::-webkit-scrollbar {
  width: 10px;
}
.project-modal__body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}
.project-modal__body::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.45);
  border-radius: 999px;
}
html.dark .project-modal__body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
}
html.dark .project-modal__body::-webkit-scrollbar-thumb {
  background: rgba(226, 232, 240, 0.4);
}

.project-modal__description {
  font-size: 1rem;
  line-height: 1.8;
  color: #0c284f;
}

html.dark .project-modal__description {
  color: #e4ebff;
}

.project-modal__label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 0.85rem;
  color: #0f172a;
  margin-bottom: 0.3rem;
}

html.dark .project-modal__label {
  color: #e2e8f0;
}

.project-modal__tech {
  color: #1f2937;
  font-weight: 400;
}

html.dark .project-modal__tech {
  color: #cbd5e1;
}

.project-modal__actions {
  padding: 1.5rem 1.75rem;
  background: linear-gradient(135deg, #e6efff, #f3f7ff);
  border-top: 1px solid rgba(15, 23, 42, 0.05);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-start;
  align-items: center;
  position: sticky;
  bottom: 0;
  z-index: 2;
}

html.dark .project-modal__actions {
  background: linear-gradient(135deg, rgba(2, 5, 17, 0.95), rgba(6, 12, 26, 0.9));
  border-top-color: rgba(226, 232, 240, 0.2);
}

.project-modal__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.65rem 1.4rem;
  font-weight: 600;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

/* Tombol Primary - Lihat Langsung */
.project-modal__btn--primary {
  color: var(--modal-primary-text) !important;
  background: linear-gradient(135deg, var(--modal-primary-start), var(--modal-primary-end)) !important;
  box-shadow: 0 20px 38px var(--modal-primary-shadow);
}
.project-modal__btn--primary span,
.project-modal__btn--primary i {
  color: var(--modal-primary-text) !important;
}

html.dark .project-modal__btn--primary {
  color: var(--modal-primary-text) !important;
  background: linear-gradient(135deg, var(--modal-primary-start), var(--modal-primary-end)) !important;
  box-shadow: 0 24px 42px var(--modal-primary-shadow);
}

/* Tombol Secondary - Buka GitHub */
.project-modal__btn--secondary {
  color: var(--modal-secondary-text) !important;
  background: var(--modal-secondary-bg) !important;
  box-shadow: 0 20px 32px var(--modal-secondary-shadow);
}
.project-modal__btn--secondary span,
.project-modal__btn--secondary i {
  color: var(--modal-secondary-text) !important;
}

html.dark .project-modal__btn--secondary {
  color: var(--modal-secondary-text) !important;
  background: var(--modal-secondary-bg) !important;
  box-shadow: 0 20px 34px var(--modal-secondary-shadow);
}

/* Tombol Ghost - Tutup */
.project-modal__btn--ghost {
  color: var(--modal-ghost-text);
  background: var(--modal-ghost-bg);
  border-color: var(--modal-ghost-border);
}
.project-modal__btn--ghost span,
.project-modal__btn--ghost i {
  color: var(--modal-ghost-text) !important;
}

html.dark .project-modal__btn--ghost {
  color: var(--modal-ghost-text);
  background: var(--modal-ghost-bg);
  border-color: var(--modal-ghost-border);
}

@media (max-width: 640px) {
  .project-modal__image img {
    height: 200px;
  }

  .project-modal__title {
    font-size: 1.4rem;
  }

  .project-modal__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .project-modal__btn {
    width: 100%;
    justify-content: center;
  }
}
