/* Modern Dockerfile Generator Styles */

:root {
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: #dbeafe;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

body {
  background: linear-gradient(to bottom, var(--gray-50) 0%, #ffffff 100%);
  min-height: 100vh;
}

/* Override global.css width constraint */
body main {
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 2rem;
  max-width: 1400px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 1024px) {
  .container {
    flex-direction: row;
    align-items: flex-start;
  }
}

.panel {
  background: white;
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  width: 100%;
}

@media (min-width: 1024px) {
  .panel:first-child {
    flex: 0 0 45%;
    max-width: 600px;
  }

  .panel:last-child {
    flex: 1;
    min-width: 0;
  }
}

/* Typography */
h1 {
  color: var(--gray-900);
  margin-bottom: 0.5rem;
  font-size: 2.5rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.025em;
}

.subtitle {
  color: var(--gray-600);
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.125rem;
  font-weight: 400;
}

/* Section Styling */
.section {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.section-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title::before {
  content: '';
  width: 0.25rem;
  height: 1.5rem;
  background: linear-gradient(to bottom, var(--primary-color), var(--primary-hover));
  border-radius: 999px;
}

/* Step Indicator */
.step-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: var(--primary-light);
  color: var(--primary-color);
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 700;
  margin-right: 0.5rem;
}

/* Option Groups */
.option-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.option-btn {
  padding: 0.75rem 1.25rem;
  border: 2px solid var(--gray-300);
  background: white;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-700);
  position: relative;
  overflow: hidden;
}

.option-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--primary-color);
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 0;
}

.option-btn > * {
  position: relative;
  z-index: 1;
}

.option-btn:hover:not(.disabled) {
  border-color: var(--primary-color);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.option-btn.active {
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-md);
}

.option-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--gray-100);
}

/* Tips */
.tip {
  background: linear-gradient(to right, #fef3c7, #fde68a);
  border-left: 4px solid var(--warning-color);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--gray-700);
  margin-top: 1rem;
  line-height: 1.6;
  box-shadow: var(--shadow-sm);
}

.tip-title {
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Output Section */
.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.output-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

.button-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.copy-btn {
  padding: 0.625rem 1.25rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.9375rem;
  white-space: nowrap;
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.copy-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.copy-btn.copied {
  background: var(--success-color);
}

/* Dockerfile Output */
.dockerfile-output {
  background: var(--gray-900);
  color: #e5e7eb;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
  max-height: 600px;
  overflow-y: auto;
  border: 1px solid var(--gray-700);
  box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.2);
}

.dockerfile-output::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.dockerfile-output::-webkit-scrollbar-track {
  background: var(--gray-800);
  border-radius: 4px;
}

.dockerfile-output::-webkit-scrollbar-thumb {
  background: var(--gray-600);
  border-radius: 4px;
}

.dockerfile-output::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

.dockerfile-output .comment { color: #6ee7b7; font-style: italic; }
.dockerfile-output .keyword { color: #60a5fa; font-weight: 700; }
.dockerfile-output .string { color: #fbbf24; }
.dockerfile-output .variable { color: #a78bfa; }

/* Build Command */
.build-command {
  background: var(--gray-800);
  color: #e5e7eb;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', 'Courier New', monospace;
  font-size: 0.875rem;
  margin-top: 1rem;
  line-height: 1.7;
  white-space: pre;
  overflow-x: auto;
  border: 1px solid var(--gray-700);
  box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.2);
}

.build-command .comment { color: #6ee7b7; font-style: italic; }
.build-command .keyword { color: #60a5fa; font-weight: 700; }
.build-command .variable { color: #a78bfa; }

.build-command-title {
  color: #34d399;
  font-weight: 700;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

/* Checkbox Groups */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.75rem;
  border-radius: var(--radius);
  transition: background 0.2s;
  border: 1px solid transparent;
}

.checkbox-label:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.checkbox-label input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
  accent-color: var(--primary-color);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background: var(--primary-light);
  color: var(--primary-color);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge.recommended {
  background: #d1fae5;
  color: #059669;
}

.badge.warning {
  background: #fed7aa;
  color: #c2410c;
}

/* Build Path Selection */
.build-path-selector {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .build-path-selector {
    grid-template-columns: repeat(2, 1fr);
  }
}

.path-card {
  padding: 1.5rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: white;
}

.path-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.path-card.active {
  border-color: var(--primary-color);
  background: linear-gradient(135deg, var(--primary-light) 0%, white 100%);
  box-shadow: var(--shadow-lg);
}

.path-card h3 {
  color: var(--primary-color);
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.path-card p {
  color: var(--gray-600);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0;
}

.path-card .path-badge {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  background: var(--primary-color);
  color: white;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  h1 {
    font-size: 1.875rem;
  }

  .panel {
    padding: 1.5rem;
  }

  .section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
  }

  .dockerfile-output {
    font-size: 0.8125rem;
    max-height: 400px;
    padding: 1rem;
  }

  .build-command {
    font-size: 0.8125rem;
    padding: 1rem;
  }

  .option-btn {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section {
  animation: fadeIn 0.3s ease-out;
}

/* Loading State */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Input Styles */
#registryInput {
  transition: border-color 0.2s, box-shadow 0.2s;
}

#registryInput:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Focus Styles for Accessibility */
.option-btn:focus-visible,
.copy-btn:focus-visible,
.checkbox-label:focus-within {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}
