/* ==========================================================================
   KIOTSO TOOLS — APPLICATION WORKSPACE & COMPONENT EXTENSIONS
   Style: Neo-Brutalism Modernist / Swiss Tech Grid Architecture
   ========================================================================== */

/* Hero Search & Header Enhancements */
.hero-search-box {
  background: var(--paper-card);
  border: var(--border-thick);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 680px;
  margin: 0 auto;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.hero-search-box:focus-within {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-xl);
}

.hero-search-input {
  border: none;
  outline: none;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  width: 100%;
}

.hero-search-input::placeholder {
  color: var(--ink-muted);
}

/* Category Nav Pills */
.category-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.category-pill {
  padding: 8px 18px;
  border: var(--border-main);
  border-radius: var(--radius-pill);
  background: var(--paper-card);
  color: var(--ink);
  font-weight: 800;
  font-size: 13.5px;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.category-pill:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-sm);
}

.category-pill.active {
  background: var(--purple);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.category-pill.active .pill-count {
  background: #ffffff;
  color: var(--purple);
}

.pill-count {
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--paper);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

/* Tool Card Enhancements */
.tool-card {
  background: var(--paper-card);
  border: var(--border-main);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  cursor: pointer;
  position: relative;
}

.tool-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: var(--shadow-lg);
}

.tool-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.tool-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  border: var(--border-main);
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
}

.tool-card-body h3 {
  font-size: 19px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-card-body p {
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1.5px dashed var(--line);
  padding-top: 16px;
  margin-top: auto;
}

.fav-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  transition: transform var(--transition-fast);
  color: var(--ink-muted);
}

.fav-btn:hover {
  transform: scale(1.2);
}

.fav-btn.active {
  color: #ff3b30;
}

/* Modal Workspace */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 15, 29, 0.65);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms ease;
}

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

.modal-container {
  background: var(--paper);
  border: var(--border-thick);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: min(1000px, 95vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.98);
  transition: transform 250ms var(--ease-neo);
}

.modal-overlay.active .modal-container {
  transform: translateY(0) scale(1);
}

.modal-header {
  background: var(--paper-card);
  border-bottom: var(--border-main);
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-title-group h2 {
  font-size: 22px;
}

.modal-close-btn {
  width: 40px;
  height: 40px;
  border: var(--border-main);
  border-radius: var(--radius-pill);
  background: var(--paper);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background: var(--yellow);
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-sm);
}

.modal-body {
  padding: 28px;
  overflow-y: auto;
  flex: 1;
}

/* Tool Interactive Elements */
.tool-grid-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 840px) {
  .tool-grid-layout {
    grid-template-columns: 1fr;
  }
}

.neo-label {
  display: block;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 8px;
}

.neo-textarea,
.neo-input,
.neo-select {
  width: 100%;
  border: var(--border-main);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-family: var(--font-main);
  font-size: 14px;
  color: var(--ink);
  background: var(--paper-card);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.neo-textarea:focus,
.neo-input:focus,
.neo-select:focus {
  outline: none;
  box-shadow: var(--shadow-sm);
  border-color: var(--purple);
}

.neo-textarea-mono,
.neo-input-mono {
  font-family: var(--font-mono);
  font-size: 13.5px;
}

/* Stat Box Component */
.stat-box {
  background: var(--paper-card);
  border: var(--border-main);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-xs);
  text-align: center;
}

.stat-box-num {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 800;
  color: var(--purple);
}

.stat-box-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Progress Bar Component */
.progress-bar-container {
  margin-top: 12px;
}

.progress-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.progress-bar-track {
  height: 10px;
  border: var(--border-thin);
  border-radius: var(--radius-pill);
  background: var(--paper);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--purple);
  border-radius: var(--radius-pill);
  transition: width 200ms ease, background 200ms ease;
}

.progress-bar-fill.warning {
  background: var(--orange);
}

.progress-bar-fill.danger {
  background: #ff3b30;
}

/* Toast Notification System */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast-neo {
  pointer-events: auto;
  background: var(--ink);
  color: #ffffff;
  border: var(--border-main);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 14px;
  animation: toastSlideIn 250ms var(--ease-neo);
}

.toast-neo-icon {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: var(--mint);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
}

@keyframes toastSlideIn {
  from {
    transform: translateY(20px) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Canvas & Image Workspace */
.canvas-preview-box {
  background: var(--paper-card);
  border: var(--border-main);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
}

.canvas-preview-box canvas {
  max-width: 100%;
  height: auto;
  border: var(--border-thin);
  border-radius: var(--radius-sm);
}

/* Quick Action Toolbar */
.action-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* Hero Headline Rotator — CSS Grid Stack Overlay (0px Shift Guarantee) */
.hero-rotator-h1 {
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  gap: 0.18em;
  line-height: 1.25;
  width: 100%;
}

.dynamic-rotator-wrapper {
  display: inline-grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: start;
  line-height: 1;
}

.rotator-item {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 300ms var(--ease-neo), transform 300ms var(--ease-neo);
  pointer-events: none;
  white-space: nowrap;
}

.rotator-item.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (max-width: 640px) {
  .hero-rotator-h1 {
    font-size: 26px;
  }
}

@media (max-width: 640px) {
  .hero-rotator-h1 {
    font-size: 26px;
  }
  .dynamic-rotator-text {
    width: 145px;
  }
}

/* Minimalist Feature Bar Section (Restored & Micro-Animated) */
.feature-bar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  gap: 24px;
}

@media (max-width: 768px) {
  .feature-bar-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.feature-bar-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.feature-bar-item:hover {
  transform: translateY(-2px);
  background: var(--paper);
}

.feature-bar-divider {
  border-left: 1.5px dashed var(--line);
  border-right: 1.5px dashed var(--line);
}

@media (max-width: 768px) {
  .feature-bar-divider {
    border-left: none;
    border-right: none;
    border-top: 1.5px dashed var(--line);
    border-bottom: 1.5px dashed var(--line);
    padding-block: 16px;
  }
}

.feature-bar-icon {
  font-size: 28px;
  transition: transform 250ms var(--ease-neo);
}

.feature-bar-item:hover .feature-bar-icon {
  transform: scale(1.25) rotate(6deg);
}

.feature-bar-title {
  font-size: 15px;
  font-weight: 800;
  display: block;
  color: var(--ink);
}

