/* Minimalist Components Styling (shadcn/ui aesthetic) */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
}
.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--text-main);
  color: var(--bg-app);
  border-color: var(--text-main);
}
.btn-primary:hover {
  opacity: 0.92;
}

.btn-outline {
  border-color: var(--border);
  color: var(--text-main);
  background: var(--bg-card);
}
.btn-outline:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.btn-ghost {
  color: var(--text-muted);
  background: transparent;
}
.btn-ghost:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

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

/* Controls */
.control-group {
  margin-bottom: 14px;
}

.control-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 0.775rem;
}

.control-label {
  font-weight: 500;
  color: var(--text-muted);
}

.control-value {
  font-size: 0.72rem;
  color: var(--text-main);
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-input);
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}

/* Custom Styled Range Slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-main);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: transform var(--transition-fast);
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Custom Color Input */
.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  background: none;
}
input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.color-hex-text {
  font-size: 0.775rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-main);
}

/* Toggle Switch */
.switch-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider-toggle {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  transition: .2s;
  border-radius: 20px;
}
.slider-toggle::before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-dim);
  transition: .2s;
  border-radius: 50%;
}
input:checked + .slider-toggle {
  background: var(--text-main);
  border-color: var(--text-main);
}
input:checked + .slider-toggle::before {
  transform: translateX(16px);
  background-color: var(--bg-app);
}

/* Segmented Controls (Inspiration: Astra & Tavola & SaaS Dashboards) */
.segmented-pill-bar {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  position: relative;
  user-select: none;
}

.segmented-pill-btn {
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 999px;
  transition: all 0.15s ease;
  position: relative;
  z-index: 2;
  white-space: nowrap;
}

.segmented-pill-btn:hover {
  color: var(--text-main);
}

.segmented-pill-btn.active {
  color: var(--bg-app);
  background: var(--text-main);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Notched floating label input */
.notched-input-box {
  position: relative;
  width: 100%;
}

.notched-input-field {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.notched-input-field:focus {
  border-color: var(--text-main);
  box-shadow: 0 0 0 2px var(--accent-subtle);
}

.notched-input-label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  color: var(--text-dim);
  font-size: 0.85rem;
  pointer-events: none;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0 4px;
}

.notched-input-field:focus ~ .notched-input-label,
.notched-input-field:not(:placeholder-shown) ~ .notched-input-label {
  top: 0;
  font-size: 0.7rem;
  color: var(--text-main);
  background: var(--bg-card);
  font-weight: 500;
}

/* Split Action Button */
.split-button-container {
  display: inline-flex;
  position: relative;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
}

.split-button-main {
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-main);
  background: transparent;
  border: none;
  cursor: pointer;
  border-right: 1px solid var(--border);
  transition: background var(--transition-fast);
}

.split-button-main:hover {
  background: var(--bg-hover);
}

.split-button-arrow {
  padding: 6px 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.split-button-arrow:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.split-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  z-index: 100;
  overflow: hidden;
  animation: dropIn 0.12s ease-out;
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.split-dropdown-item {
  padding: 8px 12px;
  font-size: 0.775rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.split-dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

/* Toast */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 0.8rem;
  font-weight: 500;
  animation: toastIn 0.18s ease-out forwards;
}
@keyframes toastIn {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.toast.hide {
  animation: toastOut 0.15s ease-in forwards;
}
@keyframes toastOut {
  to { transform: translateY(10px); opacity: 0; }
}

/* =========================================================
   HeroUI & shadcn/ui Blocks Design System Additions
   ========================================================= */

/* HeroUI Button Variants */
.btn-solid {
  background: var(--text-main);
  color: var(--bg-app);
  border: 1px solid var(--text-main);
}
.btn-solid:hover {
  opacity: 0.92;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.12);
}

.btn-flat {
  background: var(--bg-hover);
  color: var(--text-main);
  border: 1px solid transparent;
}
.btn-flat:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-faded {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border);
}
.btn-faded:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}

.btn-bordered {
  background: transparent;
  color: var(--text-main);
  border: 1.5px solid var(--border-strong);
}
.btn-bordered:hover {
  border-color: var(--text-main);
}

.btn-light {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}
.btn-light:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

.btn-shadow {
  background: var(--text-main);
  color: var(--bg-app);
  border: 1px solid var(--text-main);
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.2);
}

.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

/* Kbd Badges (shadcn/ui & HeroUI standard) */
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  box-shadow: inset 0 -1px 0 var(--border);
  line-height: 1;
}

/* HeroUI Animated Tabs */
.heroui-tab-track {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-input);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  position: relative;
}

.heroui-tab-button {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 2;
}

.heroui-tab-button:hover {
  color: var(--text-main);
}

.heroui-tab-button.active {
  color: var(--text-main);
  font-weight: 600;
  background: var(--bg-card);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.heroui-tab-count {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
}

/* Underline tab variation */
.heroui-tab-underline-track {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.heroui-tab-underline-btn {
  padding: 8px 4px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.heroui-tab-underline-btn:hover {
  color: var(--text-main);
}

.heroui-tab-underline-btn.active {
  color: var(--text-main);
  font-weight: 600;
  border-bottom-color: var(--text-main);
}

/* HeroUI / shadcn Interactive Modal */
.heroui-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 600;
  padding: 20px;
  animation: fadeIn 0.16s ease;
}

.heroui-modal-card {
  width: 100%;
  max-width: 520px;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.heroui-modal-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.heroui-modal-body {
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.heroui-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Accordion Component */
.heroui-accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
}

.heroui-accordion-item + .heroui-accordion-item {
  border-top: 1px solid var(--border);
}

.heroui-accordion-trigger {
  width: 100%;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast);
}

.heroui-accordion-trigger:hover {
  background: var(--bg-hover);
}

.heroui-accordion-chevron {
  display: flex;
  align-items: center;
  color: var(--text-dim);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.heroui-accordion-item.open .heroui-accordion-chevron {
  transform: rotate(180deg);
}

.heroui-accordion-content {
  padding: 0 18px 14px;
  color: var(--text-muted);
  font-size: 0.825rem;
  line-height: 1.55;
  display: none;
}

.heroui-accordion-item.open .heroui-accordion-content {
  display: block;
}
