/* ==========================================================================
   SHIPR // SHORTENER — JAPANESE TWILIGHT & NEON PURPLE SPECIFICATION
   Harmonized with El Fikkanel Portfolio Palette (el.shipr.my.id)
   ========================================================================== */

:root {
  /* Surface & Canvas Tones */
  --sky-night-deep: #090310;
  --sky-night-indigo: #130722;
  --sky-twilight-purple: #250b38;
  --container-bg: rgba(22, 10, 36, 0.88);
  --container-surface: #18092c;
  --container-surface-hover: #220e3d;
  --container-border: rgba(157, 78, 221, 0.35);
  --container-border-focus: #9d4edd;

  /* Neon Accent Tones */
  --neon-purple: #9d4edd;
  --neon-purple-glow: rgba(157, 78, 221, 0.4);
  --neon-purple-light: #c77dff;
  --neon-cyan: #00f5d4;
  --neon-cyan-glow: rgba(0, 245, 212, 0.3);
  --neon-pink: #ff2a6d;
  --shrine-vermilion: #e64536;
  --shrine-vermilion-glow: rgba(230, 69, 54, 0.35);

  /* Metallic Gold */
  --gold-primary: #d4af37;
  --gold-light: #f7e6a2;
  --gold-dark: #8f6e1e;

  /* Typography & High-Contrast Colors */
  --text-primary: #fdfbf7;
  --text-muted: #d1d5db;
  --text-faint: #9ca3af;
  --text-purple: #d8b4fe;

  /* Geometry & Elevation */
  --border-radius-sm: 6px;
  --border-radius-md: 10px;
  --border-radius-lg: 14px;
  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-neon: 0 0 15px rgba(157, 78, 221, 0.25);
  --shadow-neon-hover: 0 0 25px rgba(157, 78, 221, 0.45);

  /* Typography Stack */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Menlo, Consolas, monospace;
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100vh;
  background-color: var(--sky-night-deep);
  background-image: 
    radial-gradient(ellipse at 20% 0%, rgba(157, 78, 221, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(37, 11, 56, 0.4) 0%, transparent 60%),
    linear-gradient(180deg, var(--sky-night-deep) 0%, var(--sky-night-indigo) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--neon-purple-light);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--neon-cyan);
}

/* ==========================================================================
   LAYOUT CONTAINERS
   ========================================================================== */
.app-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 64px 16px;
}

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* ==========================================================================
   HEADER / NAVBAR
   ========================================================================== */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--container-bg);
  border: 1px solid var(--container-border);
  border-radius: var(--border-radius-md);
  margin-bottom: 24px;
  box-shadow: var(--shadow-subtle);
  backdrop-filter: blur(12px);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-icon {
  width: 32px;
  height: 32px;
  color: var(--neon-purple);
  filter: drop-shadow(0 0 8px var(--neon-purple-glow));
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.brand-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  background: rgba(157, 78, 221, 0.2);
  border: 1px solid var(--neon-purple);
  color: var(--neon-purple-light);
  border-radius: var(--border-radius-sm);
  letter-spacing: 0.08em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.user-icon {
  width: 16px;
  height: 16px;
  color: var(--gold-primary);
}

/* ==========================================================================
   BENTO STATS CARDS
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--container-bg);
  border: 1px solid var(--container-border);
  border-radius: var(--border-radius-md);
  padding: 20px;
  box-shadow: var(--shadow-subtle);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--neon-purple);
  box-shadow: var(--shadow-neon);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.stat-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--border-radius-sm);
  background: rgba(157, 78, 221, 0.12);
  border: 1px solid rgba(157, 78, 221, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon {
  width: 22px;
  height: 22px;
  color: var(--neon-purple-light);
}

/* ==========================================================================
   CARDS & SECTIONS
   ========================================================================== */
.card-section {
  background: var(--container-bg);
  border: 1px solid var(--container-border);
  border-radius: var(--border-radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-subtle);
  backdrop-filter: blur(12px);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-faint);
  margin-top: 4px;
}

/* ==========================================================================
   FORMS & INPUTS (WITH FIXED SUBDOMAIN ADDON)
   ========================================================================== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 768px) {
  .form-grid-2col {
    grid-template-columns: 1.3fr 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.form-hint {
  font-size: 0.78rem;
  color: var(--text-faint);
}

.input-control {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  background: var(--container-surface);
  border: 1px solid var(--container-border);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-control:focus {
  border-color: var(--neon-purple);
  box-shadow: 0 0 0 3px rgba(157, 78, 221, 0.25);
}

.input-control::placeholder {
  color: rgba(209, 213, 219, 0.35);
}

/* SUBDOMAIN INPUT WITH FIXED ADDON */
.subdomain-input-group {
  display: flex;
  align-items: stretch;
  height: 46px;
  background: var(--container-surface);
  border: 1px solid var(--container-border);
  border-radius: var(--border-radius-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.subdomain-input-group:focus-within {
  border-color: var(--neon-purple);
  box-shadow: 0 0 0 3px rgba(157, 78, 221, 0.25);
}

.subdomain-input-field {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 14px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.subdomain-input-field::placeholder {
  color: rgba(209, 213, 219, 0.35);
}

.subdomain-addon {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: rgba(37, 11, 56, 0.7);
  border-left: 1px solid var(--container-border);
  color: var(--text-purple);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  user-select: none;
  white-space: nowrap;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  min-width: 44px;
  padding: 0 18px;
  border-radius: var(--border-radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.2s ease;
  text-decoration: none;
  user-select: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-purple) 0%, #7b2cbf 100%);
  color: var(--text-primary);
  box-shadow: 0 4px 15px rgba(157, 78, 221, 0.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #a855f7 0%, var(--neon-purple) 100%);
  box-shadow: 0 6px 20px rgba(157, 78, 221, 0.55);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: rgba(157, 78, 221, 0.15);
  border: 1px solid var(--container-border);
  color: var(--text-muted);
}
.btn-secondary:hover {
  background: rgba(157, 78, 221, 0.25);
  border-color: var(--neon-purple);
  color: var(--text-primary);
}

.btn-danger {
  background: rgba(230, 69, 54, 0.15);
  border: 1px solid rgba(230, 69, 54, 0.3);
  color: #ff6b6b;
}
.btn-danger:hover {
  background: rgba(230, 69, 54, 0.3);
  border-color: var(--shrine-vermilion);
  color: #fff;
  box-shadow: 0 0 15px var(--shrine-vermilion-glow);
}

.btn-icon-only {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--border-radius-sm);
}

.btn-icon {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   TABLE & DATA LIST
   ========================================================================== */
.table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--container-border);
  border-radius: var(--border-radius-sm);
  background: var(--container-surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: rgba(37, 11, 56, 0.5);
  color: var(--text-faint);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 14px 16px;
  border-bottom: 1px solid var(--container-border);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(157, 78, 221, 0.15);
  font-size: 0.9rem;
  color: var(--text-muted);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: var(--container-surface-hover);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.subdomain-badge {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--neon-cyan);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.target-url-cell {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.click-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(0, 245, 212, 0.12);
  border: 1px solid rgba(0, 245, 212, 0.3);
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-faint);
}

.empty-icon {
  width: 48px;
  height: 48px;
  color: rgba(157, 78, 221, 0.3);
  margin-bottom: 12px;
}

/* ==========================================================================
   SEARCH & FILTER BAR
   ========================================================================== */
.table-search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input-wrap {
  flex: 1;
  min-width: 200px;
  position: relative;
}

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

.search-input {
  width: 100%;
  height: 40px;
  padding-left: 38px;
  padding-right: 14px;
  background: var(--container-surface);
  border: 1px solid var(--container-border);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
}

.search-input:focus {
  border-color: var(--neon-purple);
}

/* ==========================================================================
   MODAL DIALOGS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 3, 16, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--container-surface);
  border: 1px solid var(--container-border);
  border-radius: var(--border-radius-md);
  padding: 24px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), var(--shadow-neon);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 260px;
  padding: 12px 18px;
  background: var(--container-surface);
  border: 1px solid var(--neon-purple);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5), var(--shadow-neon);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInToast 0.25s ease-out;
}

.toast.toast-error {
  border-color: var(--shrine-vermilion);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5), 0 0 15px var(--shrine-vermilion-glow);
}

.toast.toast-success {
  border-color: var(--neon-cyan);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5), 0 0 15px var(--neon-cyan-glow);
}

.toast-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

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

/* ==========================================================================
   404 ERROR PAGE
   ========================================================================== */
.error-page-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.error-badge-domain {
  display: inline-block;
  padding: 6px 16px;
  margin-bottom: 24px;
  background: rgba(157, 78, 221, 0.15);
  border: 1px solid var(--neon-purple);
  border-radius: var(--border-radius-sm);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--neon-purple-light);
  box-shadow: 0 0 15px var(--neon-purple-glow);
}

.error-title-huge {
  font-size: 6rem;
  font-weight: 900;
  font-family: var(--font-mono);
  line-height: 1;
  background: linear-gradient(135deg, #fdfbf7 0%, var(--neon-purple-light) 50%, var(--neon-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 30px var(--neon-purple-glow));
}

.error-heading {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.error-desc {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 32px;
  line-height: 1.6;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS
   ========================================================================== */
@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .data-table, .data-table thead, .data-table tbody, .data-table th, .data-table td, .data-table tr {
    display: block;
  }
  .data-table thead {
    display: none;
  }
  .data-table tbody tr {
    border: 1px solid var(--container-border);
    border-radius: var(--border-radius-sm);
    margin-bottom: 14px;
    padding: 12px 14px;
    background: var(--container-surface);
  }
  .data-table td {
    padding: 8px 0;
    border-bottom: 1px solid rgba(157, 78, 221, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .data-table td::before {
    content: attr(data-label);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-faint);
  }
  .target-url-cell {
    max-width: 180px;
  }
}
