/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 2rem;
  font-family: var(--font-body);
  font-size: .938rem;
  font-weight: 600;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .25s cubic-bezier(.4, 0, .2, 1);
  line-height: 1.4;
}

.btn-primary {
  background: #1e40af;
  color: #ffffff;
  border-color: #1e40af;
}

.btn-primary:hover {
  background: #172554;
  border-color: #172554;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(30, 64, 175, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--biru);
  border-color: var(--biru);
}

.btn-outline:hover {
  background: var(--biru);
  color: var(--putih);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(29, 78, 137, .2);
}

.btn-gradient {
  background: linear-gradient(135deg, var(--biru), #2563eb);
  color: var(--putih);
  border: none;
  padding: 14px 34px;
}

.btn-gradient:hover {
  color: var(--putih);
  opacity: .92;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(29, 78, 137, .3);
}

.btn-lg {
  padding: 16px 40px;
  font-size: 1rem;
}

.btn-sm {
  padding: .4rem .9rem;
  font-size: .813rem;
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border-color: var(--gray-200);
}

.btn-secondary:hover {
  background: var(--gray-200);
  color: var(--gray-800);
  border-color: var(--gray-300);
}

/* ===== TABLE SEARCH ===== */
.search-form-container {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 2rem;
  width: 100%;
}

.search-input-wrapper {
  flex: 1;
  min-width: 0;
  position: relative;
}

.search-input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.page-search-input {
  width: 100%;
  padding: .75rem 1rem .75rem 2.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: .938rem;
  font-family: inherit;
  outline: none;
  background: #ffffff;
  color: #0f172a;
  transition: border-color .2s, box-shadow .2s;
  box-sizing: border-box;
}

.page-search-input:focus {
  border-color: #1e40af;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.search-btn-submit {
  flex-shrink: 0;
  white-space: nowrap;
  border: none;
  border-radius: 12px;
  padding: .75rem 1.5rem;
  font-size: .938rem;
  cursor: pointer;
  height: 48px;
  justify-content: center;
}

@media (max-width: 576px) {
  .search-form-container {
    gap: .5rem;
  }
  .search-btn-submit {
    padding: .75rem 1rem;
  }
}

.table-search {
  display: flex;
  align-items: center;
  gap: .625rem;
  margin: 1.5rem 0 .75rem;
  flex-wrap: wrap;
}

.search-wrapper {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 1;
  min-width: 200px;
  background: var(--putih);
  border: 1.5px solid var(--gray-200);
  border-radius: 12px;
  padding: .5rem .875rem;
  transition: all .2s;
}

.search-wrapper:focus-within {
  border-color: var(--biru);
  box-shadow: 0 0 0 3px rgba(29, 78, 137, 0.1);
}

.search-wrapper i {
  color: var(--gray-400);
  font-size: .85rem;
}

.search-wrapper input {
  border: none;
  background: none;
  outline: none;
  flex: 1;
  font-size: .875rem;
  font-family: inherit;
  color: var(--gray-700);
}

.search-wrapper input::placeholder {
  color: var(--gray-400);
}

/* ===== CARD ===== */
.card {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  transition: all .25s cubic-bezier(.4, 0, .2, 1);
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.04);
}

.card-hoverable:hover,
.card-hover:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  transform: translateY(-2px);
  border-color: #cbd5e1;
}

.card-img {
  overflow: hidden;
  border-radius: 12px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform .5s cubic-bezier(.4, 0, .2, 1);
}

.card-prestasi .card-img::after,
.gallery-card::after,
.watermark::after {
  content: 'SMP Negeri 2 Cisaat';
  position: absolute;
  bottom: 6px;
  right: 8px;
  color: rgba(255, 255, 255, .5);
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .4);
  pointer-events: none;
  z-index: 1;
  white-space: nowrap;
  line-height: 1;
}

.watermark {
  position: relative;
  overflow: hidden;
}

.card-hoverable:hover .card-img img {
  transform: scale(1.02);
}

.card-img-placeholder {
  width: 100%;
  height: 100%;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #ffffff;
  font-size: 2.5rem;
  font-weight: 700;
}

.card-body {
  padding: 1.25rem 1.5rem;
}

.card-date {
  display: block;
  font-size: .75rem;
  color: #dc2626;
  font-weight: 600;
  margin-bottom: .4rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: #0f172a;
  margin-bottom: .5rem;
  font-weight: 700;
  line-height: 1.35;
}

.card-text {
  color: #475569;
  font-size: .875rem;
  line-height: 1.65;
}

/* ===== BADGE & TINGKAT PRESTASI ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .8rem;
  font-size: .7rem;
  font-weight: 700;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .5rem;
}

.badge-emas {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-biru {
  background: rgba(30, 64, 175, .08);
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.badge-merah {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.badge-nasional {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.1);
}

.badge-provinsi {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  box-shadow: 0 1px 3px rgba(30, 64, 175, 0.1);
}

.badge-kabupaten {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
  box-shadow: 0 1px 3px rgba(180, 83, 9, 0.08);
}

.badge-kecamatan {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* ===== CARD PRESTASI ===== */
.card-prestasi {
  position: relative;
}

.card-prestasi .badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  margin-bottom: 0;
}

.prestasi-img-link:hover img {
  transform: scale(1.02);
}

.card-prestasi .card-img {
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-prestasi .card-img img {
  object-fit: contain !important;
}

/* ===== FORM ===== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: .375rem;
}

.form-control {
  width: 100%;
  padding: .75rem 1rem;
  font-family: var(--font-body);
  font-size: .938rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: var(--putih);
  color: var(--charcoal);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}

.form-control:focus {
  border-color: var(--biru);
  box-shadow: 0 0 0 3px rgba(29, 78, 137, .1);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* ===== TABLE ===== */
.table-container {
  overflow-x: auto;
  background: var(--putih);
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, .04);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--biru);
  color: var(--putih);
}

th {
  padding: .875rem 1.25rem;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  text-align: left;
}

.sticky-th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--biru);
}

td {
  padding: .75rem 1.25rem;
  font-size: .875rem;
  border-bottom: 1px solid rgba(0, 0, 0, .04);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(29, 78, 137, .02);
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .375rem;
  margin-top: 2.5rem;
  list-style: none;
  padding: 0;
}

.pagination li {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 .75rem;
  font-size: .875rem;
  font-weight: 500;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  transition: all .2s ease;
}

.pagination a:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: #f8fafc;
}

.pagination li.active a,
.pagination li.active span,
.pagination .active a,
.pagination .active span {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* ===== FLASH MESSAGES ===== */
.flash-message {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.flash-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.flash-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* ===== LIGHTBOX ===== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, .92);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox-content {
  max-width: 90%;
  max-height: 85%;
  object-fit: contain;
  border-radius: 12px;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  font-size: 2.5rem;
  color: white;
  cursor: pointer;
  transition: opacity .2s;
  line-height: 1;
  opacity: .7;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: .938rem;
  font-weight: 500;
  background: rgba(0, 0, 0, .5);
  padding: .5rem 1.5rem;
  border-radius: 100px;
}

/* ===== TABS ===== */
.tab-nav {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid #e2e8f0;
  overflow-x: auto;
}

.tab-nav-item {
  padding: .65rem 1.25rem;
  font-size: .875rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .2s, border-color .2s;
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}

.tab-nav-item:hover {
  color: var(--biru);
  background: rgba(29, 78, 137, 0.03);
}

.tab-nav-item.active {
  color: var(--biru);
  border-bottom-color: var(--biru);
}

.tab-nav-item i {
  font-size: .85rem;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* ===== STAR RATING ===== */
.star-rating {
  display: inline-flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 2px;
}

.star-rating input {
  display: none;
}

.star-rating label {
  cursor: pointer;
  font-size: 1.5rem;
  color: #d1d5db;
  transition: color .2s, transform .1s;
}

.star-rating label:hover,
.star-rating label:hover~label,
.star-rating input:checked~label {
  color: #f59e0b;
}

.star-rating label:hover {
  transform: scale(1.15);
}

.star-rating label i {
  pointer-events: none;
}

/* ===== Accordion ===== */
.accordion {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.accordion-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}

.accordion-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .06);
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  user-select: none;
}

.accordion-icon {
  font-size: .8rem;
  color: #94a3b8;
  transition: transform .25s ease;
  flex-shrink: 0;
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease, padding .3s ease;
  padding: 0 1.25rem;
}

.accordion-item.active .accordion-body {
  max-height: 1000px;
  padding: 0 1.25rem 1.25rem;
}

/* ===== CUSTOM UPLOAD ===== */
.custom-upload-wrapper {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.custom-upload-wrapper input[type="file"] {
  display: none;
}

.custom-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .625rem 1.25rem;
  background: var(--biru, #1D4E89);
  color: #fff;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  border: none;
}

.custom-upload-btn:hover {
  background: #153A66;
}

.custom-upload-btn i {
  font-size: .95rem;
}

.custom-upload-name {
  font-size: .825rem;
  color: #4a5568;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.custom-upload-name.empty {
  color: #94a3b8;
}

/* ===== PAGE INDICATOR ===== */
.page-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-bottom: 1rem;
}

.page-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 .625rem;
  border-radius: 8px;
  font-size: .813rem;
  font-weight: 600;
  background: var(--putih);
  color: var(--text);
  border: 1px solid #e2e8f0;
  transition: all .2s;
}

.page-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ===== MODAL ===== */
.modal-overlay {
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.4);
    backdrop-filter:blur(4px);
    z-index:1000;
    align-items:center;
    justify-content:center;
    padding:1rem;
}
.modal-overlay.active { display:flex; }
.modal-box {
    background:var(--putih);
    border-radius:var(--radius-lg);
    width:100%;
    max-width:480px;
    box-shadow:var(--shadow-lg);
    animation:modalIn .2s ease-out;
}
.modal-header {
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:1.25rem 1.5rem;
    border-bottom:1px solid var(--border);
}
.modal-header h3 {
    margin:0;
    font-size:1.05rem;
    color:var(--gray-800);
}
.modal-close {
    background:none;
    border:none;
    font-size:1.5rem;
    color:var(--gray-400);
    cursor:pointer;
    padding:0;
    line-height:1;
}
.modal-close:hover { color:var(--gray-600); }
.modal-body { padding:1.5rem; }
.modal-footer {
    display:flex;
    gap:.75rem;
    justify-content:flex-end;
    padding:1rem 1.5rem;
    border-top:1px solid var(--border);
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  font-size: .875rem;
  color: rgba(255, 255, 255, .85);
  font-weight: 500;
}

.breadcrumb a {
  color: #f59e0b;
  text-decoration: none;
  font-weight: 600;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb .fa-chevron-right {
  font-size: .6rem;
  margin: 0 .35rem;
  opacity: .7;
}

.breadcrumb span {
  color: #ffffff;
}
