/* =========================================================
   IDG UI - Custom INDUNGI UI Library
   Replacement for common jQuery UI needs:
   draggable, droppable, sortable, resizable, datepicker,
   progressbar, position, effects.
   No jQuery dependency.
   ========================================================= */

:root {
  --idg-bg: #07090f;
  --idg-panel: #090d15;
  --idg-panel-2: #0d141f;
  --idg-panel-3: #111926;
  --idg-border: rgba(255,255,255,.08);
  --idg-border-soft: rgba(255,255,255,.045);
  --idg-text: #f7f9ff;
  --idg-muted: #9aa6ba;
  --idg-cyan: #00eaff;
  --idg-orange: #ff6a00;
  --idg-purple: #8b57ff;
  --idg-red: #ff3347;
  --idg-green: #39ff87;
  --idg-radius: 18px;
  --idg-radius-sm: 12px;
  --idg-shadow: 0 18px 46px rgba(0,0,0,.45);
  --idg-font: Segoe UI, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body.idg-ui-demo-page {
  margin: 0;
  min-height: 100vh;
  font-family: var(--idg-font);
  color: var(--idg-text);
  background:
    radial-gradient(circle at 10% 0%, rgba(0,234,255,.09), transparent 24%),
    radial-gradient(circle at 90% 0%, rgba(255,106,0,.10), transparent 22%),
    linear-gradient(135deg,#040509,#0b1018 48%,#07090f);
}

body.idg-ui-demo-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .08;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, black, transparent 88%);
}

.idg-ui-page {
  width: min(1400px, calc(100% - 28px));
  margin: 24px auto;
  position: relative;
  z-index: 1;
}

.idg-ui-topbar {
  min-height: 78px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  border: 1px solid var(--idg-border);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.035), transparent 42%),
    rgba(9,13,21,.88);
  box-shadow: var(--idg-shadow);
  margin-bottom: 18px;
}

.idg-ui-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.idg-ui-brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 1000;
  clip-path: polygon(50% 0,92% 22%,92% 78%,50% 100%,8% 78%,8% 22%);
  border: 2px solid rgba(0,234,255,.25);
  background:
    radial-gradient(circle, rgba(0,234,255,.22), transparent 70%),
    rgba(255,255,255,.035);
  box-shadow: 0 0 20px rgba(0,234,255,.14);
}

.idg-ui-brand h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.idg-ui-brand h1 span {
  color: var(--idg-cyan);
}

.idg-ui-brand p {
  margin: 5px 0 0;
  color: var(--idg-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
}

.idg-ui-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.idg-ui-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--idg-border);
  border-radius: var(--idg-radius-sm);
  background: rgba(255,255,255,.035);
  color: var(--idg-text);
  padding: 0 13px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .8px;
  transition: .18s ease;
}

.idg-ui-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(0,234,255,.30);
  box-shadow: 0 10px 18px rgba(0,0,0,.22);
}

.idg-ui-btn-primary {
  border-color: rgba(255,106,0,.32);
  background: linear-gradient(135deg, rgba(255,106,0,.24), rgba(255,51,71,.13));
}

.idg-ui-btn-cyan {
  border-color: rgba(0,234,255,.28);
  background: rgba(0,234,255,.07);
}

.idg-ui-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  gap: 18px;
  align-items: start;
}

.idg-ui-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.idg-ui-card {
  border: 1px solid var(--idg-border);
  border-radius: var(--idg-radius);
  background:
    linear-gradient(135deg, rgba(255,255,255,.026), transparent 42%),
    rgba(9,13,21,.88);
  box-shadow: var(--idg-shadow);
  overflow: hidden;
  position: relative;
}

.idg-ui-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,.016), transparent 42%),
    radial-gradient(circle at 0 0, rgba(0,234,255,.035), transparent 28%);
}

.idg-ui-card-head {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 18px;
  border-bottom: 1px solid var(--idg-border-soft);
  color: var(--idg-cyan);
  text-transform: uppercase;
  letter-spacing: 1.6px;
  font-size: 13px;
  font-weight: 950;
  position: relative;
  z-index: 1;
}

.idg-ui-card-body {
  padding: 18px;
  position: relative;
  z-index: 1;
}

.idg-ui-note {
  color: var(--idg-muted);
  font-size: 13px;
  line-height: 1.55;
  margin: 0 0 14px;
}

.idg-ui-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--idg-border);
  border-radius: var(--idg-radius-sm);
  background: rgba(255,255,255,.035);
  color: var(--idg-text);
  padding: 0 12px;
  outline: none;
}

.idg-ui-input:focus {
  border-color: rgba(0,234,255,.35);
  box-shadow: 0 0 0 3px rgba(0,234,255,.06);
}

/* Draggable / Droppable */

.idg-draggable {
  touch-action: none;
  user-select: none;
  cursor: grab;
}

.idg-draggable.is-dragging {
  cursor: grabbing;
  z-index: 999;
  opacity: .92;
  box-shadow: 0 22px 50px rgba(0,0,0,.42);
}

.idg-demo-chip {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 11px;
  padding: 0 13px;
  border: 1px solid var(--idg-border);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(0,234,255,.06), transparent 55%),
    rgba(255,255,255,.025);
  color: #eaf7ff;
  font-size: 13px;
  font-weight: 800;
}

.idg-demo-chip small {
  color: var(--idg-muted);
  font-weight: 700;
}

.idg-dropzone {
  min-height: 150px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(0,234,255,.25);
  border-radius: 16px;
  background: rgba(0,234,255,.035);
  color: var(--idg-muted);
  text-align: center;
  padding: 18px;
  transition: .18s ease;
}

.idg-dropzone.is-drop-hover {
  border-color: rgba(57,255,135,.50);
  background: rgba(57,255,135,.06);
  color: #d9ffe7;
  transform: scale(1.01);
}

/* Sortable */

.idg-sortable {
  display: grid;
  gap: 9px;
}

.idg-sortable-item {
  min-height: 46px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--idg-border);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.022), transparent 55%),
    rgba(255,255,255,.018);
  color: #e9eef8;
  cursor: grab;
  user-select: none;
}

.idg-sortable-item::before {
  content: "⋮⋮";
  color: var(--idg-cyan);
  letter-spacing: -2px;
  opacity: .8;
}

.idg-sortable-item.is-sorting {
  opacity: .45;
}

.idg-sortable-placeholder {
  min-height: 46px;
  border: 1px dashed rgba(255,106,0,.48);
  border-radius: 14px;
  background: rgba(255,106,0,.045);
}

/* Resizable */

.idg-resizable {
  position: relative;
  min-width: 180px;
  min-height: 110px;
  border: 1px solid var(--idg-border);
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 100%, rgba(255,106,0,.11), transparent 35%),
    rgba(255,255,255,.025);
  overflow: hidden;
}

.idg-resizable-content {
  padding: 14px;
  color: var(--idg-muted);
  font-size: 13px;
  line-height: 1.45;
}

.idg-resize-handle {
  position: absolute;
  width: 18px;
  height: 18px;
  right: 6px;
  bottom: 6px;
  border-right: 2px solid var(--idg-orange);
  border-bottom: 2px solid var(--idg-orange);
  cursor: nwse-resize;
  opacity: .9;
}

/* Datepicker */

.idg-datepicker-popover {
  position: fixed;
  z-index: 9999;
  width: 310px;
  border: 1px solid var(--idg-border);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.035), transparent 45%),
    rgba(9,13,21,.98);
  box-shadow: var(--idg-shadow);
  padding: 12px;
}

.idg-datepicker-head {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.idg-datepicker-head strong {
  font-size: 13px;
  color: var(--idg-cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.idg-datepicker-nav {
  width: 34px;
  height: 34px;
  border: 1px solid var(--idg-border);
  border-radius: 10px;
  background: rgba(255,255,255,.035);
  color: var(--idg-text);
  cursor: pointer;
}

.idg-datepicker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.idg-datepicker-day,
.idg-datepicker-weekday {
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 12px;
}

.idg-datepicker-weekday {
  color: var(--idg-muted);
  font-weight: 900;
  text-transform: uppercase;
}

.idg-datepicker-day {
  border: 1px solid var(--idg-border-soft);
  background: rgba(255,255,255,.018);
  color: var(--idg-text);
  cursor: pointer;
}

.idg-datepicker-day:hover {
  border-color: rgba(0,234,255,.30);
  background: rgba(0,234,255,.055);
}

.idg-datepicker-day.is-muted {
  opacity: .35;
}

.idg-datepicker-day.is-today {
  color: var(--idg-orange);
  border-color: rgba(255,106,0,.35);
}

.idg-datepicker-day.is-selected {
  color: #061018;
  background: var(--idg-cyan);
  border-color: var(--idg-cyan);
}

/* Progressbar */

.idg-progressbar {
  width: 100%;
  min-height: 18px;
  border: 1px solid var(--idg-border);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  overflow: hidden;
  position: relative;
}

.idg-progressbar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--idg-cyan), var(--idg-orange));
  transition: width .22s ease;
}

.idg-progressbar-label {
  margin-top: 8px;
  color: var(--idg-muted);
  font-size: 12px;
  text-align: right;
}

/* Effects helpers */

.idg-effect-target {
  min-height: 68px;
  display: grid;
  place-items: center;
  border: 1px solid var(--idg-border);
  border-radius: 16px;
  background: rgba(255,255,255,.025);
  color: var(--idg-text);
  font-weight: 900;
}

.idg-effect-highlight {
  animation: idgHighlight .75s ease;
}

.idg-effect-shake {
  animation: idgShake .38s ease;
}

.idg-effect-pulse {
  animation: idgPulse .65s ease;
}

@keyframes idgHighlight {
  0% { box-shadow: 0 0 0 0 rgba(255,216,77,.0); background: rgba(255,216,77,.22); }
  100% { box-shadow: 0 0 0 18px rgba(255,216,77,0); background: rgba(255,255,255,.025); }
}

@keyframes idgShake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

@keyframes idgPulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

/* Position demo menu */

.idg-position-menu {
  min-width: 190px;
  border: 1px solid var(--idg-border);
  border-radius: 14px;
  background: rgba(9,13,21,.98);
  box-shadow: var(--idg-shadow);
  padding: 8px;
  position: fixed;
  z-index: 9998;
}

.idg-position-menu a {
  display: block;
  padding: 10px;
  border-radius: 10px;
  color: var(--idg-text);
  text-decoration: none;
  font-size: 13px;
}

.idg-position-menu a:hover {
  background: rgba(0,234,255,.07);
}

/* Toast */

.idg-ui-toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 99999;
  display: grid;
  gap: 10px;
}

.idg-ui-toast {
  min-width: 260px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--idg-border);
  background:
    linear-gradient(135deg, rgba(255,255,255,.035), transparent 45%),
    rgba(9,13,21,.96);
  color: var(--idg-text);
  box-shadow: var(--idg-shadow);
}

.idg-ui-toast strong {
  display: block;
  margin-bottom: 4px;
}

.idg-ui-toast span {
  display: block;
  color: var(--idg-muted);
  font-size: 13px;
}

@media(max-width: 1050px) {
  .idg-ui-layout,
  .idg-ui-grid {
    grid-template-columns: 1fr;
  }
}

@media(max-width: 680px) {
  .idg-ui-page {
    width: calc(100% - 16px);
    margin: 12px auto;
  }

  .idg-ui-topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }
}
