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

:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e1b4b;
  --card-bg: rgba(30, 41, 59, 0.7);
  --card-border: rgba(255, 255, 255, 0.08);
  --accent-gradient: linear-gradient(135deg, #6366f1, #a855f7);
  --accent-hover-gradient: linear-gradient(135deg, #4f46e5, #9333ea);
  --danger-gradient: linear-gradient(135deg, #ef4444, #f43f5e);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --success: #10b981;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at top right, #1e1b4b, #0f172a 60%);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px;
}

.hidden {
  display: none !important;
}

/* Glassmorphism utility card */
.glass-panel {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Login Page Styling */
.login-page {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  background: radial-gradient(circle at center, #2e1065, #090514);
}

.login-box {
  width: 100%;
  max-width: 400px;
  padding: 40px 30px;
  text-align: center;
  animation: fadeIn 0.6s ease-out;
}

.login-box h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 25px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-box input {
  margin-bottom: 15px;
}

.login-box button {
  margin-top: 10px;
}

#error {
  color: #f87171;
  font-size: 0.9rem;
  margin-top: 15px;
  font-weight: 500;
  min-height: 20px;
}

/* Form Controls & Inputs */
input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

input:focus {
  outline: none;
  border-color: #818cf8;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
  background: rgba(15, 23, 42, 0.8);
}

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

/* Buttons */
button {
  width: 100%;
  padding: 14px;
  background: var(--accent-gradient);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  background: var(--accent-hover-gradient);
}

button:active {
  transform: translateY(1px);
}

button.secondary {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--text-main);
  box-shadow: none;
}

button.secondary:hover {
  background: rgba(148, 163, 184, 0.25);
  box-shadow: none;
}

button.btn-delete {
  background: var(--danger-gradient);
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 8px;
  width: auto;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

button.btn-delete:hover {
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  background: linear-gradient(135deg, #dc2626, #e11d48);
}

/* App Main Container */
.container {
  width: 100%;
  max-width: 900px;
  margin: 30px auto;
  padding: 35px;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
}

.topbar h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.topbar div {
  display: flex;
  align-items: center;
  gap: 15px;
}

.clock {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-left: 12px;
}

#roleText {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #a5b4fc;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.topbar button {
  width: auto;
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* Admin Input Panels */
.admin-only {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
  animation: fadeIn 0.4s ease-out;
}

.admin-only input {
  flex: 1;
}

.admin-only button {
  width: auto;
  padding: 14px 28px;
  white-space: nowrap;
}

/* Info Cards Grid & Typography */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.card {
  padding: 22px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-3px);
}

.card-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  font-weight: 600;
}

.card-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-value span {
  font-variant-numeric: tabular-nums;
}

/* Table Styling */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  margin: 30px 0;
}

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

th {
  background: rgba(15, 23, 42, 0.4);
  font-weight: 600;
  color: var(--text-muted);
  padding: 16px;
  border-bottom: 1px solid var(--card-border);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

td {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

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

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Status Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* Animations */


@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Clock JavaScript moved to index.js */

/* Responsive adjustments */
@media (max-width: 640px) {
  body {
    padding: 10px;
  }
  
  .container {
    padding: 20px;
    margin: 10px auto;
  }
  
  .admin-only {
    flex-direction: column;
    gap: 10px;
  }
  
  .admin-only button {
    width: 100%;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .topbar div {
    width: 100%;
    justify-content: space-between;
  }
}

/* ==========================================================================
   PENINGKATAN FITUR: Progress Bar, Search, Filter & Modal
   ========================================================================== */

/* Progress Bar */
.progress-container {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  height: 24px;
  position: relative;
  overflow: hidden;
  margin: 10px 0 25px 0;
  display: flex;
  align-items: center;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #10b981);
  width: 0%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
  position: absolute;
  width: 100%;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  letter-spacing: 0.05em;
}

/* Search & Filter Bar Row */
.search-filter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-top: 25px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.search-wrapper {
  position: relative;
  flex: 1;
  min-width: 250px;
}

.search-wrapper input {
  padding-left: 42px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.filter-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--card-border);
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
}

.filter-tab {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  color: var(--text-muted);
  width: auto;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  transform: none;
  box-shadow: none;
}

.filter-tab.active {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.filter-tab.active:hover {
  background: var(--accent-hover-gradient);
}

/* Action Buttons & Utilities */
button.btn-edit {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 8px;
  width: auto;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 6px;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

button.btn-edit:hover {
  background: var(--accent-gradient);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

button.btn-edit:active {
  transform: translateY(1px);
}

button.btn-share {
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: white;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.9rem;
  width: auto;
  margin-left: auto;
  border-radius: 12px;
}

button.btn-share:hover {
  background: linear-gradient(135deg, #20ba5a, #0e7065);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
  transform: translateY(-2px);
}

button.btn-share svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.share-container {
  display: flex;
  justify-content: flex-end;
  margin-top: 15px;
}

/* Modal Edit */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 5, 20, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  width: 90%;
  max-width: 450px;
  padding: 30px;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.modal-overlay.active .modal-box {
  transform: scale(1);
}

.modal-box h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 20px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.modal-body label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: -5px;
}

.modal-footer {
  display: flex;
  gap: 12px;
  margin-top: 25px;
}

.modal-footer button {
  flex: 1;
}

/* Card Icons */
.card-header-icon {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.card-icon {
  color: #a5b4fc;
  width: 24px;
  height: 24px;
}

/* Responsive fixes for search & filters */
@media (max-width: 640px) {
  .search-filter-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-tabs {
    justify-content: center;
  }
  
  .filter-tab {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
  }

  button.btn-share {
    width: 100%;
    margin-left: 0;
  }
}

