/* Header Section */
.page-header {
  text-align: center;
  padding: 3rem 1rem 1rem;
}

.page-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.page-header h1 .gradient-text {
  background: var(--gradient-bg);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-header p {
  font-size: 1.125rem;
  color: #64748b;
  max-width: 600px;
  margin: 0 auto;
}

/* Converter Container */
.converter-container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.converter-card {
  background: white;
  border-radius: 20px;
  padding: 3rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(37, 99, 235, 0.1);
}

/* Alerts */
.alert-custom {
  padding: 1rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
}

.alert-error {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 2px solid #fca5a5;
  color: #991b1b;
}

.alert-success {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 2px solid var(--accent-color);
  color: #065f46;
}

/* Upload Area */
.upload-area {
  border: 3px dashed #cbd5e1;
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  cursor: pointer;
  position: relative;
}

.upload-area:hover {
  border-color: var(--primary-color);
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.upload-area.has-files {
  border-color: var(--accent-color);
  border-style: solid;
}

.upload-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: block;
  pointer-events: none;
}

.upload-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.5rem;
  pointer-events: none;
}

.upload-hint {
  font-size: 0.875rem;
  color: #64748b;
  pointer-events: none;
}

#fileInput {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

/* Images Preview */
.images-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 12px;
}

.preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-item .remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(220, 38, 38, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
}

.preview-item .remove-btn:hover {
  background: rgba(153, 27, 27, 1);
  transform: scale(1.1);
}

/* Layout Options */
.layout-options {
  margin-top: 2rem;
  padding: 1.5rem;
  background: #f8fafc;
  border-radius: 12px;
}

.layout-options label {
  display: block;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.75rem;
}

.layout-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.layout-btn {
  padding: 0.75rem;
  border: 2px solid #cbd5e1;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  font-weight: 500;
  color: #64748b;
}

.layout-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.layout-btn.active {
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: white;
}

/* Convert Button */
.btn-convert {
  width: 100%;
  padding: 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  background: var(--gradient-bg);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 2rem;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.btn-convert:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
}

.btn-convert:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-convert:active {
  transform: translateY(0);
}

/* Result Card */
.result-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 2px solid var(--accent-color);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  margin-top: 2rem;
  animation: slideIn 0.5s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-card h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #065f46;
  margin-bottom: 0.5rem;
}

.result-card p {
  color: #047857;
  margin-bottom: 1.5rem;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background: var(--accent-color);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn-download:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
  color: white;
  text-decoration: none;
}
