/* RESET & GLOBAL STYLES */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', 'Segoe UI', sans-serif;
}

body {
  background: linear-gradient(to right, #e3f2fd, #bbdefb);
  color: #333;
  padding: 20px;
}

img, iframe, video {
  max-width: 100%;
  height: auto;
}

/* HEADER (NAVBAR) */
header {
  background: #0d47a1;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  flex-wrap: wrap;
}

.nav-left img {
  width: 5rem;
  height: 4rem;
}

.nav-mid ul {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-mid ul li a {
  text-decoration: none;
  color: white;
  font-weight: 600;
  font-size: 1rem;
}

.nav-right a {
  text-decoration: none;
  color: #0d47a1;
  background: white;
  font-weight: 600;
  padding: 0.7rem 1rem;
  border-radius: 15px;
}

.burger {
  display: none;
  cursor: pointer;
  padding: 10px;
  background: #333;
  color: #fff;
  border-radius: 4px;
}

#menu-toggle {
  display: none;
}

.login-mobile {
  display: none;
}

/* HERO SECTION */
.hero-section {
  background-image: url(img/hero-index.png);
}

.page-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.overlay {
  background: rgba(0, 0, 0, 0.5);
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.overlay-content {
  color: white;
  max-width: 800px;
}

.overlay-content h2 {
  font-size: 3rem;
}

.overlay-content p {
  font-size: 1.5rem;
  margin-top: 10px;
}

/* MAIN CONTAINER */
.container {
  background: #fff;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* INFO SECTION */
.info {
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
}

.info h2 {
  margin-bottom: 15px;
  color: #1976d2;
}

.info ul {
  list-style: disc inside;
  padding-left: 10px;
}

/* FOOTER */
  footer {
    padding: 15px 0;
    text-align: center;
    font-size: 14px;
    color: #666;
  }

/* CHAT STYLES */
.chat-icon {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 60px;
  height: 60px;
  background-color: #0d47a1;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 1000;
}

.chat-popup {
  position: fixed;
  bottom: 100px;
  right: 25px;
  width: 300px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
}

.chat-popup.open {
  display: flex;
}

.chat-header {
  background: #0d47a1;
  color: white;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
}

.chat-body {
  max-height: 200px;
  overflow-y: auto;
  padding: 10px;
  background: #f1f1f1;
  font-size: 14px;
}

.chat-input {
  display: flex;
  padding: 10px;
  gap: 5px;
  background: #fafafa;
}

.chat-input input {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.chat-input button {
  background-color: #0d47a1;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

/* DASHBOARD & GALLERY */
.dashboard-boxes,
.gallery-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  margin-top: 20px;
}

.dashboard-card,
.gallery-item {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.08);
  text-align: center;
  transition: transform 0.3s ease;
}

.dashboard-card:hover,
.gallery-item:hover {
  transform: scale(1.03);
}

.gallery-item img {
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  width: 100%;
}

/* Galeri */
.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 20px 0;
}

.gallery-item {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  width: 250px;
  transition: transform 0.3s ease;
}

.gallery-item:hover {
  transform: scale(1.03);
}

.gallery-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-bottom: 1px solid #eee;
}

.gallery-item p {
  text-align: center;
  padding: 10px;
  font-weight: 600;
  font-size: 14px;
}

/* LOGIN FORM */
.login-form {
  background: white;
  padding: 30px;
  max-width: 400px;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.login-form form {
  display: flex;
  flex-direction: column;
}

.login-form label {
  margin-bottom: 6px;
  font-weight: 600;
  color: #333;
}

.login-form input {
  padding: 10px;
  margin-bottom: 20px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
}

.login-form button {
  background-color: #0d47a1;
  color: white;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.login-form button:hover {
  background-color: #1565c0;
}

/* BUTTONS */
.btn-small,
button,
a.btn {
  background-color: #1976d2;
  color: white;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  text-decoration: none;
  transition: 0.3s;
}

.btn-small:hover,
button:hover,
a.btn:hover {
  background-color: #0d47a1;
  cursor: pointer;
}

/* TABLE */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

table, th, td {
  border: 1px solid #ddd;
}

th {
  background-color: #1976d2;
  color: white;
  padding: 12px;
  text-align: left;
}

td {
  padding: 10px;
}

a {
  color: #1976d2;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* RESPONSIVE STYLES */
@media (max-width: 768px) {
  .burger {
    display: block;
  }

  .nav-mid {
    width: 100%;
    display: none;
    flex-direction: column;
    text-align: center;
    background: #0d47a1;
    padding: 10px 0;
  }

  #menu-toggle:checked ~ .nav-mid {
    display: flex;
  }

  .nav-right,
  .nav-right a {
    display: none;
  }

  .login-mobile {
    display: flex;
  }

  .overlay-content h2 {
    font-size: 2rem;
  }

  .overlay-content p {
    font-size: 1rem;
  }

  .chat-popup {
    width: 90%;
    right: 5%;
  }

  .gallery-grid,
  .dashboard-boxes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .overlay-content h2 {
    font-size: 1.5rem;
  }

  .overlay-content p {
    font-size: 0.9rem;
  }

  .chat-icon {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  .chat-input button,
  .chat-input input {
    font-size: 14px;
  }
}

  .activity-list {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

/* DAFTAR KEGIATAN CARD */
.activity-card {
  background: white;
  border-left: 6px solid #2196f3;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease;
}

.activity-card:hover {
  transform: scale(1.02);
}

.activity-card h3 {
  color: #0d47a1;
  margin-bottom: 10px;
}

.activity-card p {
  margin-bottom: 6px;
  color: #555;
}

/* === CHAT MESSAGE STYLES === */
.chat-message {
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  max-width: 80%;
}

/* Pesan dari USER */
.chat-message.user {
  align-self: flex-start;
  background-color: #ffffff;
  color: #333;
  border-radius: 15px 15px 15px 0;
  padding: 10px 15px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Pesan dari ADMIN */
.chat-message.admin {
  align-self: flex-end;
  background-color: #0d47a1;
  color: #fff;
  border-radius: 15px 15px 0 15px;
  padding: 10px 15px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  text-align: right;
}

/* Avatar (optional) */
.chat-message .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-bottom: 4px;
}

/* Nama Pengirim (opsional) */
.chat-message .sender-name {
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 4px;
}

.pengumuman-box {
  background: #ffffff;
  border: 1px solid #ccc;
  border-left: 6px solid #0d47a1;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

.pengumuman-box h3 {
  margin-bottom: 12px;
  color: #0d47a1;
}

.pengumuman-box p {
  margin-bottom: 10px;
  line-height: 1.6;
  color: #444;
}

/* === DASHBOARD ADMIN STYLE === */

.admin-header {
  background-color: #0d47a1;
  padding: 2rem 1rem;
  text-align: center;
  color: #fff;
  font-size: 1.8rem;
  font-weight: bold;
}

.admin-nav {
  background-color: #0d47a1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 0 0 10px 10px;
  margin-top: -1rem;
}

.admin-nav .nav-item {
  background: #fff;
  color: #0d47a1;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.3s;
}

.admin-nav .nav-item:hover {
  background-color: #e3f2fd;
}

.admin-nav .logout {
  color: red;
}

.admin-content {
  text-align: center;
  margin-top: 2rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.admin-card {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0,0,0,0.05);
  transition: transform 0.2s;
}

.admin-card:hover {
  transform: translateY(-5px);
}

.admin-card h3 {
  color: #0d47a1;
  margin-bottom: 0.5rem;
}

.admin-card p {
  color: #444;
  margin-bottom: 1rem;
}

.admin-card .btn {
  background-color: #0d47a1;
  color: #fff;
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}

/* RESPONSIVE */
@media (max-width: 600px) {
  .admin-nav {
    flex-direction: column;
    align-items: center;
  }

  .admin-nav .nav-item {
    width: 90%;
    text-align: center;
  }

  .admin-header h1 {
    font-size: 1.4rem;
  }

  .admin-card {
    padding: 1.5rem;
  }
}

/* KELOLA KEGIATAN */
.admin-section {
  max-width: 900px;
  margin: auto;
  background-color: #fff;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.07);
  margin-top: 30px;
}

.admin-section h2 {
  font-size: 24px;
  color: #0b3e91;
  margin-bottom: 20px;
  text-align: center;
}

.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

table th, table td {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: left;
  font-size: 14px;
}

table th {
  background-color: #0b3e91;
  color: #fff;
}

.link-edit, .link-delete {
  text-decoration: none;
  font-weight: bold;
}

.link-edit {
  color: #2c7be5;
}

.link-delete {
  color: red;
}

@media (max-width: 600px) {
  .admin-section {
    padding: 15px;
  }

  table th, table td {
    font-size: 12px;
    padding: 8px;
  }
}

/* TAMBAH KEGIATAN */
.form-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-box input[type="text"],
.form-box input[type="date"],
.form-box textarea {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
}

.form-box label {
  font-weight: 600;
  margin-bottom: 4px;
}

.form-box textarea {
  resize: vertical;
  min-height: 100px;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.btn {
  background-color: #0b3e91;
  color: #fff;
  padding: 10px 18px;
  text-decoration: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

.btn-secondary {
  background-color: #888;
}

.btn:hover {
  background-color: #072d6a;
}

.btn-secondary:hover {
  background-color: #555;
}

@media (max-width: 600px) {
  .form-actions {
    flex-direction: column;
  }

  .btn, .btn-secondary {
    width: 100%;
    text-align: center;
  }
}

/* KELOLA GALERI */
.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 20px;
  justify-content: center;
}

.gallery-item {
  width: 200px;
  text-align: center;
  background-color: #fff;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
}

.gallery-item:hover {
  transform: scale(1.03);
}

.gallery-item img {
  width: 100%;
  border-radius: 10px;
  object-fit: cover;
}

.upload-date {
  font-size: 12px;
  color: gray;
  margin-top: 4px;
}

/* Tambahan responsif */
@media screen and (max-width: 600px) {
  .gallery-item {
    width: 100%;
  }
}

/* TAMBAH FOTO */
.form-box {
  max-width: 500px;
  margin: 0 auto;
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.form-box label {
  display: block;
  margin-top: 15px;
  font-weight: bold;
}

.form-box input[type="text"],
.form-box input[type="file"],
.form-box input[type="date"],
.form-box textarea {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  border-radius: 5px;
  border: 1px solid #ccc;
}

.form-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-secondary {
  background-color: #ccc;
  color: #000;
  text-decoration: none;
  padding: 10px 15px;
  border-radius: 5px;
}

@media screen and (max-width: 600px) {
  .form-box {
    padding: 15px;
  }

  .form-actions {
    flex-direction: column;
  }
}

/* KELOLA PENGUMUMAN */
.table-wrapper {
  overflow-x: auto;
  margin-top: 20px;
}

.responsive-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background-color: #fff;
}

.responsive-table th, .responsive-table td {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.responsive-table th {
  background-color: #0b3e91;
  font-weight: bold;
}

.action-link {
  font-weight: bold;
  text-decoration: none;
  margin: 0 5px;
}

.edit-link {
  color: #2c7be5; /* biru */
}

.delete-link {
  color: red; /* merah */
}

.delete-link:hover,
.edit-link:hover {
  text-decoration: underline;
}

.responsive-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

@media screen and (max-width: 600px) {
  .responsive-table th, .responsive-table td {
    font-size: 12px;
    padding: 8px;
  }

  .responsive-table td {
    white-space: normal;
  }
}

.chat-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  background-color: #f1f1f1;
  flex-wrap: wrap;
}

.chat-row.user {
  background-color: #e0f7fa;
}

.chat-row.admin {
  background-color: #e8f5e9;
  justify-content: flex-end;
}

.chat-checkbox {
  margin-top: 5px;
  transform: scale(1.2);
}

.chat-content {
  flex: 1;
  word-wrap: break-word;
  font-size: 14px;
  line-height: 1.5;
}

.btn-hapus {
  padding: 8px 16px;
  background-color: red;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.btn-hapus:hover {
  background-color: darkred;
}

/* Responsif di layar kecil */
@media (max-width: 600px) {
  .chat-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .chat-checkbox {
    margin-bottom: 5px;
  }
}

.chat-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.chat-row.user {
  background-color: #e0f7fa;
  flex-direction: row;
  justify-content: flex-start;
  text-align: left;
}

.chat-row.admin {
  background-color: #e8f5e9;
  flex-direction: row-reverse;
  justify-content: flex-end;
  text-align: right;
}

.chat-checkbox {
  margin-top: 5px;
  transform: scale(1.2);
  flex-shrink: 0;
}

.chat-content {
  flex: 1;
  word-wrap: break-word;
  font-size: 14px;
  line-height: 1.5;
  max-width: 90%;
}

/* Tombol */
.btn-hapus {
  padding: 8px 16px;
  background-color: red;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

.btn-hapus:hover {
  background-color: darkred;
}

/* Responsif Mobile */
@media (max-width: 600px) {
  .chat-row {
    flex-direction: column !important;
    align-items: flex-start;
    text-align: left !important;
  }

  .chat-row.admin {
    align-items: flex-end;
  }

  .chat-checkbox {
    margin-bottom: 5px;
  }

  .chat-content {
    max-width: 100%;
  }
}