.image-prompt-container {
  --primary: #BE1E2D;
  --bg-card: #FFFFFF;
  --border: #000000;
  --toggle-even: #FFE6E6;

  max-width: 1200px;
  margin: 32px auto;
  padding: 0 16px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.image-prompt-container * {
  box-sizing: border-box;
}

.ipc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 768px) {
  .ipc-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.ipc-card {
  background: var(--bg-card);
  border: 3px solid var(--border);
  padding: 32px;
  border-radius: 4px;
}

.ipc-card-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 24px;
  color: #000000;
}

.ipc-label {
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
  font-size: 14px;
}

.ipc-file-input {
  display: none;
}

.ipc-drop-zone {
  border: 3px dashed var(--border);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #FAFAFA;
  border-radius: 4px;
}

.ipc-drop-zone.hidden {
  display: none;
}

.ipc-drop-zone:hover {
  background: var(--toggle-even);
  border-color: var(--primary);
}

.ipc-drop-zone.dragover {
  background: var(--toggle-even);
  border-color: var(--primary);
  border-style: solid;
  transform: scale(1.02);
}

.ipc-drop-zone-icon {
  font-size: 48px;
  margin-bottom: 12px;
  display: block;
}

.ipc-drop-zone-text {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 16px;
}

.ipc-drop-zone-subtext {
  font-size: 14px;
  color: #666;
}

.ipc-file-name {
  margin-top: 12px;
  padding: 12px;
  background: var(--toggle-even);
  border: 2px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  display: none;
  border-radius: 4px;
}

.ipc-file-name.active {
  display: block;
}

.ipc-format-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 8px;
}

.ipc-radio-option {
  border: 3px solid var(--border);
  padding: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--toggle-even);
  transition: all 0.2s;
  border-radius: 4px;
}

.ipc-radio-option:hover {
  background: #FFD6D6;
  transform: translateY(-2px);
}

.ipc-radio-option input {
  pointer-events: none;
  accent-color: var(--primary);
}

.ipc-preview {
  display: none;
  width: 100%;
  max-height: 300px;
  border: 3px solid var(--border);
  object-fit: contain;
  border-radius: 4px;
  cursor: pointer;
}

.ipc-preview.active {
  display: block;
}

.ipc-preview:hover {
  opacity: 0.8;
}

.ipc-btn {
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  background: var(--primary);
  color: #fff;
  border: 3px solid var(--border);
  font-weight: 700;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
  border-radius: 4px;
}

.ipc-btn:hover:not(:disabled) {
  background: #9E1525;
  transform: translateY(-2px);
}

.ipc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ipc-btn-secondary {
  background: #fff;
  color: #000;
}

.ipc-btn-secondary:hover:not(:disabled) {
  background: #F5F5F5;
}

.ipc-output {
  width: 100%;
  min-height: 300px;
  padding: 20px;
  border: 3px solid var(--border);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  resize: vertical;
  border-radius: 4px;
  line-height: 1.8;
  color: #1a1a1a;
  background: #ffffff;
  font-weight: 400;
  letter-spacing: 0.2px;
}

.ipc-output::placeholder {
  color: #999;
  font-weight: 400;
}

.ipc-loader {
  display: none;
  margin-top: 20px;
  padding: 24px;
  background: #FAFAFA;
  border: 3px solid var(--border);
  border-radius: 4px;
  text-align: center;
}

.ipc-loader.active {
  display: block;
}

.ipc-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #E5E5E5;
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.ipc-loader-text {
  font-weight: 600;
  margin-bottom: 12px;
  color: #333;
}

.ipc-progress-bar {
  width: 100%;
  height: 8px;
  background: #E5E5E5;
  border-radius: 4px;
  overflow: hidden;
}

.ipc-progress-fill {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.2s ease;
}

.ipc-status {
  display: none;
  margin-top: 16px;
  padding: 12px;
  border: 3px solid var(--border);
  font-weight: 600;
  border-radius: 4px;
}

.ipc-status.active {
  display: block;
}

.ipc-status.error { background: #FFE6E6; color: #BE1E2D; }
.ipc-status.success { background: #E6FFE6; color: #1E8E3E; }
.ipc-status.loading { background: #FFF9E6; color: #D97706; }

.ipc-rating-section {
  display: none;
  margin-top: 20px;
  padding: 20px;
  border: 3px solid var(--border);
  background: #F9F9F9;
  border-radius: 4px;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.ipc-rating-section.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.ipc-rating-title {
  font-weight: 700;
  margin-bottom: 14px;
  font-size: 16px;
  text-align: center;
}

.ipc-rating-buttons {
  display: flex;
  gap: 12px;
}

.ipc-rating-btn {
  flex: 1;
  padding: 14px 20px;
  border: 3px solid var(--border);
  background: white;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  border-radius: 4px;
  font-size: 15px;
}

.ipc-rating-btn:hover:not(.voted) {
  background: var(--toggle-even);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ipc-rating-btn:active:not(.voted) {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.ipc-rating-btn.voted {
  background: #E6FFE6;
  cursor: default;
  border-color: #1E8E3E;
  transition: all 0.3s ease;
}

.ipc-rating-icon {
  font-size: 24px;
  transition: transform 0.2s ease;
}

.ipc-rating-btn:hover:not(.voted) .ipc-rating-icon {
  transform: rotate(-5deg) scale(1.1);
}

.ipc-rating-btn:active:not(.voted) .ipc-rating-icon {
  transform: rotate(0) scale(1.05);
}

.ipc-rating-thank {
  display: none;
  margin-top: 14px;
  padding: 14px;
  background: #E6FFE6;
  border: 2px solid #1E8E3E;
  font-weight: 600;
  text-align: center;
  border-radius: 4px;
  color: #1E8E3E;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.ipc-rating-thank.active {
  display: block;
  opacity: 1;
  transform: scale(1);
}

.ipc-rating-stats {
  margin-top: 12px;
  padding: 10px;
  background: white;
  border: 2px solid var(--border);
  font-size: 13px;
  text-align: center;
  border-radius: 4px;
  color: #666;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.ipc-rating-stats.visible {
  opacity: 1;
  transform: translateY(0);
}
