/* ===================================
   Image Converter - Custom Styles
   =================================== */

/* --- CSS Variables --- */
:root {
  --blue: #14274e;
  --blue-hover: #1a3469;
  --blue-rgb: 20, 39, 78;
  --white-rgb: 255, 255, 255;
  --black-rgb: 0, 0, 0;
  --numbers-bg: #f5f7fa;
  --success-color: #10b981;
  --error-color: #ef4444;
  --border-color: rgba(0, 0, 0, 0.1);
}

/* --- Base Styles --- */
* {
  box-sizing: border-box;
}

/* Base font properties are inherited from the body */
body {
  font-family: 'Gilroy', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #fafbfc;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1280px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

@media screen and (max-width: 1199.98px) {
  .container {
    padding-left: 5%;
    padding-right: 5%;
  }  
}

/* --- Main Content --- */
.converter-main {
  flex: 1;
  padding-top: 120px;
  padding-bottom: 80px;
}

/* --- Hero Section --- */
.converter-hero {
  text-align: center;
  margin-bottom: 48px;
}

.converter-hero__content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-content: space-between;
}

@media screen and (max-width: 991.98px) {
  .converter-hero__content {
    flex-direction: column;
    gap: 12px;
  }
}

.converter-hero__title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 16px;
}

.converter-hero__subtitle {
  font-size: 1.125rem;
  color: #6b7280;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}


.converter-section {
  margin-bottom: 48px;
}

.converter-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--elements-webflow-library--general--shadow-01);
  padding: 48px;
  position: relative;
  overflow: hidden;
}

@media (max-width: 768px) {
  .converter-card {
    padding: 24px;
  }
}

/* --- Upload Zone --- */
.upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 64px 32px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  user-select: none;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--blue);
  background-color: rgba(var(--blue-rgb), 0.02);
}

.upload-zone.drag-over {
  transform: scale(1.01);
}

.upload-zone__icon {
  color: #9ca3af;
  margin-bottom: 16px;
  pointer-events: none;
}

.upload-zone__text {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--blue);
  margin-bottom: 8px;
  pointer-events: none;
}

.upload-zone__subtext {
  color: #9ca3af;
  margin-bottom: 16px;
  pointer-events: none;
}

.upload-zone__button {
  pointer-events: none;
}

.upload-zone__formats {
  margin-top: 16px;
  font-size: 0.875rem;
  color: #9ca3af;
  pointer-events: none;
}

/* --- Converter Settings --- */
.converter-settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

@media (max-width: 991px) {
  .converter-settings {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* --- Preview Section --- */
.preview-section {
  display: flex;
  flex-direction: column;
}

.preview-card {
  background: var(--numbers-bg);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.preview-image {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  object-fit: contain;
}

.preview-info {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preview-filename {
  font-weight: 500;
  color: var(--blue);
  word-break: break-all;
}

.preview-size {
  font-size: 0.875rem;
  color: #6b7280;
}

/* --- Settings Section --- */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--blue);
  margin: 0;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-label {
  font-weight: 500;
  color: var(--blue);
  font-size: 0.875rem;
}

.setting-hint {
  font-size: 0.75rem;
  color: #9ca3af;
  margin: 0;
}

/* --- Format Buttons --- */
.format-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.format-btn {
  padding: 10px 20px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.format-btn:hover {
  border-color: var(--blue);
}

.format-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* --- Quality Slider --- */
.quality-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--numbers-bg);
  outline: none;
  -webkit-appearance: none;
}

.quality-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blue);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.quality-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.quality-hints {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #9ca3af;
}

/* --- Size Inputs --- */
.size-inputs {
  display: flex;
  align-items: center;
  gap: 12px;
}

.size-input-wrap {
  display: flex;
  align-items: center;
  flex: 1;
  background: var(--numbers-bg);
  border-radius: 8px;
  padding-right: 12px;
}

.size-input {
  flex: 1;
  padding: 12px;
  border: none;
  background: transparent;
  font-size: 1rem;
  color: var(--blue);
  outline: none;
}

.size-input::placeholder {
  color: #9ca3af;
}

.size-unit {
  font-size: 0.875rem;
  color: #9ca3af;
}

.size-separator {
  color: #9ca3af;
  font-weight: 300;
}

/* --- Fit Select --- */
.fit-select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #fff;
  font-size: 1rem;
  color: var(--blue);
  cursor: pointer;
  outline: none;
}

.fit-select:focus {
  border-color: var(--blue);
}

/* --- Action Buttons --- */
.action-buttons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.action-buttons .button {
  flex: 1;
}

/* --- Result Section --- */
.result-section {
  text-align: center;
}

.result-icon {
  color: var(--success-color);
  margin-bottom: 16px;
}

.result-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 24px;
}

.result-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.result-stat {
  text-align: center;
}

.result-stat-label {
  display: block;
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 4px;
}

.result-stat-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--blue);
}

.result-stat--highlight .result-stat-value {
  color: var(--success-color);
}

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 25px 0;
}

/* --- Loading Overlay --- */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--numbers-bg);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-text {
  margin-top: 16px;
  color: var(--blue);
  font-weight: 500;
}

/* --- Error Section --- */
.error-section {
  text-align: center;
}

.error-card {
  padding: 48px;
}

.error-icon {
  color: var(--error-color);
  margin-bottom: 16px;
}

.error-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 8px;
}

.error-message {
  color: #6b7280;
  margin-bottom: 24px;
}

/* --- Limits Section --- */
.limits-section {
  margin-bottom: 64px;
}

.limits-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--numbers-bg);
  border-radius: 12px;
  padding: 20px 24px;
}

.limits-icon {
  color: var(--blue);
  flex-shrink: 0;
}

.limits-text {
  margin: 0;
  color: #6b7280;
  font-size: 0.875rem;
}

.limits-text strong {
  color: var(--blue);
}

/* --- Formats Section --- */
.formats-section {
  text-align: center;
}

.formats-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 32px;
}

.formats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 768px) {
  .formats-grid {
    grid-template-columns: 1fr;
  }
}

.format-card {
  background: #fff;
  border-radius: 12px;
  padding: 32px 24px;
  border: 1px solid var(--elements-webflow-library--general--shadow-01);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.format-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.format-card__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.format-card__icon img {
  max-width: 100%;
  max-height: 100%;
}

.format-card__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 8px;
}

.format-card__text {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.6;
  margin: 0;
}

/* --- Footer --- */
.converter-footer {
  background: var(--blue);
  padding: 24px 0;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-text {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
}

.footer-link {
  color: #fff;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.footer-link:hover {
  opacity: 0.8;
}

/* --- Files List (Batch) --- */
.files-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

/* --- Tab Switcher --- */
.tab-switcher {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
}
.tab-btn {
  padding: 10px 24px;
  border-radius: 8px 8px 0 0;
  background: #f3f4f6;
  font-size: 1rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  border-bottom: none;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
  position: relative;
  top: 1px;
}
.tab-btn:hover {
  background: #e5e7eb;
}
.tab-btn--active {
  background: #fff;
  color: var(--blue);
  border: 1px solid var(--elements-webflow-library--general--shadow-01);
  font-weight: 600;
  z-index: 1;
}
.utility-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding-top: 20px;
  margin-top: 24px;
  border-top: 1px solid var(--border-color);
}
.utility-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: #fff;
  cursor: pointer;
  font-weight: 500;
  color: var(--blue);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
  box-shadow: 0 2px 6px rgba(20,39,78,0.05);
}
.utility-btn:hover {
  background: #f7f8fb;
  box-shadow: 0 4px 10px rgba(20,39,78,0.08);
}
.utility-btn:active {
  transform: translateY(1px);
}
.utility-btn__icon {
  width: 18px;
  height: 18px;
}

@media (max-width: 768px) {
  .tab-switcher {
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 24px;
    gap: 8px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .tab-switcher::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    scroll-snap-align: start;
  }
}
/* --- Main Button --- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
  background: var(--blue);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(20,39,78,0.04);
}
.button:hover {
  background: var(--blue-hover);
}
.button:active {
  background: #0f1c36;
}
.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.button--outline {
  background: #fff;
  color: var(--blue);
  border: 1px solid var(--blue);
  box-shadow: none;
}
.button--outline:hover {
  background: #f3f4f6;
}
.files-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--blue);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.files-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: var(--blue);
  color: #fff;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.add-more-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-more-btn:hover {
  border-color: var(--blue);
  background: rgba(var(--blue-rgb), 0.02);
}

.files-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Вертикальное расположение радиокнопок */
.setting-group .radio-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Стили для textarea и полей ввода вывода */
textarea,
input[type="text"],
input[type="number"] {
  font-weight: 500;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 8px;
}

.files-list::-webkit-scrollbar {
  width: 6px;
}

.files-list::-webkit-scrollbar-track {
  background: var(--numbers-bg);
  border-radius: 3px;
}

.files-list::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.files-list::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--numbers-bg);
  border-radius: 8px;
  transition: background 0.2s ease;
}

.file-item:hover {
  background: #eef1f5;
}

.file-item__preview {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: #fff;
}

.file-item__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-item__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-item__name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--blue);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item__size {
  font-size: 0.75rem;
  color: #6b7280;
}

.file-item__remove {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.file-item__remove:hover {
  background: #fee2e2;
  color: var(--error-color);
}

.files-summary {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  font-size: 0.875rem;
  color: #6b7280;
}

.files-summary strong {
  color: var(--blue);
}

/* --- Batch Results --- */
.batch-results {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  max-height: 300px;
  overflow-y: auto;
}

.batch-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--numbers-bg);
  border-radius: 8px;
  margin-bottom: 8px;
}

.batch-result-item:last-child {
  margin-bottom: 0;
}

.batch-result-item__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.batch-result-item__name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--blue);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batch-result-item__sizes {
  font-size: 0.75rem;
  color: #6b7280;
}

.batch-result-item__savings {
  color: var(--success-color);
  font-weight: 500;
}

.batch-result-item__download {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.batch-result-item__download:hover {
  background: var(--blue-hover);
  transform: translateY(-2px);
}

.batch-failed-note {
  margin-top: 16px;
  padding: 12px;
  background: #fef2f2;
  border-radius: 8px;
  color: var(--error-color);
  font-size: 0.875rem;
  text-align: center;
}

/* --- Responsive --- */
@media (max-width: 576px) {
  .converter-main {
    padding-top: 100px;
  }
  
  .upload-zone {
    padding: 48px 24px;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .result-actions {
    flex-direction: column;
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  
  .files-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .file-item__preview {
    width: 40px;
    height: 40px;
  }
  
  .batch-result-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .batch-result-item__download {
    width: 100%;
    justify-content: center;
  }
}

/* --- Text Transform Page --- */
.text-transform-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.text-transform-area {
  width: 100%;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  font-size: 1rem;
  resize: vertical;
}

.radio-group-vertical {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.text-result-section,
.text-error-section {
  margin-top: 32px;
}



.text-result-actions {

  margin-top: 16px;

  display: flex;

  gap: 12px;

}



.text-transform-grid {

  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 24px;

}



.text-transform-col {

  display: flex;

  flex-direction: column;

  gap: 8px;

}



.text-transform-col .text-result-actions {

  margin-top: auto; /* Pushes buttons to the bottom */

  padding-top: 16px;

}



@media (max-width: 991px) {

  .text-transform-grid {

    grid-template-columns: 1fr;

  }

}

/* Локальные шрифты Gilroy */
@font-face {
  font-family: 'Gilroy';
  src: url('/fonts/Gilroy-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Gilroy';
  src: url('/fonts/Gilroy-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Gilroy';
  src: url('/fonts/Gilroy-Semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Gilroy';
  src: url('/fonts/Gilroy-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

.hidden {
  display: none;
}

.error-page-main {
  text-align: center;
  margin-top: 10vh;
}

.link-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
  justify-content: center;
}

.link-button a {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.link-button a:hover {
  border-color: var(--blue);
  background: rgba(var(--blue-rgb), 0.02);
}
