/* ============================================================
   RESET & BASE
============================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: system-ui, 'Segoe UI', Roboto, sans-serif;
}

body {
  background: #f4f7fc;
  padding: 2rem 1.5rem;
  min-height: 100vh;
}

h1 {
  font-size: 2.2rem;
  font-weight: 600;
  color: #1e2a41;
  text-align: center;
  margin-bottom: 0.3rem;
}

.subhead {
  color: #4b5b73;
  text-align: center;
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
  border-bottom: 2px solid #d0ddeb;
  padding-bottom: 0.75rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
   NAVBAR
============================================================ */
.navbar {
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(0, 20, 40, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
  margin: -2rem -1.5rem 1.5rem;
  border-bottom: 1px solid #e3ebf5;
}

.nav-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.nav-brand {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1e5fa8;
  text-decoration: none;
  letter-spacing: -0.3px;
}

.nav-menu {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.nav-menu a {
  color: #3e5a7a;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-menu a:hover {
  color: #1e5fa8;
}

.nav-menu a.active {
  color: #1e5fa8;
  font-weight: 600;
  border-bottom: 2px solid #1e5fa8;
  padding-bottom: 2px;
}

.nav-user {
  color: #2b3e58;
  font-weight: 500;
}

.user-greeting {
  background: #e8f0fe;
  padding: 0.4rem 0.9rem;
  border-radius: 30px;
  font-size: 0.88rem;
  color: #1e5fa8;
  border: 1px solid #c2d6ed;
  display: inline-block;
  transition: all 0.2s;
  text-decoration: none;
}

a.user-greeting:hover {
  background: #1e5fa8;
  color: #fff !important;
  transform: translateY(-1px);
}

/* Tombol login/register/logout */
.btn-nav {
  padding: 0.45rem 1.1rem;
  border-radius: 30px;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-login {
  color: #1e5fa8;
  border: 1.5px solid #1e5fa8;
}

.btn-login:hover {
  background: #1e5fa8;
  color: #fff !important;
}

.btn-register {
  background: #1e5fa8;
  color: #fff !important;
}

.btn-register:hover {
  background: #14457a;
}

.btn-logout {
  background: #e74c3c;
  color: #fff !important;
}

.btn-logout:hover {
  background: #c0392b;
}

.nav-toggle,
.nav-toggle-label {
  display: none;
}

/* ============================================================
   FOOTER NOTE (untuk halaman non-detail)
============================================================ */
.footer-note {
  margin-top: 3rem;
  text-align: center;
  color: #6a7d99;
  font-size: 0.9rem;
  border-top: 1px solid #cfddee;
  padding-top: 2rem;
}

/* ============================================================
   FORM AUTH (login.php & register.php)
============================================================ */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1rem;
  min-height: 60vh;
}

.auth-card {
  background: #fff;
  padding: 2.2rem 2rem;
  border-radius: 22px;
  box-shadow: 0 12px 30px -10px rgba(0, 20, 40, 0.18);
  width: 100%;
  max-width: 430px;
  border: 1px solid #e3ebf5;
}

.auth-card h1 {
  font-size: 1.7rem;
  color: #0f1c2e;
  text-align: center;
  margin-bottom: 0.4rem;
}

.auth-sub {
  text-align: center;
  color: #6a7d99;
  font-size: 0.92rem;
  margin-bottom: 1.6rem;
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: #2b3e58;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #d2e0f0;
  border-radius: 12px;
  font-size: 0.95rem;
  background: #f9fcff;
  font-family: inherit;
  transition: all 0.2s;
}

.form-group textarea {
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #1e5fa8;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(30, 95, 168, 0.1);
}

.form-group input[type="file"] {
  padding: 0.6rem;
  background: #f0f6ff;
  cursor: pointer;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.wajib {
  color: #e74c3c;
}

.form-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #8996aa;
}

.btn-submit {
  width: 100%;
  padding: 0.8rem;
  background: #1e5fa8;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-top: 0.5rem;
}

.btn-submit:hover {
  background: #14457a;
}

.btn-submit:active {
  transform: scale(0.98);
}

.auth-link {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: #6a7d99;
}

.auth-link a {
  color: #1e5fa8;
  font-weight: 600;
  text-decoration: none;
}

.auth-link a:hover {
  text-decoration: underline;
}

/* ============================================================
   ALERT
============================================================ */
.alert {
  padding: 0.8rem 1rem;
  border-radius: 12px;
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.alert-error {
  background: #fdecea;
  color: #b71c1c;
  border: 1px solid #f5c6cb;
}

.alert-success {
  background: #e7f7ed;
  color: #1b5e20;
  border: 1px solid #b8e0c2;
}

.container-alert {
  max-width: 700px;
  margin: 0 auto 1.5rem;
  text-align: center;
}

/* ============================================================
   PREVIEW BOX (untuk edit.php)
============================================================ */
.preview-box {
  margin-bottom: 1.2rem;
  padding: 0.8rem;
  background: #f0f6ff;
  border-radius: 14px;
  border: 1.5px dashed #b7cde8;
  text-align: center;
}

.preview-label {
  font-size: 0.85rem;
  color: #6a7d99;
  margin-bottom: 0.5rem;
}

.preview-box img {
  max-width: 100%;
  max-height: 240px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* ============================================================
   FORM EDIT - GAMBAR SAAT INI
============================================================ */
.current-image {
  margin-bottom: 0.9rem;
  padding: 0.5rem;
  background: #f0f6ff;
  border-radius: 10px;
  border: 1.5px solid #d2e0f0;
  text-align: center;
}

.current-image img {
  max-width: 100%;
  max-height: 140px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* ============================================================
   GRUP TOMBOL FORM (edit)
============================================================ */
.btn-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.3rem;
}

.btn-group .btn-submit {
  flex: 1;
}

.btn-cancel {
  background: #fff !important;
  color: #4b5b73 !important;
  border: 1.5px solid #cfddee !important;
  text-decoration: none;
  text-align: center;
  display: inline-block;
  padding: 0.55rem;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.85rem;
}

.btn-cancel:hover {
  background: #f0f4fa !important;
  border-color: #9bb9e0 !important;
}

/* ============================================================
   EDIT GALLERY GRID (edit.php)
============================================================ */
.edit-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.edit-gallery-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #eee;
}

.edit-gallery-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.hapus-checkbox {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 4px 6px;
  background: #fff;
  cursor: pointer;
}

.hapus-checkbox input:checked + span {
  color: red;
  font-weight: bold;
}

/* ============================================================
   RESPONSIVE (Global)
============================================================ */

/* Tablet & HP: Navbar */
@media (max-width: 700px) {
  .navbar {
    margin: -1.25rem -0.75rem 1.25rem;
  }
  .nav-container {
    padding: 0.8rem 1rem;
  }
  .nav-menu {
    gap: 0.8rem;
    font-size: 0.85rem;
  }
  .user-greeting {
    font-size: 0.78rem;
    padding: 0.35rem 0.7rem;
  }
  .btn-nav {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
  }
}

/* HP: Umum */
@media (max-width: 600px) {
  body {
    padding: 1.25rem 0.75rem;
  }
  h1 {
    font-size: 1.8rem;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .auth-card {
    padding: 1.5rem 1.2rem;
  }
  .auth-card h1 {
    font-size: 1.4rem;
  }
}