/* ManyUtils - Custom Styles */

/* Smooth transitions */
* {
  transition-property: color, background-color, border-color, box-shadow, opacity, transform;
  transition-duration: 150ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Remove transition from layout properties to prevent jank */
*::before, *::after {
  transition: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Focus styles */
*:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Ad placeholder styling */
.ad-space {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 0.75rem;
  min-height: 90px;
}

/* Tool card hover */
.tool-grid-card {
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.tool-grid-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.08), 0 4px 10px -6px rgba(0, 0, 0, 0.04);
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Hero gradient background */
.hero-gradient {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
}

/* Notification toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 9999;
  animation: slideUp 300ms ease-out;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.toast-success {
  background: #059669;
}

.toast-error {
  background: #dc2626;
}

.toast-info {
  background: #6366f1;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading spinner */
.spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #e2e8f0;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Drag and drop zone */
.drop-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 200ms, background-color 200ms;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: #6366f1;
  background-color: #eef2ff;
}

/* FAQ accordion */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 300ms ease-out, padding 300ms ease-out;
}

.faq-item.active .faq-answer {
  max-height: 500px;
}

.faq-chevron {
  transition: transform 300ms ease-out;
}

.faq-item.active .faq-chevron {
  transform: rotate(180deg);
}

/* Mobile menu */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 300ms ease-out;
}

.mobile-menu.open {
  max-height: 400px;
}

/* Language dropdown */
.lang-dropdown {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 150ms, visibility 150ms, transform 150ms;
}

.lang-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Color swatch for palette tools */
.color-swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: transform 150ms;
}

.color-swatch:hover {
  transform: scale(1.05);
}

/* Range input styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #6366f1;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #6366f1;
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Native selects and date inputs */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1rem 1rem;
  padding-right: 2.5rem;
}

select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%234f46e5' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

input[type="date"] {
  min-height: 2.75rem;
  background-color: #ffffff;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.8;
}

/* Flatpickr custom header controls (days-between-dates) */
.dbd-flatpickr-custom .flatpickr-current-month {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  padding: 0.35rem 2rem 0.2rem;
  left: 0;
}

.dbd-flatpickr-custom .flatpickr-current-month .cur-month,
.dbd-flatpickr-custom .flatpickr-current-month .numInputWrapper,
.dbd-flatpickr-custom .flatpickr-current-month .flatpickr-monthDropdown-months {
  display: none !important;
}

.dbd-flatpickr-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

.dbd-flatpickr-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  min-height: 1.8rem;
  min-width: 6.5rem;
  padding: 0.3rem 2rem 0.3rem 0.65rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  background-color: #fff;
  color: #334155;
  font-size: 0.8125rem;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 0.55rem center;
  background-repeat: no-repeat;
}

.dbd-flatpickr-select:hover {
  border-color: #cbd5e1;
  background-color: #f8fafc;
}

.dbd-flatpickr-select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.dbd-flatpickr-year-select {
  min-width: 5.5rem;
}

@media (max-width: 640px) {
  .dbd-flatpickr-controls {
    gap: 0.4rem;
  }

  .dbd-flatpickr-select {
    min-width: 5.6rem;
    font-size: 0.75rem;
    padding: 0.25rem 1.75rem 0.25rem 0.55rem;
  }

  .dbd-flatpickr-year-select {
    min-width: 4.9rem;
  }
}

/* Gradient preview */
.gradient-preview {
  width: 100%;
  height: 200px;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
}

/* Image preview */
.image-preview {
  max-width: 100%;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
}

/* Code block */
.code-block {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 0.75rem;
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Textarea styling */
textarea {
  resize: vertical;
}

/* Print styles */
@media print {
  .ad-space, #header, #footer, aside {
    display: none !important;
  }
}
