/* Image Converter Tool Styles */
.tool-container, .main-tool-bordered.image-converter-tool {
  max-width: 500px;
  margin: 2rem auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  padding: 2rem 1.5rem;
}

.file-upload {
  border: 2px dashed #3b82f6;
  border-radius: 12px;
  padding: 2.5rem 1rem;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  margin-bottom: 1.5rem;
  transition: border-color 0.2s;
}
.file-upload:hover, .file-upload:focus {
  border-color: #2563eb;
  background: #f1f5f9;
}
.upload-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
.upload-text {
  font-size: 1.1rem;
  font-weight: 500;
  color: #1e293b;
}
.upload-hint {
  font-size: 0.95rem;
  color: #64748b;
  margin-top: 0.25rem;
}

.convert-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 0.5rem;
  align-items: center;
  margin: 1rem 0 1.5rem 0;
  font-size: 0.98rem;
}
.convert-controls label {
  font-weight: 500;
  margin-right: 0.3rem;
}
.convert-controls select {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  font-size: 1rem;
  margin-right: 0.7rem;
  width: auto;
}
.convert-controls select:focus {
  outline: 2px solid #2563eb;
  border-color: #2563eb;
}

.progress-container {
  display: none;
  margin: 1.2rem 0 0.5rem 0;
}
.progress-bar {
  width: 100%;
  height: 12px;
  background: #e0e7ef;
  border-radius: 6px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  border-radius: 6px;
  transition: width 0.3s;
}
.progress-text {
  font-size: 0.98rem;
  color: #2563eb;
  margin-top: 0.5rem;
  text-align: center;
}

.error-container {
  display: none;
  background: #fef2f2;
  border: 1.5px solid #ef4444;
  border-radius: 10px;
  padding: 1rem 1rem;
  margin-top: 1rem;
  text-align: center;
}
.error-icon {
  font-size: 2rem;
  color: #ef4444;
  margin-bottom: 0.5rem;
}
.error-message {
  color: #991b1b;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.preview-list, .result-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.preview-item, .result-item {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin-bottom: 1rem;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  transition: box-shadow 0.2s;
}
.preview-item:hover, .result-item:hover {
  box-shadow: 0 4px 16px rgba(59,130,246,0.10);
}
.preview-image img, .result-image img {
  max-width: 120px;
  max-height: 120px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  object-fit: cover;
  margin-right: 1rem;
}
.preview-item-info, .result-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.preview-item-name, .result-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.preview-item-size, .result-size {
  font-size: 0.95rem;
  color: #64748b;
  margin-bottom: 0.5rem;
}
.preview-item-remove {
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-weight: 600;
  margin-left: 1rem;
  font-size: 1.1rem;
  transition: background 0.2s;
}
.preview-item-remove:hover {
  background: #b91c1c;
}
.download-button {
  background: #22c55e;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1.2rem;
  cursor: pointer;
  font-weight: 600;
  margin-top: 0.5rem;
  transition: background 0.2s;
}
.download-button:hover {
  background: #16a34a;
}
.result-container ul#resultList {
  list-style: none;
  padding: 0;
  margin: 0;
}
body {
  /* Prevent horizontal scroll on mobile */
  overflow-x: hidden;
}

@media (max-width: 600px) {
  html, body, .container, .main-content, .tool-container, .main-tool-bordered.image-converter-tool {
    overflow-x: hidden !important;
    max-width: 100vw;
    box-sizing: border-box;
  }
  .tool-container, .main-tool-bordered.image-converter-tool {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 1rem 0.5rem;
    box-sizing: border-box;
  }
  .preview-item, .result-item {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.75rem 0.5rem;
    margin-left: 0;
    margin-right: 0;
    margin: 0 auto 1rem auto;
    overflow-x: hidden;
  }
  .preview-item > *, .result-item > * {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  .preview-image img, .result-image img {
    margin-right: 0;
    margin-bottom: 0.5rem;
    max-width: 100%;
    height: auto;
    display: block;
    box-sizing: border-box;
  }
  .preview-item-info, .result-info {
    margin-left: 0;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
  }
  .preview-item-name, .result-name {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    font-size: 1rem;
    padding-right: 0.25rem;
    padding-left: 0.25rem;
  }
  .preview-item-size, .result-size {
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
  }
  .result-item .download-button, .preview-item .preview-item-remove, .result-item .download-button {
    width: 100%;
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
    display: block;
    max-width: 100%;
  }
  .result-item .button-group, .preview-item .button-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
  }
} 