/* ============================================================
   UltraTool360 — Universal Tool Page Styles
   Used across all tool pages (PDF, Image, etc.)
   ============================================================ */

/* ---- Tool Page Layout ---- */
.tool-page {
  padding-top: var(--space-8);
}

/* ---- Breadcrumb ---- */
.tool-breadcrumb {
  margin-bottom: var(--space-6);
}

/* ---- Tool Header ---- */
.tool-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto var(--space-10);
}

.tool-header__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto var(--space-5);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-2xl);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.tool-header__icon svg {
  width: 36px;
  height: 36px;
}

.tool-header__title {
  font-size: var(--text-4xl);
  font-weight: var(--weight-extrabold);
  margin-bottom: var(--space-3);
}

.tool-header__description {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 560px;
  margin: 0 auto;
}

/* ---- Tool Workspace ---- */
.tool-workspace {
  max-width: 900px;
  margin: 0 auto var(--space-12);
  padding: var(--space-8);
  border-radius: var(--radius-2xl);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-md);
}

@media (max-width: 767px) {
  .tool-workspace {
    padding: var(--space-5);
    border-radius: var(--radius-xl);
  }
}

/* ---- File List (after upload) ---- */
.file-list {
  margin-top: var(--space-6);
}

.file-list__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.file-list__count {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
}

.file-list__clear {
  font-size: var(--text-sm);
  color: var(--color-accent);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: opacity var(--duration-fast) var(--ease-default);
}

.file-list__clear:hover {
  opacity: 0.8;
}

.file-list__items {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.file-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  transition: all var(--duration-fast) var(--ease-default);
  cursor: grab;
}

.file-item:hover {
  border-color: var(--color-border);
  box-shadow: var(--shadow-xs);
}

.file-item.is-dragging {
  opacity: 0.5;
  box-shadow: var(--shadow-lg);
}

.file-item__drag {
  display: flex;
  color: var(--color-text-tertiary);
  cursor: grab;
  flex-shrink: 0;
}

.file-item__drag svg {
  width: 16px;
  height: 16px;
}

.file-item__icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.file-item__icon svg {
  width: 20px;
  height: 20px;
}

.file-item__info {
  flex: 1;
  min-width: 0;
}

.file-item__name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item__size {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}

.file-item__remove {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  color: var(--color-text-tertiary);
  flex-shrink: 0;
  transition: all var(--duration-fast) var(--ease-default);
}

.file-item__remove:hover {
  background: var(--color-error);
  color: var(--neutral-0);
}

.file-item__remove svg {
  width: 16px;
  height: 16px;
}

/* Add more files button */
.file-list__add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3);
  margin-top: var(--space-3);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-xl);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}

.file-list__add:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-light);
}


/* ---- Tool Settings ---- */
.tool-settings {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border-light);
}

.tool-settings__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.tool-settings__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

@media (min-width: 640px) {
  .tool-settings__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ---- Process Button ---- */
.tool-process {
  margin-top: var(--space-8);
  text-align: center;
}

.tool-process__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-width: 240px;
  padding: var(--space-4) var(--space-10);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--neutral-0);
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-default);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.tool-process__btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl), 0 0 30px hsla(194, 89%, 27%, 0.25);
}

.tool-process__btn:active {
  transform: translateY(0);
}

.tool-process__btn:disabled,
.tool-process__btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--shadow-sm);
}

.tool-process__btn.is-processing {
  pointer-events: none;
}

.tool-process__btn-icon svg {
  width: 22px;
  height: 22px;
}

/* Shine animation on hover */
.tool-process__btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, hsla(0,0%,100%,0.15), transparent);
  transition: left var(--duration-slow) var(--ease-default);
}

.tool-process__btn:hover::after {
  left: 100%;
}


/* ---- Progress Bar ---- */
.tool-progress {
  margin-top: var(--space-6);
  display: none;
}

.tool-progress.is-active {
  display: block;
}

.tool-progress__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.tool-progress__label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
}

.tool-progress__percent {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  font-family: var(--font-mono);
}

.tool-progress__bar {
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  overflow: hidden;
}

.tool-progress__fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  width: 0%;
  transition: width var(--duration-normal) var(--ease-default);
  position: relative;
}

.tool-progress__fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, hsla(0,0%,100%,0.3), transparent);
  animation: shimmer 1.5s ease-in-out infinite;
}

.tool-progress__status {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  text-align: center;
}


/* ---- Download Area ---- */
.tool-download {
  margin-top: var(--space-8);
  text-align: center;
  display: none;
}

.tool-download.is-active {
  display: block;
  animation: fadeInUp 0.5s var(--ease-spring) both;
}

.tool-download__card {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-8);
  border-radius: var(--radius-2xl);
  background: var(--color-primary-light);
  border: 1px solid var(--color-primary);
}

.tool-download__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-5);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--neutral-0);
  animation: scaleIn 0.4s var(--ease-bounce) both;
}

.tool-download__icon svg {
  width: 32px;
  height: 32px;
}

.tool-download__title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-2);
  color: var(--color-text);
}

.tool-download__size {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-6);
}

.tool-download__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-8);
  background: var(--color-primary);
  color: var(--neutral-0);
  border-radius: var(--radius-full);
  font-weight: var(--weight-bold);
  font-size: var(--text-base);
  border: none;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-default);
  box-shadow: var(--shadow-md);
}

.tool-download__btn:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.tool-download__btn svg {
  width: 20px;
  height: 20px;
}

.tool-download__actions {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-5);
}

.tool-download__action-link {
  font-size: var(--text-sm);
  color: var(--color-primary);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: opacity var(--duration-fast) var(--ease-default);
}

.tool-download__action-link:hover {
  opacity: 0.8;
}


/* ---- Related Tools ---- */
.related-tools {
  margin-top: var(--space-16);
}


/* ---- How to Use ---- */
.how-to {
  max-width: 700px;
  margin: 0 auto;
}

.how-to__steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  position: relative;
}

.how-to__steps::before {
  content: '';
  position: absolute;
  left: 23px;
  top: 48px;
  bottom: 48px;
  width: 2px;
  background: var(--color-border);
}

.how-to__step {
  display: flex;
  gap: var(--space-5);
  align-items: flex-start;
}

.how-to__step-number {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--neutral-0);
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  font-size: var(--text-lg);
  position: relative;
  z-index: 1;
}

.how-to__step-content {
  padding-top: var(--space-2);
}

.how-to__step-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
  color: var(--color-text);
}

.how-to__step-description {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}


/* ---- Tool Benefits ---- */
.tool-benefits-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

@media (min-width: 768px) {
  .tool-benefits-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .tool-benefits-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.tool-benefit {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.tool-benefit__icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xl);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.tool-benefit__icon svg {
  width: 22px;
  height: 22px;
}

.tool-benefit__title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-1);
  color: var(--color-text);
}

.tool-benefit__text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}


/* ---- Page thumbnail preview (for PDF tools) ---- */
.page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-6);
}

@media (min-width: 768px) {
  .page-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

.page-thumbnail {
  position: relative;
  aspect-ratio: 0.707;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--color-border);
  background: var(--neutral-0);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}

.page-thumbnail:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.page-thumbnail.is-selected {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow);
}

.page-thumbnail__canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.page-thumbnail__number {
  position: absolute;
  bottom: var(--space-2);
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-1) var(--space-3);
  background: var(--glass-bg-heavy);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-text);
}

.page-thumbnail__check {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--neutral-0);
  display: none;
  align-items: center;
  justify-content: center;
}

.page-thumbnail.is-selected .page-thumbnail__check {
  display: flex;
}

.page-thumbnail__check svg {
  width: 14px;
  height: 14px;
}

/* Page rotate/delete overlay buttons */
.page-thumbnail__actions {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  display: flex;
  gap: var(--space-1);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-default);
}

.page-thumbnail:hover .page-thumbnail__actions {
  opacity: 1;
}

.page-thumbnail__action-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--glass-bg-heavy);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--color-text);
  border: none;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-default);
}

.page-thumbnail__action-btn:hover {
  background: var(--color-primary);
  color: var(--neutral-0);
}

.page-thumbnail__action-btn svg {
  width: 14px;
  height: 14px;
}
