/* Cisco Configuration Builder - All Styles */


* {
  box-sizing: border-box;
}

:root {
  /* Light mode (default) */
  --bg-gradient-start: #667eea;
  --bg-gradient-end: #764ba2;
  --panel-bg: rgba(255, 255, 255, 0.95);
  --panel-text: #1f2937;
  --header-text: white;
  --category-header-bg: #f3f4f6;
  --category-header-hover: #e5e7eb;
  --search-bg: #f9fafb;
  --search-border: #d1d5db;
  --output-bg: #0f172a;
  --output-text: #94a3b8;
  --config-line-hover: #1e293b;
  --modal-bg: white;
  --modal-text: #1f2937;
  --template-card-bg: #f9fafb;
  --template-card-border: #e5e7eb;
}

body.dark-mode {
  /* Dark mode */
  --bg-gradient-start: #1e1b4b;
  --bg-gradient-end: #312e81;
  --panel-bg: rgba(30, 41, 59, 0.95);
  --panel-text: #e5e7eb;
  --header-text: #f1f5f9;
  --category-header-bg: #334155;
  --category-header-hover: #475569;
  --search-bg: #1e293b;
  --search-border: #475569;
  --output-bg: #020617;
  --output-text: #94a3b8;
  --config-line-hover: #0f172a;
  --modal-bg: #1e293b;
  --modal-text: #e5e7eb;
  --template-card-bg: #334155;
  --template-card-border: #475569;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  color: #e5e7eb;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.3s ease;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.header {
  text-align: center;
  margin-bottom: 3rem;
  color: var(--header-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-content {
  flex: 1;
}

.dark-mode-toggle {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 2rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: white;
  font-size: 1.2rem;
  transition: all 0.3s;
}

.dark-mode-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

/* Device Switcher */
.device-switcher {
  display: flex;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.4rem;
  border-radius: 0.75rem;
  backdrop-filter: blur(10px);
}

.device-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  padding: 0.4rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.device-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  transform: translateY(-1px);
}

.device-btn.active {
  background: rgba(255, 255, 255, 0.95);
  color: #667eea;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Responsive device switcher */
@media (max-width: 1200px) {
  .device-switcher {
    flex-wrap: wrap;
    gap: 0.3rem;
  }

  .device-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 768px) {
  .device-switcher {
    width: 100%;
    justify-content: center;
  }

  .device-btn {
    flex: 1;
    min-width: fit-content;
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
  }
}

.header h1 {
  font-size: 2.5rem;
  margin: 0 0 0.5rem 0;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
  font-size: 1.1rem;
  opacity: 0.9;
  margin: 0;
}

.main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
  }

  .btn-group-label {
    display: none;
  }

  .btn-group {
    padding: 0.25rem;
  }

  .output-actions-row {
    gap: 0.5rem;
  }
}

@media (max-width: 768px) {
  .btn-group .btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
  }
}

.panel {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  color: #1f2937;
}

.panel h2 {
  margin: 0 0 1rem 0;
  color: #667eea;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.search-box {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 1rem;
  margin-bottom: 1rem;
  transition: border-color 0.3s;
}

.search-box:focus {
  outline: none;
  border-color: #667eea;
}

/* Keyword Filter Chips */
.keyword-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.5rem;
  background: rgba(102, 126, 234, 0.05);
  border-radius: 0.5rem;
}

.keyword-chip {
  padding: 0.5rem 1.1rem;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 2rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: #4b5563;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.keyword-chip::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.keyword-chip:hover {
  border-color: #667eea;
  color: #667eea;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.keyword-chip:hover::before {
  opacity: 1;
}

.keyword-chip.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  transform: translateY(-2px);
}

.keyword-chip.active:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

body.dark-mode .keyword-chip {
  background: #334155;
  border-color: #475569;
  color: #e5e7eb;
}

body.dark-mode .keyword-chip:hover {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.2);
}

body.dark-mode .keyword-chip.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

@media (max-width: 768px) {
  .keyword-filters {
    gap: 0.4rem;
  }

  .keyword-chip {
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
  }
}

.category {
  margin-bottom: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.category:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.category-header {
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  color: #374151;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.category-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.category-header:hover::before {
  transform: scaleY(1);
}

.category-header:hover {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  padding-left: 1.5rem;
}

.category-header .badge {
  font-size: 0.7rem;
  padding: 0.3rem 0.7rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
}

.category-header:hover .badge {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.category-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background: white;
}

.category-content.open {
  max-height: 2000px;
  transition: max-height 0.5s ease-in;
}

.command-item {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  background: white;
}

.command-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.08) 0%, transparent 100%);
  transition: width 0.3s ease;
}

.command-item:last-child {
  border-bottom: none;
}

.command-item:hover {
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.05) 0%, white 100%);
  padding-left: 1.5rem;
}

.command-item:hover::before {
  width: 100%;
}

.command-item .title {
  font-weight: 500;
  color: #1f2937;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.command-item .title::before {
  content: '▶';
  font-size: 0.7rem;
  color: #667eea;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
}

.command-item:hover .title::before {
  opacity: 1;
  transform: translateX(0);
}

.command-item:hover .title {
  color: #667eea;
  font-weight: 600;
}

.command-item .add-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
}

.command-item .add-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.command-item .add-btn:hover::before {
  width: 300px;
  height: 300px;
}

.command-item .add-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.command-item .add-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.output-panel {
  background: #1e293b;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  color: #e5e7eb;
  min-height: 500px;
}

.output-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #334155;
  gap: 0.75rem;
}

.output-header h2 {
  margin: 0;
  color: #f9fafb;
  font-size: 1.5rem;
}

.output-actions-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.output-actions-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn-group {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-group-label {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 600;
  margin-right: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.output-actions {
  display: flex;
  gap: 0.5rem;
}

.btn {
  padding: 0.4rem 0.75rem;
  border: none;
  border-radius: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  white-space: nowrap;
}

.btn-group .btn {
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}

.btn-clear {
  background: #ef4444;
  color: white;
}

.btn-clear:hover {
  background: #dc2626;
}

.btn-copy {
  background: #10b981;
  color: white;
}

.btn-copy:hover {
  background: #059669;
}

.btn-download {
  background: #3b82f6;
  color: white;
}

.btn-download:hover {
  background: #2563eb;
}

.config-output {
  font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
  background: var(--output-bg);
  padding: 0;
  border-radius: 0.5rem;
  min-height: 400px;
  color: var(--output-text);
  line-height: 1.6;
  border: 1px solid #334155;
  overflow-x: auto;
  position: relative;
  transition: background 0.3s ease;
}

.config-output.editable {
  cursor: text;
}

.config-editor {
  width: 100%;
  min-height: 400px;
  font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
  background: var(--output-bg);
  color: var(--output-text);
  border: 2px solid #667eea;
  border-radius: 0.5rem;
  padding: 1rem;
  resize: vertical;
  line-height: 1.6;
}

.config-editor:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.edit-mode-notice {
  background: #667eea;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.btn-edit {
  background: #667eea;
  color: white;
}

.btn-edit:hover {
  background: #5568d3;
}

.btn-save {
  background: #10b981;
  color: white;
}

.btn-save:hover {
  background: #059669;
}

.btn-cancel-edit {
  background: #6b7280;
  color: white;
}

.btn-cancel-edit:hover {
  background: #4b5563;
}

.config-output:empty::before {
  content: "! No configuration selected yet.\n! Click 'Add' buttons on the left to build your configuration.\n! Variables will be highlighted for easy identification.\n\n! Example: Select 'VRF-Lite' → 'Create VRF Instance'";
  color: #64748b;
  font-style: italic;
  padding: 1rem;
  display: block;
}

.config-line {
  display: flex;
  padding: 0.2rem 0;
  border-left: 3px solid transparent;
}

.config-line:hover {
  background: #1e293b;
  border-left-color: #667eea;
}

.line-number {
  color: #475569;
  text-align: right;
  padding: 0 1rem;
  min-width: 60px;
  user-select: none;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.line-content {
  flex: 1;
  padding-right: 1rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Syntax Highlighting */
.comment { color: #64748b; font-style: italic; }
.keyword { color: #60a5fa; font-weight: 500; }
.keyword-primary { color: #3b82f6; font-weight: 600; }
.interface { color: #34d399; }
.ip-address { color: #fbbf24; }
.ipv6-address { color: #fb923c; }
.mac-address { color: #a3e635; }
.number { color: #f472b6; }
.vlan-number { color: #e879f9; font-weight: 500; }
.as-number { color: #fbbf24; font-weight: 500; }
.string { color: #a78bfa; }
.protocol { color: #22d3ee; font-weight: 500; }
.section-header { color: #94a3b8; background: #1e293b; font-weight: 600; }

/* History & Import/Export Buttons */
.btn-undo, .btn-redo {
  background: #8b5cf6;
  color: white;
  font-size: 1.1rem;
  min-width: 32px;
}

.btn-undo:hover, .btn-redo:hover {
  background: #7c3aed;
}

.btn-undo:disabled, .btn-redo:disabled {
  background: #6b7280;
  cursor: not-allowed;
  opacity: 0.5;
}

.btn-import {
  background: #3b82f6;
  color: white;
}

.btn-import:hover {
  background: #2563eb;
}

.btn-history {
  background: #f59e0b;
  color: white;
}

.btn-history:hover {
  background: #d97706;
}

/* Import Modal */
.import-textarea {
  width: 100%;
  min-height: 300px;
  font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  padding: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #f9fafb;
  resize: vertical;
}

.import-textarea:focus {
  outline: none;
  border-color: #667eea;
}

/* History Panel */
.history-panel {
  max-height: 400px;
  overflow-y: auto;
}

.history-item {
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: var(--template-card-bg);
  border: 1px solid var(--template-card-border);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.history-item:hover {
  border-color: #667eea;
  transform: translateX(4px);
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.history-item-time {
  font-size: 0.75rem;
  color: #6b7280;
}

.history-item-preview {
  font-size: 0.8rem;
  color: #4b5563;
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.history-item-actions button {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

.config-section {
  margin-bottom: 0.5rem;
}

.section-divider {
  border-top: 1px solid #334155;
  margin: 0.5rem 0;
}

.line-number-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.line-number-toggle input[type="checkbox"] {
  cursor: pointer;
}

/* Config Search Bar */
.config-search-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(102, 126, 234, 0.1);
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(102, 126, 234, 0.3);
  margin-bottom: 0.75rem;
}

.config-search-input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid #475569;
  border-radius: 0.4rem;
  background: #0f172a;
  color: #e5e7eb;
  font-size: 0.9rem;
}

.config-search-input:focus {
  outline: none;
  border-color: #667eea;
}

.search-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-case-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.6rem;
  background: #1e293b;
  border-radius: 0.4rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #94a3b8;
}

.search-case-toggle input:checked + span {
  color: #667eea;
  font-weight: 600;
}

.btn-search-nav {
  background: #667eea;
  color: white;
  border: none;
  padding: 0.35rem 0.6rem;
  border-radius: 0.4rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.btn-search-nav:hover {
  background: #5568d3;
}

.btn-search-nav:disabled {
  background: #6b7280;
  cursor: not-allowed;
  opacity: 0.5;
}

.search-match-count {
  font-size: 0.85rem;
  color: #94a3b8;
  min-width: 80px;
}

.btn-search-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.5rem;
}

.btn-search-close:hover {
  color: #ef4444;
}

.config-line.search-highlight {
  background: rgba(251, 191, 36, 0.2) !important;
  border-left-color: #fbbf24 !important;
}

.config-line.search-current {
  background: rgba(102, 126, 234, 0.3) !important;
  border-left-color: #667eea !important;
}

.btn-search, .btn-snippets {
  background: #667eea;
  color: white;
}

.btn-search:hover, .btn-snippets:hover {
  background: #5568d3;
}

/* Snippets */
.snippets-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #e5e7eb;
}

.snippet-tab {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.snippet-tab.active {
  color: #667eea;
  border-bottom-color: #667eea;
}

.snippet-tab:hover {
  color: #667eea;
}

.snippets-panel {
  max-height: 500px;
  overflow-y: auto;
}

.snippet-item {
  padding: 1rem;
  background: var(--template-card-bg);
  border: 1px solid var(--template-card-border);
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  transition: all 0.2s;
}

.snippet-item:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.snippet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.snippet-title {
  font-weight: 600;
  color: var(--modal-text);
  font-size: 1rem;
}

/* Bulk Operations & Visualization Tabs */
.bulk-tabs, .viz-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0;
}

.bulk-tab, .viz-tab {
  padding: 0.75rem 1.25rem;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.bulk-tab.active, .viz-tab.active {
  color: #667eea;
  border-bottom-color: #667eea;
  background: rgba(102, 126, 234, 0.05);
}

.bulk-tab:hover, .viz-tab:hover {
  color: #667eea;
  background: rgba(102, 126, 234, 0.05);
}

.bulk-panel, .viz-panel {
  animation: fadeIn 0.3s ease-in;
}

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

/* Canvas styling for topology */
#topologyCanvas {
  max-width: 100%;
  height: auto;
}

/* VLAN Map */
.vlan-card {
  display: inline-block;
  padding: 1rem;
  margin: 0.5rem;
  border-radius: 0.5rem;
  border: 2px solid #e5e7eb;
  background: white;
  min-width: 200px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.vlan-card h5 {
  margin: 0 0 0.5rem 0;
  color: #667eea;
  font-size: 1.1rem;
}

.vlan-interfaces {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 0.5rem;
}

/* Interface Dashboard */
.interface-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.interface-card {
  padding: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  background: white;
  transition: all 0.2s;
}

.interface-card:hover {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.interface-name {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.interface-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-up {
  background: #10b981;
}

.status-down {
  background: #ef4444;
}

.interface-details {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #6b7280;
}

/* QR Code Container */
#qrCode canvas {
  border-radius: 0.5rem;
}

body.dark-mode .bulk-tab,
body.dark-mode .viz-tab {
  color: #9ca3af;
}

body.dark-mode .bulk-tab.active,
body.dark-mode .viz-tab.active {
  color: #667eea;
  background: rgba(102, 126, 234, 0.15);
}

body.dark-mode .vlan-card,
body.dark-mode .interface-card {
  background: #1e293b;
  border-color: #475569;
  color: #e5e7eb;
}

body.dark-mode .interface-name {
  color: #f1f5f9;
}

body.dark-mode #topologyCanvas {
  background: #0f172a !important;
}

.snippet-description {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.snippet-preview {
  font-family: monospace;
  font-size: 0.8rem;
  color: #4b5563;
  background: #f9fafb;
  padding: 0.5rem;
  border-radius: 0.4rem;
  margin-bottom: 0.5rem;
  white-space: pre-wrap;
  max-height: 100px;
  overflow-y: auto;
}

.snippet-actions {
  display: flex;
  gap: 0.5rem;
}

.snippet-actions button {
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
}

/* Diff Tool */
.btn-diff {
  background: #8b5cf6;
  color: white;
}

.btn-diff:hover {
  background: #7c3aed;
}

.diff-select {
  width: 100%;
  padding: 0.5rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.4rem;
  font-size: 0.9rem;
  background: var(--panel-bg);
  color: var(--panel-text);
}

.diff-select:focus {
  outline: none;
  border-color: #667eea;
}

.diff-output {
  font-family: monospace;
  font-size: 0.85rem;
  line-height: 1.6;
}

.diff-line {
  padding: 0.25rem 0.5rem;
  border-left: 3px solid transparent;
}

.diff-line-added {
  background: rgba(16, 185, 129, 0.1);
  border-left-color: #10b981;
  color: #065f46;
}

.diff-line-removed {
  background: rgba(239, 68, 68, 0.1);
  border-left-color: #ef4444;
  color: #991b1b;
}

.diff-line-modified {
  background: rgba(251, 191, 36, 0.1);
  border-left-color: #fbbf24;
  color: #92400e;
}

.diff-line-unchanged {
  color: #6b7280;
}

.diff-section-header {
  background: #f3f4f6;
  padding: 0.5rem;
  font-weight: 600;
  color: #374151;
  margin-top: 1rem;
  border-radius: 0.4rem;
}

.diff-stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f9fafb;
  border-radius: 0.5rem;
}

.diff-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.diff-stat-label {
  font-size: 0.85rem;
  color: #6b7280;
}

.diff-stat-count {
  font-weight: 600;
  font-size: 1rem;
}

.diff-stat-added { color: #10b981; }
.diff-stat-removed { color: #ef4444; }
.diff-stat-modified { color: #f59e0b; }

/* Enhanced Validation */
.validation-summary {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 0.5rem;
}

.validation-stat {
  text-align: center;
  flex: 1;
}

.validation-stat-count {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.validation-stat-label {
  font-size: 0.85rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.validation-error .validation-stat-count { color: #ef4444; }
.validation-warning .validation-stat-count { color: #f59e0b; }
.validation-info .validation-stat-count { color: #3b82f6; }
.validation-success .validation-stat-count { color: #10b981; }

.validation-issue {
  padding: 1rem;
  margin-bottom: 0.75rem;
  border-left: 4px solid;
  border-radius: 0.5rem;
  background: white;
}

.validation-issue-error {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

.validation-issue-warning {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.05);
}

.validation-issue-info {
  border-left-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

.validation-issue-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.validation-issue-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.validation-issue-title {
  font-weight: 600;
  font-size: 1rem;
  color: #1f2937;
  flex: 1;
}

.validation-issue-line {
  font-size: 0.75rem;
  color: #6b7280;
  background: #f3f4f6;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-family: monospace;
}

.validation-issue-description {
  font-size: 0.9rem;
  color: #4b5563;
  margin-bottom: 0.5rem;
}

.validation-issue-suggestion {
  font-size: 0.85rem;
  color: #059669;
  background: rgba(16, 185, 129, 0.1);
  padding: 0.5rem;
  border-radius: 0.4rem;
  margin-top: 0.5rem;
}

.validation-issue-suggestion::before {
  content: "💡 ";
}

/* Keyboard Shortcuts Modal */
.btn-shortcuts {
  background: #8b5cf6;
  color: white;
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.shortcut-section h4 {
  color: #667eea;
  font-size: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e5e7eb;
}

.shortcut-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: #f9fafb;
  border-radius: 0.375rem;
  gap: 1rem;
}

.shortcut-item kbd {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
  font-size: 0.875rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  color: #374151;
}

.shortcut-item span:last-child {
  flex: 1;
  text-align: right;
  color: #6b7280;
  font-size: 0.875rem;
}

.shortcut-click {
  background: #667eea;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Auto-Recovery Banner */
.recovery-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 10000;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

.recovery-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.recovery-icon {
  font-size: 2rem;
}

.recovery-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.recovery-text strong {
  font-size: 1rem;
  font-weight: 600;
}

.recovery-text span {
  font-size: 0.875rem;
  opacity: 0.9;
}

.recovery-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-primary {
  background: white;
  color: #667eea;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.375rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

.btn-primary:hover {
  transform: scale(1.05);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 0.375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
}

.export-options {
  position: relative;
  display: inline-block;
}

.export-dropdown {
  display: none;
  position: absolute;
  bottom: 100%;
  right: 0;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  margin-bottom: 0.5rem;
  min-width: 200px;
  z-index: 100;
}

.export-dropdown.show {
  display: block;
}

.export-option {
  padding: 0.75rem 1rem;
  cursor: pointer;
  color: #1f2937;
  border-bottom: 1px solid #e5e7eb;
  transition: background 0.2s;
}

.export-option:last-child {
  border-bottom: none;
}

.export-option:hover {
  background: #f3f4f6;
}

.export-option:first-child {
  border-radius: 0.5rem 0.5rem 0 0;
}

.export-option:last-child {
  border-radius: 0 0 0.5rem 0.5rem;
}

.btn-template {
  background: #8b5cf6;
  color: white;
}

.btn-template:hover {
  background: #7c3aed;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.template-card {
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.template-card:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.template-card h4 {
  margin: 0 0 0.5rem 0;
  color: #667eea;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.template-card p {
  margin: 0 0 0.75rem 0;
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.5;
}

.template-includes {
  font-size: 0.85rem;
  color: #9ca3af;
}

.template-includes strong {
  color: #4b5563;
  display: block;
  margin-bottom: 0.25rem;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.open {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  color: #1f2937;
  position: relative;
  z-index: 1001;
  pointer-events: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e5e7eb;
}

.modal-header h3 {
  margin: 0;
  color: #667eea;
  font-size: 1.3rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
  pointer-events: auto;
}

.modal-footer .btn {
  pointer-events: auto;
  position: relative;
  z-index: 1002;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6b7280;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.close-btn:hover {
  background: #f3f4f6;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #374151;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
}

.form-group textarea {
  font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, monospace;
  min-height: 100px;
  resize: vertical;
}

.form-group .help-text {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

/* Validation Message Styles */
.validation-message {
  font-size: 0.85rem;
  margin-top: 0.25rem;
  font-weight: 500;
  animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-2px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Input validation states */
.form-group input.valid,
.form-group textarea.valid,
.form-group select.valid {
  border-color: #10b981;
}

.form-group input.invalid,
.form-group textarea.invalid,
.form-group select.invalid {
  border-color: #ef4444;
}

.form-group input.warning,
.form-group textarea.warning,
.form-group select.warning {
  border-color: #fbbf24;
}

body.dark-mode .form-group label {
  color: #e5e7eb;
}

body.dark-mode .form-group input,
body.dark-mode .form-group textarea,
body.dark-mode .form-group select {
  background: #1e293b;
  border-color: #475569;
  color: #e5e7eb;
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group textarea:focus,
body.dark-mode .form-group select:focus {
  border-color: #667eea;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5568d3;
}

.btn-secondary {
  background: #e5e7eb;
  color: #374151;
}

.btn-secondary:hover {
  background: #d1d5db;
}

.variable-tag {
  background: #fef3c7;
  color: #92400e;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  font-weight: 600;
  font-size: 0.85em;
}

.footer {
  text-align: center;
  padding: 2rem;
  color: white;
  opacity: 0.8;
}

.notification {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: #10b981;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  z-index: 2000;
  animation: slideIn 0.3s ease-out;
  display: none;
}

.notification.show {
  display: block;
}

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

.cheatsheet-link {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  text-decoration: none;
  margin-top: 1rem;
  transition: background 0.2s;
  font-weight: 500;
}

.cheatsheet-link:hover {
  background: rgba(255,255,255,0.3);
}

/* ====================================== */
/* Configuration Linter Styles */
/* ====================================== */

.lint-summary {
  padding: 1.5rem;
  border-radius: 0.75rem;
  margin-bottom: 2rem;
  border-left: 4px solid;
}

.lint-summary h3 {
  margin: 0 0 1rem 0;
  font-size: 1.5rem;
}

.lint-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.stat-item {
  background: rgba(0, 0, 0, 0.2);
  padding: 0.75rem;
  border-radius: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-label {
  font-weight: 600;
  color: #9ca3af;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.severity-badge {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 1.1rem;
  margin-top: 1rem;
}

/* Severity colors */
.lint-critical {
  background: rgba(239, 68, 68, 0.15);
  border-left-color: #ef4444;
}

.lint-high {
  background: rgba(249, 115, 22, 0.15);
  border-left-color: #f97316;
}

.lint-medium {
  background: rgba(234, 179, 8, 0.15);
  border-left-color: #eab308;
}

.lint-low {
  background: rgba(34, 197, 94, 0.15);
  border-left-color: #22c55e;
}

.lint-good {
  background: rgba(34, 197, 94, 0.15);
  border-left-color: #22c55e;
}

.severity-critical {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.severity-high {
  background: rgba(249, 115, 22, 0.2);
  color: #fdba74;
}

.severity-medium {
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
}

.severity-low {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.severity-good {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.lint-section {
  margin-bottom: 2rem;
}

.lint-section h4 {
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
  color: #e5e7eb;
}

.lint-item {
  background: rgba(255, 255, 255, 0.05);
  border-left: 4px solid;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.lint-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.lint-issue {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.lint-warning {
  border-left-color: #eab308;
  background: rgba(234, 179, 8, 0.1);
}

.lint-suggestion {
  border-left-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.lint-header {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #e5e7eb;
}

.lint-message {
  color: #d1d5db;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.lint-code {
  display: block;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.75rem;
  border-radius: 0.375rem;
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', 'Consolas', monospace;
  font-size: 0.875rem;
  color: #a5b4fc;
  overflow-x: auto;
  margin-top: 0.5rem;
}

.lint-success {
  text-align: center;
  padding: 3rem;
  background: rgba(34, 197, 94, 0.15);
  border-radius: 0.75rem;
  border: 2px solid rgba(34, 197, 94, 0.3);
}

.lint-success h3 {
  color: #86efac;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.lint-success p {
  color: #d1d5db;
  font-size: 1.1rem;
}

/* Dark mode adjustments for linter */
body.dark-mode .stat-label {
  color: #d1d5db;
}

body.dark-mode .lint-header {
  color: #f3f4f6;
}

body.dark-mode .lint-message {
  color: #e5e7eb;
}

body.dark-mode .lint-code {
  background: rgba(0, 0, 0, 0.5);
}

/* ====================================== */
/* Enhanced Network Visualization Styles */
/* ====================================== */

.stat-card {
  background: rgba(102, 126, 234, 0.1);
  border: 2px solid rgba(102, 126, 234, 0.3);
  border-radius: 0.5rem;
  padding: 1rem;
  text-align: center;
  transition: all 0.2s;
}

.stat-card:hover {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.2);
  transform: translateY(-2px);
}

.stat-label {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #e5e7eb;
}

.vlan-card-enhanced {
  background: rgba(30, 41, 59, 0.8);
  border: 2px solid #334155;
  border-radius: 0.5rem;
  padding: 1rem;
  transition: all 0.3s;
}

.vlan-card-enhanced:hover {
  border-color: #667eea;
  background: rgba(30, 41, 59, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.interface-grid-enhanced {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.interface-card-enhanced {
  background: rgba(30, 41, 59, 0.8);
  border: 2px solid #334155;
  border-radius: 0.5rem;
  padding: 1rem;
  transition: all 0.3s;
}

.interface-card-enhanced:hover {
  border-color: #667eea;
  background: rgba(30, 41, 59, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Canvas helper */
#topologyCanvas {
  cursor: crosshair;
}

/* Visualization tabs */
.viz-tab {
  transition: all 0.2s;
  opacity: 0.7;
}

.viz-tab.active {
  opacity: 1;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.viz-tab:hover {
  opacity: 1;
  transform: translateY(-1px);
}

/* Light mode adjustments for visualizations */
body:not(.dark-mode) .vlan-card-enhanced {
  background: #ffffff;
  border-color: #e5e7eb;
  color: #1f2937;
}

body:not(.dark-mode) .interface-card-enhanced {
  background: #ffffff;
  border-color: #e5e7eb;
  color: #1f2937;
}

body:not(.dark-mode) .stat-card {
  background: rgba(102, 126, 234, 0.05);
}

body:not(.dark-mode) .stat-value {
  color: #1f2937;
}

body:not(.dark-mode) .vlan-card-enhanced:hover,
body:not(.dark-mode) .interface-card-enhanced:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* ====================================== */
/* Multi-Device Manager Styles */
/* ====================================== */

.device-list-item {
  transition: all 0.2s;
}

.device-list-item:hover {
  border-color: #667eea !important;
  background: rgba(102, 126, 234, 0.15) !important;
  transform: translateX(2px);
}

.btn-small {
  font-size: 13px;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
}

.btn-small:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  opacity: 0.9;
}

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

/* Dark mode adjustments for device manager */
body.dark-mode .device-list-item {
  background: rgba(102, 126, 234, 0.15) !important;
  border-color: rgba(102, 126, 234, 0.4) !important;
}

body.dark-mode .device-list-item:hover {
  background: rgba(102, 126, 234, 0.25) !important;
  border-color: #667eea !important;
}

/* Device manager modal specific styles */
#deviceManagerModal .modal-body {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 0.5rem;
  padding: 1rem;
}

body:not(.dark-mode) #deviceManagerModal .modal-body {
  background: rgba(241, 245, 249, 0.5);
}

/* ====================================== */
/* Interactive Controls Styles */
/* ====================================== */

.stat-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(102, 126, 234, 0.15);
  border: 2px solid rgba(102, 126, 234, 0.3);
  border-radius: 0.5rem;
  font-size: 14px;
  font-weight: 600;
  color: #667eea;
  transition: all 0.2s;
}

.stat-badge:hover {
  background: rgba(102, 126, 234, 0.25);
  border-color: #667eea;
  transform: translateY(-1px);
}

/* Device Config Editor */
#deviceConfigTextarea {
  width: 100%;
  min-height: 400px;
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', 'Consolas', monospace;
  font-size: 13px;
  padding: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #1e293b;
  color: #e5e7eb;
  line-height: 1.6;
  resize: vertical;
}

#deviceConfigTextarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Light mode editor */
body:not(.dark-mode) #deviceConfigTextarea {
  background: #ffffff;
  color: #1f2937;
  border-color: #d1d5db;
}

body:not(.dark-mode) #deviceConfigTextarea:focus {
  border-color: #667eea;
}

/* Context menu */
#deviceContextMenu {
  animation: slideInMenu 0.2s ease-out;
}

@keyframes slideInMenu {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dark mode context menu */
body.dark-mode #deviceContextMenu {
  background: #1e293b;
  color: #e5e7eb;
  border-color: #667eea;
}

body.dark-mode #deviceContextMenu div {
  color: #e5e7eb;
}

/* Canvas cursor states */
#topologyCanvas.grabbing {
  cursor: grabbing !important;
}

#topologyCanvas.grab {
  cursor: grab !important;
}

/* ============================================
   AI ASSISTANT PANEL
   ============================================ */

.ai-assistant-panel {
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  width: 400px;
  max-height: 600px;
  background: var(--panel-bg);
  border-radius: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  display: none;
  flex-direction: column;
  z-index: 1000;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(102, 126, 234, 0.3);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
}

.ai-assistant-panel.open {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* AI Bot Floating Button */
.ai-bot-button {
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  border: none;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  cursor: pointer;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  transition: all 0.3s ease;
  color: white;
}

.ai-bot-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

.ai-bot-button:active {
  transform: scale(0.95);
}

.ai-bot-button.hidden {
  display: none;
}

.ai-assistant-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 1rem;
  border-radius: 1rem 1rem 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 10;
}

.ai-header-content h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.ai-status {
  font-size: 0.75rem;
  opacity: 0.9;
  display: block;
  margin-top: 0.25rem;
}

.ai-toggle-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 1.25rem;
  transition: all 0.3s ease;
  position: relative;
  z-index: 11;
}

.ai-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.ai-assistant-content {
  display: flex;
  flex-direction: column;
  height: 500px;
  overflow: hidden;
}

.ai-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  padding: 1rem;
  border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

.ai-quick-btn {
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 0.5rem;
  padding: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--panel-text);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ai-quick-btn:hover {
  background: rgba(102, 126, 234, 0.2);
  border-color: rgba(102, 126, 234, 0.5);
  transform: translateY(-2px);
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-behavior: smooth;
}

.ai-chat-messages::-webkit-scrollbar {
  width: 8px;
}

.ai-chat-messages::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.3);
  border-radius: 4px;
}

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 126, 234, 0.5);
}

.ai-message {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  animation: slideIn 0.3s ease;
}

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

.ai-message-user .ai-message-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  align-self: flex-end;
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 1rem 1rem 0 1rem;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.ai-message-assistant .ai-message-content {
  background: var(--template-card-bg);
  color: var(--panel-text);
  align-self: flex-start;
  max-width: 90%;
  padding: 0.75rem 1rem;
  border-radius: 1rem 1rem 1rem 0;
  border: 1px solid var(--template-card-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ai-message-content ul {
  margin: 0.5rem 0 0 0;
  padding-left: 1.5rem;
}

.ai-message-content li {
  margin: 0.25rem 0;
}

.ai-message-content em {
  color: #667eea;
  font-style: normal;
  font-weight: 500;
}

body.dark-mode .ai-message-content em {
  color: #a5b4fc;
}

.ai-message-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.ai-action-btn {
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 0.375rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--panel-text);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ai-action-btn:hover {
  background: rgba(102, 126, 234, 0.2);
  border-color: rgba(102, 126, 234, 0.5);
}

.ai-input-container {
  padding: 1rem;
  border-top: 1px solid rgba(102, 126, 234, 0.2);
  display: flex;
  gap: 0.5rem;
  background: var(--panel-bg);
}

.ai-input {
  flex: 1;
  border: 2px solid rgba(102, 126, 234, 0.3);
  border-radius: 0.5rem;
  padding: 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--search-bg);
  color: var(--panel-text);
  resize: none;
  transition: all 0.2s ease;
}

.ai-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ai-send-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  color: white;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ai-send-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

.ai-suggestions {
  padding: 0 1rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
}

.ai-suggestion-item {
  background: var(--template-card-bg);
  border: 1px solid var(--template-card-border);
  border-radius: 0.5rem;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-suggestion-item:hover {
  background: rgba(102, 126, 234, 0.1);
  border-color: #667eea;
  transform: translateX(4px);
}

.ai-suggestion-title {
  font-weight: 600;
  color: var(--panel-text);
  margin-bottom: 0.25rem;
}

.ai-suggestion-description {
  font-size: 0.75rem;
  color: var(--panel-text);
  opacity: 0.7;
}

.ai-thinking {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem;
}

.ai-thinking-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #667eea;
  animation: thinking 1.4s infinite;
}

.ai-thinking-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.ai-thinking-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes thinking {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  30% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.ai-command-card {
  background: var(--template-card-bg);
  border: 1px solid var(--template-card-border);
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin: 0.5rem 0;
}

.ai-command-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.ai-command-name {
  font-weight: 600;
  color: #667eea;
}

.ai-command-vendor {
  font-size: 0.75rem;
  color: var(--panel-text);
  opacity: 0.7;
}

.ai-command-template {
  background: var(--output-bg);
  color: var(--output-text);
  padding: 0.5rem;
  border-radius: 0.375rem;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  overflow-x: auto;
  margin: 0.5rem 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .ai-assistant-panel {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    top: auto;
    bottom: 0;
    transform: none;
    max-height: 60vh;
  }

  .ai-assistant-panel.collapsed {
    transform: translateY(calc(100% - 60px));
  }

  .ai-assistant-header {
    border-radius: 0;
  }

  .ai-quick-actions {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============================================
   STREAMING RESPONSES (PHASE 3)
   ============================================ */

.ai-streaming {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.95;
  }
}

.streaming-cursor {
  display: inline-block;
  margin-left: 2px;
  animation: blink 0.8s step-end infinite;
  color: #667eea;
  font-weight: bold;
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

.ai-streaming .ai-message-content {
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ====================================== */
/* CLI Terminal Enhancements */
/* ====================================== */

/* Blinking cursor for CLI input */
#cliInput {
  caret-shape: block;
  animation: blink-cursor 1s step-end infinite;
}

#cliInput:disabled {
  animation: none;
  opacity: 0.5;
}

@keyframes blink-cursor {
  0%, 50% {
    caret-color: #10b981;
  }
  51%, 100% {
    caret-color: transparent;
  }
}

/* Smooth scrolling for CLI output */
#cliOutput {
  scroll-behavior: smooth;
}

/* Make CLI output lines look authentic */
#cliOutput div {
  font-family: 'Courier New', 'Courier', monospace;
  letter-spacing: 0.5px;
}
