/* ========================================
   IMAGE CROPPER
   TOOL CSS
======================================== */

/* ========================================
   TOOL HERO
======================================== */

.tool-hero {
  padding: 70px 0 60px;

  background: var(--background-secondary);

  border-bottom: 1px solid var(--border-color);
}

.breadcrumb {
  display: flex;

  align-items: center;

  gap: 8px;

  margin-bottom: 40px;

  font-size: 13px;

  color: var(--text-secondary);
}

.breadcrumb a {
  color: var(--primary-color);

  font-weight: 500;

  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb i {
  font-size: 18px;
}

.tool-header {
  max-width: 700px;

  margin: 0 auto;

  text-align: center;
}

.tool-page-icon {
  width: 70px;

  height: 70px;

  margin: 0 auto 20px;

  display: flex;

  align-items: center;

  justify-content: center;

  border-radius: 18px;

  background: var(--primary-light);

  color: var(--primary-color);

  font-size: 36px;
}

.tool-header h1 {
  margin-bottom: 16px;

  font-size: clamp(32px, 5vw, 52px);

  line-height: 1.2;

  letter-spacing: -2px;
}

.tool-header p {
  max-width: 600px;

  margin: 0 auto;

  color: var(--text-secondary);

  font-size: 15px;

  line-height: 1.7;
}

/* ========================================
   CROPPER SECTION
======================================== */

.cropper-section {
  padding: 80px 0;

  background: var(--background-color);
}

.cropper-wrapper {
  max-width: 1000px;

  margin: 0 auto;
}

/* ========================================
   UPLOAD AREA
======================================== */

.upload-area {
  padding: 70px 30px;

  text-align: center;

  border: 2px dashed var(--border-color);

  border-radius: 20px;

  background: var(--background-secondary);

  transition: var(--transition);
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--primary-color);

  background: var(--primary-light);
}

.upload-icon {
  width: 70px;

  height: 70px;

  margin: 0 auto 20px;

  display: flex;

  align-items: center;

  justify-content: center;

  border-radius: 50%;

  background: var(--primary-light);

  color: var(--primary-color);

  font-size: 36px;
}

.upload-area h2 {
  margin-bottom: 8px;

  font-size: 22px;
}

.upload-area p {
  margin-bottom: 24px;

  color: var(--text-secondary);

  font-size: 14px;
}

.upload-button {
  display: inline-flex;

  align-items: center;

  gap: 8px;

  padding: 13px 22px;

  border-radius: 8px;

  background: var(--primary-color);

  color: #ffffff;

  font-size: 14px;

  font-weight: 600;

  cursor: pointer;

  transition: var(--transition);
}

.upload-button:hover {
  background: var(--primary-hover);

  transform: translateY(-2px);
}

.upload-info {
  display: block;

  margin-top: 16px;

  font-size: 12px;

  color: var(--text-secondary);
}

/* ========================================
   CROPPER EDITOR
======================================== */

.cropper-editor {
  width: 100%;
}

.cropper-card {
  overflow: hidden;

  border: 1px solid var(--border-color);

  border-radius: 16px;

  background: var(--card-background);
}

/* ========================================
   CROPPER CARD HEADER
======================================== */

.cropper-card-header {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 20px;

  padding: 18px 20px;

  border-bottom: 1px solid var(--border-color);
}

.cropper-card-header h3 {
  margin-bottom: 5px;

  font-size: 16px;
}

.cropper-card-header span {
  font-size: 12px;

  color: var(--text-secondary);
}

.original-size {
  display: flex;

  flex-direction: column;

  align-items: flex-end;

  gap: 4px;
}

.original-size span {
  font-size: 11px;
}

.original-size strong {
  font-size: 13px;

  color: var(--text-color);
}

/* ========================================
   CROPPER CONTAINER
======================================== */

.cropper-container {
  position: relative;

  width: 100%;

  min-height: 500px;

  display: flex;

  align-items: center;

  justify-content: center;

  padding: 30px;

  overflow: hidden;

  background: var(--background-secondary);
}

.cropper-container img {
  display: block;

  max-width: 100%;

  max-height: 600px;

  width: auto;

  height: auto;

  object-fit: contain;

  user-select: none;

  -webkit-user-drag: none;
}

/* ========================================
   CROP SELECTION
======================================== */

.crop-selection {
  position: absolute;

  display: none;

  border: 2px solid #ffffff;

  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);

  cursor: move;

  touch-action: none;
}

/* ========================================
   CROP GRID
======================================== */

.crop-selection::before,
.crop-selection::after {
  content: "";

  position: absolute;

  pointer-events: none;
}

/* Vertical grid lines */

.crop-selection::before {
  top: 0;

  bottom: 0;

  left: 33.333%;

  width: 33.333%;

  border-left: 1px solid rgba(255, 255, 255, 0.5);

  border-right: 1px solid rgba(255, 255, 255, 0.5);
}

/* Horizontal grid lines */

.crop-selection::after {
  left: 0;

  right: 0;

  top: 33.333%;

  height: 33.333%;

  border-top: 1px solid rgba(255, 255, 255, 0.5);

  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

/* ========================================
   CROP HANDLES
======================================== */

.crop-handle {
  position: absolute;

  width: 12px;

  height: 12px;

  border: 2px solid #ffffff;

  background: var(--primary-color);

  border-radius: 3px;

  z-index: 5;
}

.handle-nw {
  top: -7px;

  left: -7px;

  cursor: nwse-resize;
}

.handle-ne {
  top: -7px;

  right: -7px;

  cursor: nesw-resize;
}

.handle-sw {
  bottom: -7px;

  left: -7px;

  cursor: nesw-resize;
}

.handle-se {
  right: -7px;

  bottom: -7px;

  cursor: nwse-resize;
}

/* ========================================
   CROP SETTINGS
======================================== */

.crop-settings {
  margin-top: 24px;

  padding: 28px;

  border: 1px solid var(--border-color);

  border-radius: 16px;

  background: var(--card-background);
}

.settings-title {
  margin-bottom: 24px;
}

.settings-title h3 {
  margin-bottom: 5px;

  font-size: 17px;
}

.settings-title p {
  font-size: 13px;

  color: var(--text-secondary);
}

/* ========================================
   SETTING GROUP
======================================== */

.setting-group {
  display: flex;

  flex-direction: column;

  gap: 8px;

  max-width: 300px;
}

.setting-group label {
  font-size: 13px;

  font-weight: 600;
}

.setting-group select {
  width: 100%;

  height: 50px;

  padding: 0 16px;

  border: 1px solid var(--border-color);

  border-radius: 10px;

  outline: none;

  background: var(--background-secondary);

  color: var(--text-color);

  font-family: inherit;

  font-size: 14px;

  cursor: pointer;

  transition: var(--transition);
}

.setting-group select:focus {
  border-color: var(--primary-color);

  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* ========================================
   CROP DIMENSIONS
======================================== */

.crop-dimensions {
  display: grid;

  grid-template-columns: repeat(2, 1fr);

  gap: 20px;

  margin-top: 24px;
}

.input-group {
  display: flex;

  flex-direction: column;

  gap: 8px;
}

.input-group label {
  font-size: 13px;

  font-weight: 600;
}

.input-with-unit {
  position: relative;
}

.input-with-unit input {
  width: 100%;

  height: 50px;

  padding: 0 55px 0 16px;

  border: 1px solid var(--border-color);

  border-radius: 10px;

  outline: none;

  background: var(--background-secondary);

  color: var(--text-color);

  font-family: inherit;

  font-size: 14px;

  transition: var(--transition);
}

.input-with-unit input:focus {
  border-color: var(--primary-color);

  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.input-with-unit span {
  position: absolute;

  top: 50%;

  right: 16px;

  transform: translateY(-50%);

  font-size: 12px;

  color: var(--text-secondary);
}

/* ========================================
   REMOVE NUMBER ARROWS
======================================== */

.input-with-unit input::-webkit-inner-spin-button,
.input-with-unit input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.input-with-unit input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* ========================================
   TOOL ACTIONS
======================================== */

.tool-actions {
  display: flex;

  align-items: center;

  justify-content: flex-end;

  gap: 12px;

  margin-top: 28px;
}

.tool-actions button {
  min-height: 46px;
}

.tool-actions button:disabled {
  opacity: 0.5;

  cursor: not-allowed;

  transform: none;
}

/* ========================================
   RESULT CARD
======================================== */

.result-card {
  margin-top: 24px;

  overflow: hidden;

  border: 1px solid var(--border-color);

  border-radius: 16px;

  background: var(--card-background);
}

.result-header {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 20px;

  padding: 18px 20px;

  border-bottom: 1px solid var(--border-color);
}

.result-header h3 {
  margin-bottom: 5px;

  font-size: 16px;
}

.result-header span {
  font-size: 12px;

  color: var(--text-secondary);
}

.result-size {
  display: flex;

  flex-direction: column;

  align-items: flex-end;

  gap: 4px;
}

.result-size span {
  font-size: 11px;
}

.result-size strong {
  font-size: 13px;

  color: var(--text-color);
}

/* ========================================
   RESULT PREVIEW
======================================== */

.result-preview {
  min-height: 350px;

  display: flex;

  align-items: center;

  justify-content: center;

  padding: 30px;

  background: var(--background-secondary);
}

.result-preview img {
  display: block;

  max-width: 100%;

  max-height: 500px;

  width: auto;

  height: auto;

  object-fit: contain;
}

/* ========================================
   RESULT ACTIONS
======================================== */

.result-actions {
  display: flex;

  align-items: center;

  justify-content: flex-end;

  gap: 12px;

  padding: 20px;

  border-top: 1px solid var(--border-color);
}

/* ========================================
   INFORMATION SECTION
======================================== */

.tool-info-section {
  padding: 80px 0;

  background: var(--background-secondary);
}

.info-content {
  max-width: 1000px;

  margin: 0 auto;
}

.info-content > h2 {
  margin-bottom: 12px;

  text-align: center;

  font-size: 32px;
}

.info-content > p {
  max-width: 650px;

  margin: 0 auto 50px;

  text-align: center;

  font-size: 14px;

  line-height: 1.7;

  color: var(--text-secondary);
}

/* ========================================
   STEPS GRID
======================================== */

.steps-grid {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 20px;
}

.step-card {
  padding: 28px;

  border: 1px solid var(--border-color);

  border-radius: 16px;

  background: var(--card-background);
}

.step-number {
  margin-bottom: 18px;

  color: var(--primary-color);

  font-size: 13px;

  font-weight: 700;
}

.step-card h3 {
  margin-bottom: 8px;

  font-size: 16px;
}

.step-card p {
  font-size: 13px;

  line-height: 1.7;

  color: var(--text-secondary);
}

/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 768px) {
  .tool-hero {
    padding: 50px 0;
  }

  .breadcrumb {
    margin-bottom: 30px;
  }

  .cropper-section {
    padding: 50px 0;
  }

  .cropper-card-header {
    align-items: flex-start;
  }

  .cropper-container {
    min-height: 350px;

    padding: 20px;
  }

  .crop-dimensions {
    grid-template-columns: 1fr;
  }

  .steps-grid {
    grid-template-columns: 1fr;
  }

  .tool-actions,
  .result-actions {
    flex-direction: column-reverse;
  }

  .tool-actions .btn,
  .result-actions .btn {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .upload-area {
    padding: 50px 20px;
  }

  .upload-area h2 {
    font-size: 20px;
  }

  .cropper-card-header {
    flex-direction: column;
  }

  .original-size {
    align-items: flex-start;
  }

  .crop-settings {
    padding: 20px;
  }

  .setting-group {
    max-width: 100%;
  }

  .result-header {
    flex-direction: column;

    align-items: flex-start;
  }

  .result-size {
    align-items: flex-start;
  }

  .result-preview {
    min-height: 250px;

    padding: 20px;
  }
}

@media (max-width: 400px) {
  .tool-header h1 {
    letter-spacing: -1px;
  }

  .crop-settings {
    padding: 16px;
  }

  .upload-area {
    padding: 40px 16px;
  }
}
