/* DESIGN SYSTEM - ISP Portal */

:root {
  /* Primary Colors */
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --primary-color: #667eea;
  --primary-dark: #764ba2;
  
  /* Secondary Colors */
  --secondary-color: #6c757d;
  --accent-color: #4895ef;
  
  /* Status Colors */
  --success-color: #198754;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --info-color: #0dcaf0;
  
  /* Neutral Colors */
  --white: #ffffff;
  --light: #f8f9fa;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  --dark: #212529;
  
  /* Typography */
  --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 50rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Transitions */
  --transition-fast: 0.15s ease-in-out;
  --transition-base: 0.3s ease-in-out;
  --transition-slow: 0.5s ease-in-out;
  
  /* Z-index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 1080;
}

/* Global Base Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--gray-900);
  background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
  margin: 0;
  padding: 0;
}

/* Component Styles */

/* Cards WITH ICONS */
.card {
  border: none;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  background: var(--white);
  position: relative;
  overflow: hidden;
}

.card::after {
  content: '\2728' !important; /* Unicode: ✨ */
  position: absolute !important;
  top: 1rem !important;
  right: 1rem !important;
  font-size: 1.5rem !important;
  opacity: 0 !important;
  transition: all 0.3s ease !important;
  pointer-events: none !important;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card:hover::after {
  opacity: 0.3;
  transform: rotate(15deg);
}

/* Buttons - Simple Modern */
.btn {
  border-radius: 6px;
  font-weight: 500;
  transition: opacity 0.2s ease;
  border: none;
}

.btn-primary {
  background: #667eea !important;
  color: white !important;
}

.btn-primary:hover {
  background: #5568d3 !important;
  color: white !important;
}

.btn-secondary {
  background: #64748b !important;
  color: white !important;
}

.btn-secondary:hover {
  background: #475569 !important;
  color: white !important;
}

.btn-success {
  background: #10b981 !important;
  color: white !important;
}

.btn-success:hover {
  background: #059669 !important;
  color: white !important;
}

.btn-warning {
  background: #f59e0b !important;
  color: white !important;
}

.btn-warning:hover {
  background: #d97706 !important;
  color: white !important;
}

.btn-danger {
  background: #ef4444 !important;
  color: white !important;
}

.btn-danger:hover {
  background: #dc2626 !important;
  color: white !important;
}

.btn-info {
  background: #06b6d4 !important;
  color: white !important;
}

.btn-info:hover {
  background: #0891b2 !important;
  color: white !important;
}

/* Navbar */
.navbar {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.navbar-brand {
  font-weight: 700;
  color: var(--primary-color) !important;
  letter-spacing: -0.5px;
}

/* Forms WITH ICONS */
.form-control {
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-300);
  transition: all var(--transition-fast);
  padding: 0.75rem 1rem;
  position: relative;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
  padding-right: 2.5rem;
}

.form-control:focus::after {
  content: '\270E' !important; /* Unicode: ✎ */
  position: absolute !important;
  right: 0.75rem !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: var(--primary-color) !important;
  font-size: 1rem !important;
}

.form-label {
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: var(--spacing-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-label::before {
  content: '\26A1' !important; /* Unicode: ⚡ */
  font-size: 0.9rem !important;
  opacity: 0.7 !important;
}

/* Tables WITH ICONS */
.table {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.table::before {
  content: '\1F4CB' !important; /* Unicode: 📋 */
  position: absolute !important;
  top: -10px !important;
  right: 1rem !important;
  font-size: 1.5rem !important;
  opacity: 0.1 !important;
  z-index: 0 !important;
  pointer-events: none !important;
}

.table th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-700);
  border: none;
  padding: 1rem;
  position: relative;
}

.table th::after {
  content: '\25BE' !important; /* Unicode: ▾ */
  position: absolute !important;
  right: 0.5rem !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  font-size: 0.8rem !important;
  color: var(--gray-400) !important;
  opacity: 0 !important;
  transition: all 0.3s ease !important;
}

.table th:hover::after {
  opacity: 1;
}

.table td {
  border: none;
  padding: 1rem;
  vertical-align: middle;
  position: relative;
}

.table td::before {
  content: '\25B8' !important; /* Unicode: ▸ */
  position: absolute !important;
  left: 0.5rem !important;
  color: var(--gray-300) !important;
  font-size: 0.7rem !important;
  opacity: 0 !important;
  transition: all 0.3s ease !important;
}

.table tbody tr:hover td::before {
  opacity: 1;
  left: 0.25rem;
  color: var(--primary-color);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out;
}

.animate-slide-in {
  animation: slideIn 0.3s ease-out;
}

/* Utility Classes */
.gradient-bg {
  background: var(--primary-gradient);
}

.text-gradient {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass-effect {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Responsive Design */
@media (max-width: 768px) {
  .btn {
    padding: 0.6rem 1.2rem;
    font-size: var(--font-size-sm);
  }
  
  .card {
    margin-bottom: var(--spacing-lg);
  }
  
  .container {
    padding: 0 var(--spacing-md);
  }
}

/* Dark mode support (future) */
@media (prefers-color-scheme: dark) {
  :root {
    --white: #1a1a1a;
    --light: #2d2d2d;
    --gray-100: #2d2d2d;
    --gray-900: #ffffff;
  }
}

/* ============================================================
   CHECKBOX / TOGGLE DEFAULT (seluruh aplikasi)
   Pakai: <div class="form-check form-check-tidy"> + input + label
   Jangan pakai .form-switch (bentrok dengan padding global).
   Toggle dengan badge: label berisi <span class="form-check-status">
   ============================================================ */
.form-check:not(.form-switch) .form-check-input,
.form-check-tidy .form-check-input {
  width: 1.25em !important;
  height: 1.25em !important;
  min-width: 1.25em;
  min-height: 1.25em;
  border: 2px solid var(--border, rgba(0,0,0,0.15)) !important;
  background-color: var(--panel, #fff) !important;
  cursor: pointer;
  margin-top: 0.15em;
  flex-shrink: 0;
  appearance: auto !important;
  -webkit-appearance: checkbox !important;
  -moz-appearance: checkbox !important;
  transition: all 0.3s ease;
  padding: 0 !important;
  box-shadow: none !important;
}
.form-check-tidy .form-check-input {
  margin-top: 0 !important;
}
.form-check:not(.form-switch) .form-check-input:focus,
.form-check-tidy .form-check-input:focus {
  border-color: var(--primary, #0d6efd) !important;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
  outline: none;
}
.form-check:not(.form-switch) .form-check-input:checked,
.form-check-tidy .form-check-input:checked {
  background-color: var(--primary, #0d6efd) !important;
  border-color: var(--primary, #0d6efd) !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 100% 100% !important;
}
.form-check:not(.form-switch) .form-check-input:not(:checked),
.form-check-tidy .form-check-input:not(:checked) {
  background-color: var(--panel, #fff) !important;
  border-color: var(--border, rgba(0,0,0,0.15)) !important;
}
.form-check:not(.form-switch) .form-check-input:hover,
.form-check-tidy .form-check-input:hover {
  border-color: var(--primary, #0d6efd) !important;
}
.form-check:not(.form-switch) .form-check-label {
  margin-left: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.form-check:not(.form-switch) {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  background-color: var(--bg-2, #f8f9fa);
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  border-radius: 8px;
  margin-top: 0.5rem;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.form-check:not(.form-switch):hover {
  background-color: var(--bg-1, #f1f3f5);
  border-color: rgba(102, 126, 234, 0.25);
}
[data-theme="dark"] .form-check:not(.form-switch) {
  background-color: var(--panel-2, #1e293b);
  border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .form-check:not(.form-switch):hover {
  background-color: var(--panel, #334155);
  border-color: rgba(255,255,255,0.12);
}
/* Variant: form-check-tidy (kotak rapi, label di samping checkbox) */
.form-check-tidy {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
  background-color: rgba(248, 249, 250, 0.6);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 10px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.form-check-tidy:hover {
  background-color: rgba(248, 249, 250, 0.9);
  border-color: rgba(0,0,0,0.1);
}
[data-theme="dark"] .form-check-tidy {
  background-color: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .form-check-tidy:hover {
  background-color: rgba(255,255,255,0.1);
}
.form-check-tidy .form-check-input {
  flex-shrink: 0;
  margin-top: 0;
  margin-left: 0;
}
.form-check-tidy .form-check-label {
  margin-left: 0.5rem;
  margin-bottom: 0;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.form-check-tidy .form-check-label:has(.form-check-status) {
  margin-left: 0;
  justify-content: flex-end;
}

.form-check-status {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 6px;
  min-width: 4.5rem;
  justify-content: center;
}
.form-check-status.status-aktif {
  background-color: #16a34a !important;
  color: #ffffff !important;
}
.form-check-status.status-tidak-aktif {
  background-color: #475569 !important;
  color: #ffffff !important;
}
[data-theme="dark"] .form-check-status.status-aktif {
  background-color: #16a34a !important;
  color: #ffffff !important;
}
[data-theme="dark"] .form-check-status.status-tidak-aktif {
  background-color: #475569 !important;
  color: #ffffff !important;
}
