/**
 * OpenAPI Generation UI Styles
 */

/* Generate API Docs Button */
.btn-generate-docs {
  background: linear-gradient(135deg, #238636 0%, #2ea043 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(35, 134, 54, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-generate-docs:hover {
  background: linear-gradient(135deg, #2ea043 0%, #238636 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(35, 134, 54, 0.4);
}

.btn-generate-docs:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(35, 134, 54, 0.3);
}

.btn-generate-docs svg {
  width: 18px;
  height: 18px;
}

/* Progress Overlay */
.generation-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(13, 17, 23, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.generation-progress {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 40px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
}

.generation-progress h2 {
  margin: 0 0 24px 0;
  font-size: 24px;
  color: #c9d1d9;
  text-align: center;
}

.progress-stages {
  margin-bottom: 32px;
}

.progress-stage {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.progress-stage.active {
  opacity: 1;
}

.progress-stage.complete {
  opacity: 0.7;
}

.stage-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #30363d;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.progress-stage.active .stage-icon {
  border-color: #58a6ff;
  background: rgba(88, 166, 255, 0.1);
  animation: pulse 1.5s ease-in-out infinite;
}

.progress-stage.complete .stage-icon {
  border-color: #238636;
  background: #238636;
}

.stage-icon svg {
  width: 14px;
  height: 14px;
  stroke: #c9d1d9;
}

.progress-stage.complete .stage-icon svg {
  stroke: white;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(88, 166, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(88, 166, 255, 0);
  }
}

.stage-text {
  font-size: 15px;
  color: #c9d1d9;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: #21262d;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #238636 0%, #2ea043 100%);
  border-radius: 4px;
  transition: width 0.5s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Success Modal */
.success-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(13, 17, 23, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}

.success-modal-content {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 40px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.3s ease;
}

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

.success-header {
  text-align: center;
  margin-bottom: 32px;
}

.success-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #238636 0%, #2ea043 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
  animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}

.success-icon svg {
  width: 32px;
  height: 32px;
  stroke: white;
  stroke-width: 3;
}

.success-header h2 {
  margin: 0 0 8px 0;
  font-size: 24px;
  color: #c9d1d9;
}

.success-header p {
  margin: 0;
  color: #8b949e;
  font-size: 14px;
}

.export-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.export-card {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.export-card:hover {
  border-color: #58a6ff;
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(88, 166, 255, 0.2);
}

.export-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(88, 166, 255, 0.1);
  transition: all 0.2s ease;
}

.export-card:hover .export-card-icon {
  background: rgba(88, 166, 255, 0.2);
}

.export-card-icon svg {
  width: 24px;
  height: 24px;
  stroke: #58a6ff;
}

.export-card h3 {
  margin: 0;
  font-size: 15px;
  color: #c9d1d9;
  font-weight: 600;
}

.export-card p {
  margin: 0;
  font-size: 12px;
  color: #8b949e;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.btn-modal {
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-modal-primary {
  background: #238636;
  color: white;
}

.btn-modal-primary:hover {
  background: #2ea043;
}

.btn-modal-secondary {
  background: transparent;
  color: #c9d1d9;
  border: 1px solid #30363d;
}

.btn-modal-secondary:hover {
  border-color: #58a6ff;
  color: #58a6ff;
}

/* Endpoint Grouping View Toggle */
.view-toggle {
  display: flex;
  gap: 8px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 4px;
  margin-bottom: 16px;
}

.view-toggle-btn {
  padding: 8px 16px;
  background: transparent;
  border: none;
  color: #8b949e;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-toggle-btn.active {
  background: #238636;
  color: white;
}

.view-toggle-btn:hover:not(.active) {
  color: #c9d1d9;
  background: rgba(255, 255, 255, 0.05);
}

.view-toggle-btn svg {
  width: 16px;
  height: 16px;
}

/* Grouped Endpoints View */
.endpoint-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.endpoint-group {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.endpoint-group-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.endpoint-group-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.endpoint-group-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.endpoint-group-method {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Monaco', 'Menlo', monospace;
}

.endpoint-group-path {
  font-size: 14px;
  color: #c9d1d9;
  font-family: 'Monaco', 'Menlo', monospace;
}

.path-parameter {
  color: #f78c6c;
  background: rgba(247, 140, 108, 0.15);
  padding: 2px 6px;
  border-radius: 3px;
}

.endpoint-group-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #8b949e;
  font-size: 12px;
}

.sample-count {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sample-count svg {
  width: 14px;
  height: 14px;
}

.expand-icon {
  width: 20px;
  height: 20px;
  color: #8b949e;
  transition: transform 0.2s ease;
}

.endpoint-group.expanded .expand-icon {
  transform: rotate(180deg);
}

.endpoint-group-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.endpoint-group.expanded .endpoint-group-content {
  max-height: 1000px;
}

.endpoint-samples {
  border-top: 1px solid #30363d;
  padding: 8px;
}

.endpoint-sample {
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 13px;
  color: #8b949e;
  font-family: 'Monaco', 'Menlo', monospace;
  cursor: pointer;
  transition: all 0.2s ease;
}

.endpoint-sample:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #c9d1d9;
}

.endpoint-sample:last-child {
  margin-bottom: 0;
}

/* Stats Display */
.generation-stats {
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid rgba(88, 166, 255, 0.3);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 24px;
}

.generation-stats h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #58a6ff;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-label {
  font-size: 13px;
  color: #8b949e;
}

.stat-value {
  font-size: 16px;
  font-weight: 600;
  color: #c9d1d9;
}

/* Format Selection Modal */
.format-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.format-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(13, 17, 23, 0.9);
  backdrop-filter: blur(4px);
}

.format-modal-content {
  position: relative;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 32px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  animation: slideUp 0.3s ease;
  z-index: 1;
}

.format-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.format-modal-header h3 {
  margin: 0;
  font-size: 20px;
  color: #c9d1d9;
  font-weight: 600;
}

.format-modal-close {
  background: transparent;
  border: none;
  color: #8b949e;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.format-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #c9d1d9;
}

.format-modal-description {
  margin: 0 0 24px 0;
  color: #8b949e;
  font-size: 14px;
}

.format-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.format-option {
  background: #0d1117;
  border: 2px solid #30363d;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.format-option:hover {
  border-color: #58a6ff;
  background: rgba(88, 166, 255, 0.05);
  transform: translateX(4px);
}

.format-option:active {
  transform: translateX(2px);
}

.format-option-icon {
  width: 48px;
  height: 48px;
  background: rgba(88, 166, 255, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.format-option:hover .format-option-icon {
  background: rgba(88, 166, 255, 0.2);
}

.format-option-icon svg {
  width: 24px;
  height: 24px;
  stroke: #58a6ff;
}

.format-option-text {
  flex: 1;
}

.format-option-text h4 {
  margin: 0 0 4px 0;
  font-size: 16px;
  color: #c9d1d9;
  font-weight: 600;
}

.format-option-text p {
  margin: 0;
  font-size: 13px;
  color: #8b949e;
  line-height: 1.4;
}

.format-modal-loading {
  text-align: center;
  padding: 20px 0;
}

.format-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #30363d;
  border-top-color: #58a6ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.format-modal-loading p {
  margin: 0;
  color: #8b949e;
  font-size: 14px;
}

/* Toast Notifications */
.export-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 10001;
  animation: slideInRight 0.3s ease;
  max-width: 400px;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.export-toast.success {
  border-left: 3px solid #238636;
}

.export-toast.error {
  border-left: 3px solid #f85149;
}

.export-toast-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.export-toast.success .export-toast-icon {
  color: #238636;
}

.export-toast.error .export-toast-icon {
  color: #f85149;
}

.export-toast-text {
  flex: 1;
}

.export-toast-text strong {
  display: block;
  color: #c9d1d9;
  font-size: 14px;
  margin-bottom: 2px;
}

.export-toast-text span {
  display: block;
  color: #8b949e;
  font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
  .export-options {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .generation-progress,
  .success-modal-content {
    padding: 24px;
    width: 95%;
  }

  .format-modal-content {
    padding: 24px;
    width: 95%;
  }

  .export-toast {
    bottom: 16px;
    right: 16px;
    left: 16px;
    max-width: none;
  }
}
