/* ==============================================================================
   CdnXyz9 — Light Mode Reusable UI Components
   ============================================================================== */

/* 1. Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  font-family: var(--font-sans);
  font-size: 0.925rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary,
a.btn-primary {
  background: var(--grad-brand);
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.25), 0 2px 6px rgba(124, 58, 237, 0.2);
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover,
  a.btn-primary:hover {
    color: #ffffff !important;
    background: linear-gradient(135deg, #f43f5e 0%, #a855f7 55%, #3b82f6 100%);
    box-shadow: 0 6px 22px rgba(225, 29, 72, 0.35), 0 4px 14px rgba(124, 58, 237, 0.3);
    transform: translateY(-1px);
  }
}
.btn-primary:active,
a.btn-primary:active {
  color: #ffffff !important;
  transform: translateY(0);
}

.btn-secondary,
a.btn-secondary {
  background: #ffffff;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

@media (hover: hover) and (pointer: fine) {
  .btn-secondary:hover,
  a.btn-secondary:hover {
    background: #f8fafc;
    border-color: var(--border-medium);
    color: #0f172a !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
  }
}

.btn-danger,
a.btn-danger {
  background: #fff1f2;
  color: #e11d48 !important;
  border: 1px solid #fecdd3;
}

@media (hover: hover) and (pointer: fine) {
  .btn-danger:hover,
  a.btn-danger:hover {
    background: #ffe4e6;
    border-color: #fda4af;
    color: #be123c !important;
  }
}

.btn-danger-solid,
a.btn-danger-solid {
  background: #e11d48;
  color: #ffffff !important;
}

@media (hover: hover) and (pointer: fine) {
  .btn-danger-solid:hover,
  a.btn-danger-solid:hover {
    background: #be123c;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(225, 29, 72, 0.35);
  }
}

.btn-ghost,
a.btn-ghost {
  background: transparent;
  color: var(--text-secondary) !important;
  border: 1px solid transparent;
}

@media (hover: hover) and (pointer: fine) {
  .btn-ghost:hover,
  a.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary) !important;
  }
}

.btn-icon {
  padding: 0.6rem;
  border-radius: var(--radius-sm);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.825rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.95rem 1.85rem;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

/* Copied Button Feedback State */
.btn-copied {
  background: #ecfdf5 !important;
  color: #059669 !important;
  border-color: #a7f3d0 !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15) !important;
  transform: scale(0.98);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Rotating Spinner Animation */
.spinner {
  animation: spin 0.8s linear infinite !important;
  transform-origin: center;
  display: inline-block;
  vertical-align: middle;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 2. Glass / White Cards */
.card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
  position: relative;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal), transform var(--transition-normal);
  box-sizing: border-box;
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    border-color: var(--border-medium);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
  }
}

.card-glowing {
  border-color: rgba(168, 85, 247, 0.35);
  box-shadow: 0 10px 30px -4px rgba(168, 85, 247, 0.12), 0 2px 8px rgba(0, 0, 0, 0.03);
}

/* 3. Form Inputs & Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  position: relative;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.form-label-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .form-label {
    font-size: 0.825rem;
    gap: 0.15rem;
  }
  .form-label-hint {
    font-size: 0.7rem;
  }
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-control {
  width: 100%;
  padding: 0.8rem 1rem;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.input-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
  background: #ffffff;
}

.input-control.font-mono {
  font-family: var(--font-mono);
}

.input-with-icon {
  padding-left: 2.75rem;
}

.input-icon-left {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 2;
}

.input-icon-right {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: color var(--transition-fast);
  z-index: 2;
}

@media (hover: hover) and (pointer: fine) {
  .input-icon-right:hover {
    color: var(--text-primary);
  }
}

/* 4. Badges & Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

.badge-png { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.badge-jpg, .badge-jpeg { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.badge-webp { background: #ecfeff; color: #0891b2; border: 1px solid #a5f3fc; }
.badge-svg { background: #fdf2f8; color: #db2777; border: 1px solid #fbcfe8; }
.badge-gif { background: #faf5ff; color: #9333ea; border: 1px solid #e9d5ff; }
.badge-avif { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }

/* 4.1 Pulsing Status Indicator Dot */
.pulse-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.pulse-indicator::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.4);
  animation: pulse-ring 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

.pulse-indicator::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
  z-index: 1;
}

@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 0.9; }
  60% { transform: scale(2.4); opacity: 0; }
  100% { transform: scale(2.4); opacity: 0; }
}

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-full);
  text-transform: none;
  font-weight: 600;
}

/* 4.2 Navbar Right Status Cluster */
.nav-right-cluster {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.nav-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  white-space: nowrap;
}

.nav-status-text-short {
  display: none;
}

.nav-doc-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-purple);
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-doc-text-short {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .nav-doc-link:hover {
    background: rgba(124, 58, 237, 0.14);
    border-color: rgba(124, 58, 237, 0.35);
    color: #6d28d9;
  }
}

@media (max-width: 640px) {
  .nav-right-cluster {
    gap: 0.35rem;
  }
  .nav-status-pill {
    padding: 0.25rem 0.55rem;
    font-size: 0.7rem;
  }
  .nav-status-text-full {
    display: none;
  }
  .nav-status-text-short {
    display: inline;
  }
  .nav-doc-link {
    padding: 0.25rem 0.55rem;
    font-size: 0.7rem;
  }
  .nav-doc-text-full {
    display: none;
  }
  .nav-doc-text-short {
    display: inline;
  }
}

@media (max-width: 360px) {
  .nav-status-pill {
    padding: 0.25rem 0.45rem;
  }
}

/* 5. Modern Toast Notification System */
#toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
  max-width: 400px;
  width: calc(100vw - 3rem);
}

.toast {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  position: relative;
  overflow: hidden;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.hide {
  transform: translateX(120%);
  opacity: 0;
}

.toast-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.toast-message {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  display: flex;
  align-items: center;
  transition: color var(--transition-fast);
}

@media (hover: hover) and (pointer: fine) {
  .toast-close:hover {
    color: var(--text-primary);
  }
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: var(--bg-tertiary);
}

.toast-progress-bar {
  height: 100%;
  width: 100%;
  background: var(--grad-brand);
  transform-origin: left;
}

.toast-success .toast-icon { color: var(--accent-emerald); }
.toast-success { border-left: 4px solid var(--accent-emerald); }

.toast-error .toast-icon { color: var(--accent-rose); }
.toast-error { border-left: 4px solid var(--accent-rose); }

.toast-warning .toast-icon { color: var(--accent-amber); }
.toast-warning { border-left: 4px solid var(--accent-amber); }

.toast-info .toast-icon { color: var(--accent-blue); }
.toast-info { border-left: 4px solid var(--accent-blue); }

/* 6. Skeleton Loader */
.skeleton {
  background: linear-gradient(
    90deg,
    #f1f5f9 25%,
    #e2e8f0 50%,
    #f1f5f9 75%
  );
  background-size: 200% 100%;
  animation: skeleton-pulse 1.6s infinite ease-in-out;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 7. Lightbox / Modal System */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.modal-dialog {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  transform: scale(0.96);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.modal-backdrop.active .modal-dialog {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

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

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  background: #f8fafc;
}

/* Lightbox Modal Specific */
.lightbox-dialog {
  max-width: 960px;
  background: #ffffff;
}
.lightbox-preview-wrap {
  width: 100%;
  max-height: 480px;
  background: #f8fafc;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-subtle);
}
.lightbox-preview-img {
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

/* 8. Status Availabilities */
.slug-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.35rem;
}
.slug-status.available {
  color: var(--accent-emerald);
}
.slug-status.taken {
  color: var(--accent-rose);
}
.slug-status.checking {
  color: var(--accent-purple);
}

/* ==============================================================================
   Disable Sticky Hover Effects on Touch / Mobile Devices
   ============================================================================== */
@media (hover: none) and (pointer: coarse) {
  .btn:hover,
  .card:hover,
  .feature-card:hover,
  .image-card:hover,
  .dropzone:hover,
  .tab-btn:hover,
  .nav-doc-link:hover,
  .stat-card:hover {
    transform: none !important;
    box-shadow: inherit !important;
    border-color: inherit !important;
  }
}
