/* ==========================================================================
   Portal Rasmi Sistem Digital SMK Matu (semmat.click)
   Tema Cerah & Warna Lembut (Airy Light-Frosted Glassmorphism)
   ========================================================================== */

:root {
  --bg-light: #f0f9ff;
  --bg-soft: #e0f2fe;
  --surface-card: rgba(255, 255, 255, 0.82);
  --surface-card-hover: rgba(255, 255, 255, 0.94);
  --border-subtle: rgba(148, 163, 184, 0.28);
  --border-glow: rgba(56, 189, 248, 0.55);
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent-sky: #0284c7;
  --accent-mint: #059669;
  --accent-amber: #d97706;
  --badge-soon-bg: rgba(254, 243, 199, 0.92);
  --badge-soon-border: rgba(245, 158, 11, 0.45);
  --badge-soon-text: #b45309;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-pill: 9999px;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: var(--bg-light);
  min-height: 100vh;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Atmospheric Full-Viewport Background (Bright & Airy)
   ========================================================================== */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(135deg, #e0f2fe 0%, #ecfdf5 48%, #fefce8 100%);
}

.bg-image {
  position: absolute;
  inset: -20px;
  background-image: url('../assets/bg-school.svg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.52;
  transform: scale(1.02);
  filter: saturate(1.05) brightness(1.06);
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(240, 249, 255, 0.72) 0%,
    rgba(236, 253, 245, 0.68) 50%,
    rgba(248, 250, 252, 0.84) 100%
  );
  backdrop-filter: blur(4px);
}

.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(95px);
  opacity: 0.45;
  pointer-events: none;
}

.bg-glow-1 {
  width: 520px;
  height: 520px;
  top: -140px;
  left: -100px;
  background: radial-gradient(circle, rgba(125, 211, 252, 0.65), transparent 70%);
}

.bg-glow-2 {
  width: 480px;
  height: 480px;
  bottom: -160px;
  right: -100px;
  background: radial-gradient(circle, rgba(167, 243, 208, 0.65), transparent 70%);
}

/* ==========================================================================
   Layout Container
   ========================================================================== */
.page-wrapper {
  max-width: 1260px;
  margin: 0 auto;
  padding: 2.25rem 1.5rem 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Header & Branding
   ========================================================================== */
.site-header {
  margin-bottom: 2.25rem;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  margin-bottom: 1.75rem;
}

.crest-wrapper {
  flex-shrink: 0;
  width: 78px;
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 8px 16px rgba(15, 23, 42, 0.16));
}

.school-crest {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.school-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.25rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-sky);
  background: rgba(224, 242, 254, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-pill);
}

.site-title {
  font-size: clamp(1.6rem, 3.2vw, 2.45rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text-primary);
}

.site-subtitle {
  font-size: clamp(0.92rem, 1.5vw, 1.05rem);
  color: var(--text-secondary);
  max-width: 680px;
}

/* ==========================================================================
   Search & Filter Bar
   ========================================================================== */
.controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  box-shadow:
    0 12px 30px -8px rgba(15, 23, 42, 0.08),
    0 2px 6px rgba(15, 23, 42, 0.04);
}

.search-box {
  position: relative;
  flex: 1 1 280px;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.95rem;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.68rem 1rem 0.68rem 2.65rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-primary);
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  background: #ffffff;
  border-color: var(--accent-sky);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.22);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.58rem 1rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(241, 245, 249, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  color: var(--text-primary);
  background: #ffffff;
}

.filter-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, #0ea5e9, #10b981);
  border-color: transparent;
  box-shadow: 0 6px 16px -4px rgba(14, 165, 233, 0.4);
}

.filter-count {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.08);
}

.filter-btn.active .filter-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* ==========================================================================
   Main Grid & Tactile 3D Pastel Cards
   ========================================================================== */
.main-content {
  flex: 1;
}

.systems-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.35rem;
  perspective: 1200px;
}

.system-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.45rem 1.35rem 1.35rem;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.82) 100%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px);
  /* Soft elevated 3D shadow */
  box-shadow:
    0 6px 0 0 rgba(203, 213, 225, 0.72),
    0 14px 28px -8px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 0 rgba(255, 255, 255, 1);
  transform-style: preserve-3d;
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.28s ease;
  overflow: hidden;
  cursor: pointer;
}

/* 2D Cartoon illustration background inside each card */
.card-cartoon-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right bottom;
  z-index: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.system-card:hover .card-cartoon-bg {
  transform: scale(1.05);
}

.card-cartoon-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    95deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(255, 255, 255, 0.78) 48%,
    rgba(255, 255, 255, 0.18) 100%
  );
}

/* Glossy animated sheen */
.system-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 70%;
  height: 100%;
  z-index: 2;
  background: linear-gradient(
    110deg,
    transparent 0%,
    rgba(255, 255, 255, 0.25) 45%,
    rgba(255, 255, 255, 0.65) 50%,
    rgba(255, 255, 255, 0.25) 55%,
    transparent 100%
  );
  transform: skewX(-20deg);
  transition: left 0.65s ease;
  pointer-events: none;
}

.system-card:hover::before {
  left: 150%;
}

.system-card:hover,
.system-card:focus-visible {
  transform: translateY(-7px);
  border-color: var(--card-accent, var(--border-glow));
  box-shadow:
    0 11px 0 0 rgba(203, 213, 225, 0.8),
    0 22px 38px -10px rgba(15, 23, 42, 0.14),
    0 0 26px -4px var(--card-glow, rgba(56, 189, 248, 0.32)),
    inset 0 1px 0 0 rgba(255, 255, 255, 1);
  outline: none;
}

.system-card:active {
  transform: translateY(-2px);
  box-shadow:
    0 3px 0 0 rgba(203, 213, 225, 0.85),
    0 8px 16px -4px rgba(15, 23, 42, 0.12);
}

.card-top,
.card-body,
.card-footer {
  position: relative;
  z-index: 1;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.card-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #ffffff, var(--card-accent-soft, rgba(56, 189, 248, 0.16)));
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 6px 14px -3px rgba(15, 23, 42, 0.08),
    inset 0 1px 1px rgba(255, 255, 255, 0.9);
  color: var(--card-accent, var(--accent-sky));
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.system-card:hover .card-icon-wrap {
  transform: scale(1.08) translateZ(12px);
}

.card-icon-wrap svg {
  width: 26px;
  height: 26px;
}

.card-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.26rem 0.65rem;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
}

.badge-aktif {
  color: #047857;
  background: rgba(209, 250, 229, 0.9);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-akan-datang {
  color: var(--badge-soon-text);
  background: var(--badge-soon-bg);
  border: 1px solid var(--badge-soon-border);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.card-title {
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

.card-desc {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--card-accent, var(--accent-sky));
}

.card-arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.22s ease;
}

.system-card:hover .card-arrow {
  transform: translateX(4px);
}

/* ==========================================================================
   Empty State
   ========================================================================== */
.empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: rgba(255, 255, 255, 0.82);
  border: 1px dashed rgba(148, 163, 184, 0.5);
  border-radius: var(--radius-lg);
  max-width: 460px;
  margin: 2rem auto;
}

.empty-state svg {
  width: 44px;
  height: 44px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.empty-state h2 {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.empty-state p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.reset-btn {
  padding: 0.6rem 1.2rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
  background: var(--accent-sky);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(148, 163, 184, 0.28);
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.site-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover {
  color: var(--accent-sky);
  text-decoration: underline;
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  max-width: 400px;
  padding: 1rem 1.15rem;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--badge-soon-border);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(12px);
  transform: translateY(130%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--accent-amber);
  margin-top: 2px;
}

.toast-title {
  display: block;
  font-size: 0.92rem;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.toast-message {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.2rem;
}

.toast-close:hover {
  color: var(--text-primary);
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 768px) {
  .page-wrapper {
    padding: 1.5rem 1rem;
  }

  .brand-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
  }

  .crest-wrapper {
    width: 64px;
    height: 64px;
  }

  .controls-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    justify-content: space-between;
  }

  .filter-btn {
    flex: 1;
    justify-content: center;
    padding: 0.55rem 0.6rem;
    font-size: 0.82rem;
  }

  .toast {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .system-card,
  .system-card::before,
  .card-bg-graphic,
  .toast {
    transition: none;
  }
}
