:root {
  --primary: #4a6cf7;
  --primary-hover: #3a5ce5;
  --bg-color: #f1f2f3;
  --card-bg: #ffffff;
  --text-color: #333333;
  --text-secondary: #666666;
  --border-color: #e0e0e0;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
}

* {
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
}

.container {
  box-sizing: border-box;
  width: 100%;
  max-width: 1520px;
  min-width: 1240px;
  margin: 20px auto;
  color: var(--text-color);
}

.container *{
  box-sizing: border-box;
}

header {
  text-align: center;
  margin-bottom: 20px;
}

header h1 {
  font-size: 2.2rem;
  margin-bottom: 5px;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

header p {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 95%;
  margin: 0 auto;
  line-height: 1.6;
}

.card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  padding: 20px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.card-title h2{
  font-size: 1.2rem;
  color: var(--text-color);
}

.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: 10px;
  padding: 40px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  background: #fafafa;
  cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--primary);
  background: rgba(74, 108, 247, 0.05);
}

.upload-icon {
  font-size: 3.5rem;
  margin-bottom: 15px;
  color: var(--primary);
}

.upload-text {
  margin-bottom: 20px;
}

.upload-text h3 {
  font-size: 1.4rem;
  margin-bottom: 10px;
}

.upload-text p {
  color: var(--text-secondary);
  font-size: 1rem;
}

.btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 28px;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

.btn:disabled {
  background: #cccccc;
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: rgba(74, 108, 247, 0.1);
}

.btn-success {
  background: var(--success);
}

.btn-success:hover {
  background: #0da271;
}

.settings-area {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 20px 0;
}

.setting-group {
  flex: 1;
  min-width: 300px;
}

.setting-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

select,
input[type="number"] {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  background: white;
  transition: border-color 0.3s;
}

select:focus,
input[type="number"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(74, 108, 247, 0.2);
}

.preview-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.preview-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease;
}

.preview-card:hover {
  transform: translateY(-5px);
}

.preview-header {
  padding: 15px;
  background: #f7f9fc;
  border-bottom: 1px solid var(--border-color);
}

.preview-header h4 {
  font-size: 1rem;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-size {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.preview-image {
  width: 100%;
  height: 200px;
  object-fit: contain;
  padding: 15px;
  background: #fcfcfc;
}

.preview-info {
  padding: 15px;
  border-top: 1px solid var(--border-color);
}

.dpi-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
}

.dpi-label {
  font-weight: 600;
}

.dpi-value {
  font-weight: 600;
  color: var(--primary);
}

.preview-actions {
  display: flex;
  gap: 10px;
}

.action-btn {
  flex: 1;
  padding: 8px 12px;
  text-align: center;
  border-radius: 6px;
  background: #f0f4ff;
  color: var(--primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:hover {
  background: var(--primary);
  color: white;
}

.status-area {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-top: 20px;
}

.status-text {
  font-size: 1rem;
  color: var(--text-secondary);
}

.status-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--warning);
  margin-right: 10px;
}

.status-indicator.active {
  background: var(--success);
}

.batch-actions {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-top: 20px;
}

.file-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-top: 20px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  border-bottom: 1px solid var(--border-color);
}

.file-item:last-child {
  border-bottom: none;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-name {
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.file-remove {
  color: var(--error);
  cursor: pointer;
  background: none;
  border: none;
  font-size: 1.2rem;
}

.file-remove:hover {
  color: #dc2626;
}

.dpi-display {
  min-width: 80px;
  text-align: right;
}

.dpi-new {
  color: var(--primary);
  font-weight: 600;
}

.instructions {
  background: #f8f9fa;
  border-left: 4px solid var(--primary);
  padding: 15px;
  border-radius: 0 8px 8px 0;
  margin: 15px 0;
}

.instructions h3 {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.instructions ul {
  padding-left: 20px;
}

.instructions li {
  margin-bottom: 10px;
  line-height: 1.6;
}

footer {
  text-align: center;
  padding: 20px 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 20px;
}

.progress-bar {
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 15px;
}

.progress {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.3s ease;
}

.hidden {
  display: none;
}

.preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.preview-modal img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.preview-modal button {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: white;
  font-size: 30px;
  cursor: pointer;
}
