/* Hide Alpine elements before init to prevent flash */
[x-cloak] {
  display: none !important;
}

/* Base background on html to prevent white flash during overscroll */
html {
  background: #fff1f2;
}
.dark html,
html.dark {
  background: #0d0d0d;
}

/* Ambient glow orbs — visible only in dark mode */
.glow-orb {
  display: none;
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(120px);
  z-index: -1;
}
.dark .glow-orb {
  display: block;
}
.glow-orb-1 {
  width: 600px;
  height: 600px;
  top: -150px;
  right: -150px;
  background: radial-gradient(
    circle,
    rgba(255, 107, 157, 0.12) 0%,
    transparent 70%
  );
}
.glow-orb-2 {
  width: 500px;
  height: 500px;
  bottom: 5%;
  left: -120px;
  background: radial-gradient(
    circle,
    rgba(168, 85, 247, 0.08) 0%,
    transparent 70%
  );
}

/* Glass header */
.glass-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
}
.dark .glass-header {
  background: rgba(10, 10, 10, 0.92);
}

/* Card */
.card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 16px rgba(0, 0, 0, 0.03);
  border: 1px solid #e5e7eb;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}
.card:hover {
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.05),
    0 8px 24px rgba(0, 0, 0, 0.04);
}
.dark .card {
  background: #171717;
  border: 1px solid #2e2e2e;
}

/* Card header */
.card-header {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.dark .card-header {
  border-bottom: 1px solid #2e2e2e;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:disabled {
  cursor: not-allowed;
}
.btn-primary {
  background: linear-gradient(135deg, #ff6b9d, #f43f7a);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 107, 157, 0.3);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #f43f7a, #e11d5e);
  box-shadow: 0 4px 12px rgba(255, 107, 157, 0.4);
  transform: translateY(-0.5px);
}
.btn-secondary {
  background: rgba(0, 0, 0, 0.03);
  color: inherit;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
}
.btn-secondary:hover:not(:disabled) {
  border-color: #f43f5e;
  color: #f43f5e;
}
.dark .btn-secondary {
  background: #212121;
  border-color: #2e2e2e;
}
.dark .btn-secondary:hover:not(:disabled) {
  border-color: #ff6b9d;
  color: #ff6b9d;
}
.btn-danger {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
}
.btn-danger:hover:not(:disabled) {
  background: #ef4444;
  color: #fff;
}

/* Icon button */
.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  color: rgba(0, 0, 0, 0.35);
}
.btn-icon:hover {
  background: rgba(255, 107, 157, 0.08);
  color: #ff6b9d;
}
.dark .btn-icon {
  color: rgba(255, 255, 255, 0.35);
}
.dark .btn-icon:hover {
  background: rgba(255, 107, 157, 0.12);
  color: #ff6b9d;
}

/* Tags */
.tag {
  font-size: 10px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 5px;
  line-height: 1.6;
}
.tag-solar {
  background: rgba(255, 107, 157, 0.1);
  color: #e11d5e;
}
.tag-lunar {
  background: rgba(168, 85, 247, 0.1);
  color: #7c3aed;
}
.tag-group {
  background: rgba(194, 65, 12, 0.08);
  color: #c2410c;
}
.tag-leap {
  background: rgba(16, 185, 129, 0.08);
  color: #059669;
}
.dark .tag-solar {
  background: rgba(255, 107, 157, 0.2);
  color: #ff6b9d;
}
.dark .tag-lunar {
  background: rgba(168, 85, 247, 0.2);
  color: #a855f7;
}
.dark .tag-group {
  background: rgba(251, 146, 60, 0.15);
  color: #fb923c;
}
.dark .tag-leap {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}

/* Form elements */
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.dark .form-label {
  color: rgba(255, 255, 255, 0.5);
}

.form-input {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 8px 12px;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.02);
  color: inherit;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.form-input:focus {
  border-color: #f43f5e;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.1);
}
.form-input::placeholder {
  color: rgba(0, 0, 0, 0.25);
}
.dark .form-input {
  border-color: #2e2e2e;
  background: #212121;
}
.dark .form-input:focus {
  border-color: #ff6b9d;
  box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.15);
}
.dark .form-input::placeholder {
  color: #555;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #ffe4ec;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: #ffb0c8;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #ff6b9d;
}
.dark ::-webkit-scrollbar-track {
  background: #171717;
}
.dark ::-webkit-scrollbar-thumb {
  background: #ff6b9d;
}
.dark ::-webkit-scrollbar-thumb:hover {
  background: #ff8fb8;
}

/* Cropper.js circular mask */
.cropper-view-box,
.cropper-face {
  border-radius: 50%;
}
.cropper-view-box {
  outline: 2px solid #ff6b9d;
  outline-offset: -2px;
}

/* Selection */
::selection {
  background: rgba(244, 63, 94, 0.2);
}

/* Mobile action buttons always visible */
@media (max-width: 640px) {
  .group .opacity-0 {
    opacity: 1 !important;
  }
}
