/* KKMI Bareng Jombang - Style System & Presensi Upacara 17 Agustus 2026 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
  --primary: #dc2626;
  --primary-hover: #b91c1c;
  --primary-light: #fef2f2;
  --dark-bg: #0f172a;
  --dark-card: #15203b;
  --dark-text: #f8fafc;
  --light-bg: #f8fafc;
  --light-card: #ffffff;
  --light-text: #1e293b;
  --muted: #64748b;
  --border-light: #e2e8f0;
  --border-dark: #1e293b;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(220, 38, 38, 0.12);
  --transition: all 0.25s ease;
}

[data-theme="dark"] {
  --light-bg: #0b1329;
  --light-card: #15203b;
  --light-text: #f1f5f9;
  --muted: #94a3b8;
  --border-light: #1e293b;
  --primary-light: #370a0a;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background-color: var(--light-bg);
  color: var(--light-text);
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Patriotic Top Banner */
.hut-top-banner {
  background: linear-gradient(90deg, #dc2626 0%, #b91c1c 100%);
  color: #ffffff;
  padding: 8px 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.top-info span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 14px;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 2px solid #fca5a5;
  padding: 10px 0;
}

[data-theme="dark"] .navbar {
  background: rgba(21, 32, 59, 0.94);
  border-bottom-color: #7f1d1d;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.logo-badge.hut-badge {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #dc2626, #991b1b);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.3);
  border: 2px solid #ffffff;
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.1;
  color: #dc2626;
}

[data-theme="dark"] .brand-text h1 {
  color: #f87171;
}

.brand-text p {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.btn-theme {
  background: transparent;
  border: 1px solid var(--border-light);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--light-text);
  font-size: 1rem;
}

/* Hero Section */
.hero.hut-hero {
  padding: 40px 0 60px 0;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.95) 0%, rgba(153, 27, 27, 0.95) 100%), url('https://images.unsplash.com/photo-1596464716127-f2a82984de30?auto=format&fit=crop&w=1600&q=80');
  background-size: cover;
  background-position: center;
  color: #ffffff;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  text-align: center;
}

.hero-content {
  max-width: 750px;
  margin: 0 auto;
}

.hero-badge.hut-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
}

.hero-title span {
  color: #fef08a;
}

.hero-desc {
  font-size: 0.95rem;
  opacity: 0.92;
  margin-bottom: 24px;
  line-height: 1.6;
}

/* Single Stat Counter Card */
.single-stat-wrap {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.single-stat-card {
  background: var(--light-card);
  padding: 16px 28px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: var(--light-text);
  border: 2px solid #fca5a5;
}

.stat-icon.hut-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #fef2f2;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

[data-theme="dark"] .stat-icon.hut-icon {
  background: #7f1d1d;
  color: #fca5a5;
}

.single-stat-info {
  text-align: left;
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  color: #dc2626;
}

[data-theme="dark"] .stat-number {
  color: #f87171;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Main Section Layout */
.main-section {
  padding: 30px 0 60px 0;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.card-box {
  background: var(--light-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-box-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: #dc2626;
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 12px;
}

[data-theme="dark"] .card-box-header {
  color: #f87171;
}

.card-box-header i {
  font-size: 1.25rem;
}

.card-box-header h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--light-text);
}

.list-header {
  justify-content: space-between;
}

.list-header > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-total {
  background: #fef2f2;
  color: #dc2626;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid #fca5a5;
}

[data-theme="dark"] .badge-total {
  background: #7f1d1d;
  color: #fca5a5;
  border-color: #991b1b;
}

/* Form Styles */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--light-text);
}

.form-label i {
  color: #dc2626;
}

.required {
  color: #dc2626;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: var(--light-bg);
  color: var(--light-text);
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

/* Photo Upload Box */
.photo-upload-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--light-bg);
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed #fca5a5;
}

.photo-preview-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid #dc2626;
}

.default-photo-icon {
  font-size: 2.2rem;
  color: var(--muted);
}

.photo-preview-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-btn-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btn-photo {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fca5a5;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-photo:hover {
  background: #dc2626;
  color: #ffffff;
}

.photo-hint {
  font-size: 0.73rem;
  color: var(--muted);
}

/* Canvas TTD */
.sig-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-clear-sig {
  background: transparent;
  border: none;
  color: #dc2626;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-clear-sig:hover {
  text-decoration: underline;
}

.canvas-wrap {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
  touch-action: none;
}

#sigCanvas {
  width: 100%;
  height: 130px;
  display: block;
  cursor: crosshair;
}

/* Buttons */
.btn-submit {
  width: 100%;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
  margin-top: 10px;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.35);
}

/* Search Bar */
.search-bar {
  position: relative;
  margin-bottom: 16px;
}

.search-bar i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--light-bg);
  color: var(--light-text);
  font-size: 0.88rem;
  outline: none;
}

/* Presensi List Cards */
.presensi-cards-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.presensi-item-card {
  background: var(--light-bg);
  border-radius: 12px;
  border: 1px solid var(--border-light);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition);
}

.presensi-item-card:hover {
  border-color: #fca5a5;
  box-shadow: var(--shadow-sm);
}

.presensi-item-photo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #dc2626;
  flex-shrink: 0;
  background: var(--border-light);
}

.presensi-item-details {
  flex: 1;
  min-width: 0;
}

.presensi-item-nama {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--light-text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.presensi-item-lembaga {
  font-size: 0.8rem;
  color: #dc2626;
  font-weight: 700;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="dark"] .presensi-item-lembaga {
  color: #f87171;
}

.presensi-item-time {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

.presensi-item-sig {
  height: 36px;
  max-width: 70px;
  object-fit: contain;
  border-radius: 4px;
  background: #ffffff;
  padding: 2px;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

/* Footer */
.hut-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 24px 0;
  text-align: center;
  border-top: 1px solid #1e293b;
  font-size: 0.85rem;
}

.footer-sub {
  font-size: 0.78rem;
  margin-top: 4px;
  color: #cbd5e1;
}

.footer-copy {
  margin-top: 12px;
  font-size: 0.75rem;
  color: #64748b;
}

/* Toast Notification System */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 380px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  color: #ffffff;
  padding: 14px 18px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 14px;
  border-left: 5px solid #16a34a;
  animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.3s ease;
}

.toast.toast-error {
  border-left-color: #ef4444;
}

.toast.toast-warning {
  border-left-color: #f59e0b;
}

.toast-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(22, 163, 74, 0.2);
  color: #4ade80;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.toast-error .toast-icon-wrap {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.toast-warning .toast-icon-wrap {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.toast-body h4 {
  font-size: 0.92rem;
  font-weight: 800;
  margin-bottom: 2px;
  line-height: 1.2;
}

.toast-body p {
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.3;
}

.toast.toast-hiding {
  animation: fadeOutRight 0.3s forwards;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Responsive Breakpoints */
@media (max-width: 850px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 1.6rem;
  }

  .hero.hut-hero {
    padding: 30px 0 50px 0;
  }

  .single-stat-card {
    padding: 12px 20px;
  }

  .toast-container {
    left: 16px;
    right: 16px;
    top: 16px;
  }

  .toast {
    min-width: 100%;
  }
}

@media (max-width: 480px) {
  .top-info span {
    font-size: 0.72rem;
  }

  .brand-text h1 {
    font-size: 0.9rem;
  }

  .hero-title {
    font-size: 1.4rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .card-box {
    padding: 16px;
  }

  .presensi-item-sig {
    display: none;
  }
}
