/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   🎨 TECHMIND ENHANCED - STYLES
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ═══════════════════════════════════════════════════
   RESPONSE CONTAINER
   ═══════════════════════════════════════════════════ */

.techmind-response {
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  border-radius: 15px;
  border-left: 5px solid #4caf50;
  padding: 25px;
  margin: 20px 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  animation: slideIn 0.4s ease-out;
}

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

.techmind-response.error {
  background: linear-gradient(135deg, #ffebee, #ffcdd2);
  border-left-color: #f44336;
}

/* ═══════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════ */

.response-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.response-title {
  font-size: 1.2em;
  font-weight: 700;
  color: #2e7d32;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.config-type-badge {
  font-size: 0.85em;
  padding: 6px 15px;
  border-radius: 20px;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════
   TOPOLOGY SECTION
   ═══════════════════════════════════════════════════ */

.topology-section {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin: 15px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  animation: fadeIn 0.5s ease-out 0.2s both;
}

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

.topology-section h4 {
  margin: 0 0 15px 0;
  color: #667eea;
  font-size: 1.1em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topology-info {
  display: flex;
  gap: 15px;
  margin: 10px 0;
  font-size: 0.9em;
  flex-wrap: wrap;
}

.topology-info span {
  padding: 6px 12px;
  background: #f0f4ff;
  border-radius: 8px;
  color: #495057;
}

.topology-diagram-container {
  margin-top: 15px;
}

.topology-diagram {
  width: 100%;
  height: auto;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #f8f9fa;
}

/* Device animations */
.device-node {
  transition: transform 0.2s ease, filter 0.2s ease;
}

.device-node:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.device-label {
  pointer-events: none;
}

/* Link animations */
.topology-link {
  transition: all 0.3s ease;
}

.topology-link:hover line {
  stroke: #667eea;
  stroke-width: 4;
}

/* ═══════════════════════════════════════════════════
   EXPLANATION SECTION
   ═══════════════════════════════════════════════════ */

.explanation-section {
  background: rgba(255, 255, 255, 0.7);
  border-left: 4px solid #667eea;
  padding: 15px 20px;
  margin: 15px 0;
  border-radius: 8px;
  font-size: 0.95em;
  line-height: 1.6;
  color: #495057;
  animation: fadeIn 0.5s ease-out 0.3s both;
}

.explanation-text {
  margin: 0;
}

/* ═══════════════════════════════════════════════════
   STEPS SECTION
   ═══════════════════════════════════════════════════ */

.steps-section {
  margin: 20px 0;
  animation: fadeIn 0.5s ease-out 0.4s both;
}

.steps-section > h4 {
  margin: 0 0 15px 0;
  color: #2e7d32;
  font-size: 1.1em;
}

.step-item {
  background: white;
  border-radius: 10px;
  margin: 12px 0;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
}

.step-item:hover {
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
  transform: translateY(-2px);
}

/* Step Header */
.step-header {
  display: flex;
  align-items: center;
  padding: 15px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  color: white;
  cursor: pointer;
  user-select: none;
  transition: background 0.3s ease;
}

.step-header:hover {
  background: linear-gradient(90deg, #5568d3, #6a3e91);
}

.step-header:active {
  transform: scale(0.99);
}

.step-number {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1em;
  margin-right: 12px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.step-header:hover .step-number {
  background: rgba(255,255,255,0.35);
  transform: rotate(360deg);
}

.step-title {
  flex: 1;
  font-weight: 600;
  font-size: 1.05em;
}

.step-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 1.2em;
  cursor: pointer;
  transition: transform 0.3s ease;
  padding: 5px;
  line-height: 1;
}

.step-toggle.expanded {
  transform: rotate(180deg);
}

/* Step Content */
.step-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-content.expanded {
  max-height: 2000px;
  padding: 15px;
}

.step-description {
  margin: 0 0 15px 0;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  color: #495057;
  line-height: 1.6;
  font-size: 0.95em;
}

/* ═══════════════════════════════════════════════════
   COMMAND BLOCKS
   ═══════════════════════════════════════════════════ */

.command-block {
  background: #1e1e1e;
  border-radius: 8px;
  overflow: hidden;
  margin: 10px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.command-header {
  background: #2d2d2d;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #3d3d3d;
}

.command-header span {
  color: #888;
  font-size: 0.85em;
  font-family: 'Courier New', Consolas, monospace;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.copy-btn {
  background: #4caf50;
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.85em;
  font-weight: 600;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.copy-btn:hover {
  background: #45a049;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

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

.copy-btn.copied {
  background: #2196F3;
  animation: successPulse 0.4s ease;
}

@keyframes successPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.command-block pre {
  padding: 20px;
  margin: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #667eea #2d2d2d;
}

.command-block pre::-webkit-scrollbar {
  height: 8px;
}

.command-block pre::-webkit-scrollbar-track {
  background: #2d2d2d;
}

.command-block pre::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 4px;
}

.command-block pre::-webkit-scrollbar-thumb:hover {
  background: #5568d3;
}

.command-block code {
  font-family: 'Courier New', Consolas, 'Liberation Mono', monospace;
  font-size: 0.95em;
  line-height: 1.7;
  color: #d4d4d4;
  display: block;
}

/* Syntax Highlighting */
.keyword {
  color: #569cd6;
  font-weight: 600;
}

.command-name {
  color: #4ec9b0;
  font-weight: 600;
}

.number {
  color: #b5cea8;
}

.string {
  color: #ce9178;
}

.comment {
  color: #6a9955;
  font-style: italic;
}

.ip-address {
  color: #dcdcaa;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════
   ACTIONS SECTION
   ═══════════════════════════════════════════════════ */

.actions-section {
  display: flex;
  gap: 12px;
  margin-top: 25px;
  flex-wrap: wrap;
  animation: fadeIn 0.5s ease-out 0.5s both;
}

.actions-section button {
  flex: 1;
  min-width: 140px;
  padding: 14px 20px;
  border: none;
  border-radius: 10px;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.actions-section button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.actions-section button:active {
  transform: translateY(-1px);
}

.download-txt {
  background: white;
  color: #4caf50;
  border: 2px solid #4caf50;
}

.download-txt:hover {
  background: #4caf50;
  color: white;
}

.pt-ready {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
}

.pt-ready:hover {
  background: linear-gradient(135deg, #5568d3, #6a3e91);
}

.ask-more {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
}

.ask-more:hover {
  background: #667eea;
  color: white;
}

/* ═══════════════════════════════════════════════════
   ERROR STATE
   ═══════════════════════════════════════════════════ */

.error-content {
  text-align: center;
  padding: 30px;
}

.error-content h4 {
  color: #d32f2f;
  margin: 0 0 15px 0;
}

.error-content p {
  color: #666;
  margin: 0 0 20px 0;
}

.error-content button {
  background: #f44336;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.error-content button:hover {
  background: #d32f2f;
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════
   LOADING STATE
   ═══════════════════════════════════════════════════ */

.topology-loading {
  height: 300px;
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e0e0e0 50%,
    #f0f0f0 75%
  );
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 8px;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .techmind-response {
    padding: 18px;
    margin: 15px 0;
  }

  .response-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .topology-section {
    padding: 15px;
  }

  .topology-diagram {
    height: 250px;
  }

  .topology-info {
    flex-direction: column;
    gap: 8px;
  }

  .step-header {
    padding: 12px;
  }

  .step-number {
    width: 28px;
    height: 28px;
    font-size: 1em;
  }

  .step-title {
    font-size: 0.95em;
  }

  .command-block pre {
    padding: 15px;
    font-size: 0.85em;
  }

  .actions-section {
    flex-direction: column;
  }

  .actions-section button {
    min-width: 100%;
  }
}

@media (max-width: 480px) {
  .response-title {
    font-size: 1.05em;
  }

  .topology-section h4 {
    font-size: 1em;
  }

  .steps-section > h4 {
    font-size: 1em;
  }

  .command-block code {
    font-size: 0.85em;
  }

  .actions-section button {
    padding: 12px 16px;
    font-size: 0.9em;
  }
}

/* ═══════════════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════════════ */

@media print {
  .techmind-response {
    background: white;
    border: 1px solid #ddd;
    box-shadow: none;
  }

  .step-content {
    max-height: none !important;
    padding: 15px !important;
  }

  .step-toggle,
  .copy-btn,
  .actions-section {
    display: none !important;
  }

  .command-block {
    background: white;
    border: 1px solid #ddd;
  }

  .command-block code {
    color: black;
  }
}

/* ═══════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════ */

.step-header:focus {
  outline: 3px solid #667eea;
  outline-offset: 2px;
}

.copy-btn:focus {
  outline: 3px solid #4caf50;
  outline-offset: 2px;
}

.actions-section button:focus {
  outline: 3px solid currentColor;
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .techmind-response {
    border: 3px solid currentColor;
  }

  .step-header {
    border: 2px solid white;
  }

  .command-block {
    border: 2px solid white;
  }
}
