/* ============================================================
   TempMail - Custom Styles
   Dikombinasikan dengan Tailwind CSS
   ============================================================ */

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}
.dark ::-webkit-scrollbar-thumb {
  background: #475569;
}

/* --- Skeleton Loader --- */
.skeleton {
  background: linear-gradient(
    90deg,
    #e2e8f0 25%,
    #f1f5f9 50%,
    #e2e8f0 75%
  );
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}
.dark .skeleton {
  background: linear-gradient(
    90deg,
    #1e293b 25%,
    #334155 50%,
    #1e293b 75%
  );
  background-size: 200% 100%;
}
@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Toast Notification --- */
.toast {
  pointer-events: auto;
  animation: toast-in 0.3s ease-out;
  min-width: 280px;
  max-width: 400px;
}
.toast.removing {
  animation: toast-out 0.3s ease-in forwards;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
  }
}

/* --- Email Item Hover --- */
.email-item {
  transition: background-color 0.15s ease;
}
.email-item:hover {
  background-color: #f8fafc;
}
.dark .email-item:hover {
  background-color: #1e293b;
}
.email-item.active {
  background-color: #eff6ff;
  border-right: 3px solid #2563eb;
}
.dark .email-item.active {
  background-color: rgba(37, 99, 235, 0.1);
  border-right-color: #3b82f6;
}

/* --- Unread dot --- */
.unread-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  border-radius: 50%;
  background-color: #2563eb;
}

/* --- Custom domain select --- */
#customDomain {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}

/* --- Prose overrides for email content --- */
#emailHtmlView img {
  max-width: 100%;
  height: auto;
}
#emailHtmlView a {
  color: #2563eb;
  text-decoration: underline;
}

/* --- Focus ring --- */
input:focus,
select:focus,
button:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* --- Smooth transitions for dark mode --- */
html.dark,
html.dark * {
  transition: background-color 0.2s ease, color 0.15s ease, border-color 0.15s ease;
}

/* --- Copy success animation --- */
.copy-success {
  animation: copy-pop 0.3s ease;
}
@keyframes copy-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* --- Badge (unread count) --- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background-color: #2563eb;
  color: white;
  font-size: 11px;
  font-weight: 600;
}

/* --- Attachment chip --- */
.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  background-color: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 0.8rem;
  color: #475569;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
}
.attachment-chip:hover {
  background-color: #e2e8f0;
  border-color: #cbd5e1;
}
.dark .attachment-chip {
  background-color: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}
.dark .attachment-chip:hover {
  background-color: #334155;
  border-color: #475569;
}
