/* ============================================================
   ADMIN PANEL & NEWS SYSTEM STYLES - KELURAHAN ABELI
   ============================================================ */

/* --- Category Badge Styles --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: capitalize;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.badge-berita {
  background: linear-gradient(135deg, #0d9488, #14b8a6);
  color: #ffffff;
}

.badge-daily {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: #ffffff;
}

.badge-hoax {
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
  color: #ffffff;
}

/* --- Admin Navbar Button & User Badge --- */
.nav-admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary-color, #0284c7), #0369a1);
  color: #fff !important;
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
  border: none;
  cursor: pointer;
  margin-left: 0.5rem;
}

.nav-admin-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.35);
  opacity: 0.95;
}

.admin-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(13, 148, 136, 0.12);
  color: #0d9488;
  border: 1px solid rgba(13, 148, 136, 0.3);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* --- Login Modal Overlay --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hidden {
  display: none !important;
}

.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-card {
  background: #ffffff;
  width: 90%;
  max-width: 420px;
  border-radius: 16px;
  padding: 2.2rem 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  position: relative;
  transform: translateY(0);
  transition: transform 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.modal-overlay.hidden .modal-card {
  transform: translateY(-20px);
}

.modal-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.modal-header-icon {
  width: 54px;
  height: 54px;
  background: #e0f2fe;
  color: #0284c7;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.8rem;
}

.modal-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.3rem;
}

.modal-subtitle {
  font-size: 0.88rem;
  color: #64748b;
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  transition: background 0.2s ease;
}

.modal-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* --- Admin Panel Main Container --- */
.admin-section {
  padding: 3rem 0;
  background: #f8fafc;
  border-top: 3px solid #0284c7;
}

.admin-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

@media (max-width: 992px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

.admin-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 1.8rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
}

.admin-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-size: 0.92rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%64748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 16px;
  padding-right: 2.2rem;
  appearance: none;
}

.form-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.form-text-muted {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #64748b;
}

.cover-preview-wrap {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
}

.cover-preview-img {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.6rem;
}

.cover-clear-btn {
  padding: 0.35rem 0.75rem !important;
  font-size: 0.82rem;
}

.admin-table .cover-thumb {
  width: 48px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  vertical-align: middle;
}

.news-card-cover {
  width: 100%;
  max-height: 200px;
  overflow: hidden;
  background: #f1f5f9;
}

.news-card-cover img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

/* --- Admin Table --- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.admin-table th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.admin-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: #334155;
}

.admin-table tbody tr:hover {
  background: #f8fafc;
}

.article-title-cell {
  font-weight: 600;
  color: #0f172a;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-preview-cell {
  color: #64748b;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
}

/* Action Buttons */
.btn-action-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action-edit:hover {
  background: #0284c7;
  color: #ffffff;
}

.btn-action-delete {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  background: #fef2f2;
  color: #ef4444;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 0.4rem;
}

.btn-action-delete:hover {
  background: #ef4444;
  color: #ffffff;
}

/* --- Public News Cards Section --- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.8rem;
  margin-top: 2rem;
}

.news-card {
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
}

.news-card-header {
  padding: 1.2rem 1.4rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.news-card-date {
  font-size: 0.78rem;
  color: #94a3b8;
}

.news-card-body {
  padding: 0.5rem 1.4rem 1.4rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.news-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.6rem;
  line-height: 1.4;
}

.news-card-desc {
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.6;
  flex-grow: 1;
}

.news-card-footer {
  padding: 0.8rem 1.4rem;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  font-size: 0.8rem;
  color: #64748b;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alert-message {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-danger {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* ============================================================
   RESPONSIVE MEDIA QUERIES (MOBILE & TABLET)
   ============================================================ */

@media (max-width: 992px) {
  .admin-section {
    padding: 2.2rem 0;
  }
  .admin-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .news-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
  }
}

@media (max-width: 768px) {
  .modal-card {
    width: 92%;
    padding: 1.8rem 1.4rem;
    border-radius: 14px;
  }
  .admin-card {
    padding: 1.3rem 1.1rem;
    border-radius: 12px;
  }
  .admin-card-title {
    font-size: 1.05rem;
  }
  .form-control {
    font-size: 0.9rem;
    padding: 0.6rem 0.8rem;
  }
  .admin-table th, .admin-table td {
    padding: 0.75rem 0.7rem;
    font-size: 0.84rem;
  }
  .article-title-cell {
    max-width: 140px;
  }
  .article-preview-cell {
    max-width: 160px;
  }
  .btn-action-edit, .btn-action-delete {
    padding: 0.4rem 0.65rem;
    font-size: 0.78rem;
  }
}

@media (max-width: 480px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
  .news-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .news-card-title {
    font-size: 1.02rem;
  }
  .form-actions {
    flex-direction: column;
  }
  .btn-action-delete {
    margin-left: 0;
    margin-top: 0.3rem;
  }
}
