/* Connection Visualizer Styles */
.connection-visualizer {
  position: relative;
  width: 100%;
  height: 100%;
}

/* SVG Connections Overlay */
.connections-overlay {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10;
}

/* Connection Line Styles */
.connection-line {
  cursor: pointer;
  pointer-events: all;
}

.connection-path {
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.connection-line:hover .connection-path {
  stroke-width: 4 !important;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

/* Connection Labels */
.connection-label {
  font-size: 10px;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.connection-line:hover .connection-label {
  opacity: 1;
}

/* Connection Endpoints */
.connection-endpoint {
  transition: all 0.3s ease;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.connection-line:hover .connection-endpoint {
  r: 6;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Cable Type Specific Styles */
.connection-line.fiber .connection-path {
  stroke-dasharray: 5,5;
  stroke-width: 3;
  animation: fiber-pulse 2s infinite;
}

.connection-line.serial .connection-path {
  stroke-dasharray: 2,2;
  stroke-width: 2;
}

.connection-line.ethernet .connection-path {
  stroke-width: 2;
}

/* Fiber optic animation */
@keyframes fiber-pulse {
  0%, 100% { 
    stroke-dashoffset: 0;
    opacity: 1;
  }
  50% { 
    stroke-dashoffset: 10;
    opacity: 0.8;
  }
}

/* Connection Manager Styles */
.connection-manager {
  margin-top: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  overflow: hidden;
}

.connection-manager .card-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom: none;
}

.connection-manager .card-title {
  margin: 0;
  font-weight: 600;
  display: flex;
  align-items: center;
}

/* Table Enhancements */
.connection-manager .table {
  margin-bottom: 0;
  border-radius: 0;
}

.connection-manager .table thead th {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  color: #495057;
}

.connection-manager .table tbody tr:hover {
  background-color: rgba(102,126,234,0.05);
  transform: translateX(2px);
  transition: all 0.2s ease;
}

/* Badge Enhancements */
.connection-manager .badge {
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Button Enhancements */
.connection-manager .btn {
  transition: all 0.2s ease;
  border-radius: 6px;
}

.connection-manager .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Alert Enhancements */
.connection-manager .alert {
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
  color: #0c5460;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Modal Enhancements */
.modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom: none;
  border-radius: 0.375rem 0.375rem 0 0;
}

.modal-header .close {
  color: white;
  opacity: 0.8;
  text-shadow: none;
}

.modal-header .close:hover {
  opacity: 1;
  color: white;
}

.modal-title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Connection Details Cards */
.modal-body .card {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.modal-body .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.modal-body .card-header {
  border-radius: 8px 8px 0 0;
  font-weight: 600;
}

.modal-body .card-header h6 {
  margin: 0;
  font-size: 0.9rem;
}

/* Form Enhancements */
.form-control:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102,126,234,0.25);
}

.form-control {
  border-radius: 6px;
  transition: all 0.2s ease;
}

.form-label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 6px;
}

/* Color Picker Enhancement */
input[type="color"] {
  width: 50px;
  height: 38px;
  border-radius: 6px;
  border: 1px solid #ced4da;
  cursor: pointer;
  transition: all 0.2s ease;
}

input[type="color"]:hover {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102,126,234,0.25);
}

/* Connection Status Indicators */
.connection-status-active {
  color: #28a745;
  animation: status-pulse 2s infinite;
}

.connection-status-inactive {
  color: #6c757d;
}

.connection-status-error {
  color: #dc3545;
  animation: status-blink 1s infinite;
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

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

/* Loading States */
.connection-loading {
  position: relative;
  opacity: 0.6;
  pointer-events: none;
}

.connection-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Success Animation */
.connection-success {
  animation: success-flash 1s ease;
}

@keyframes success-flash {
  0%, 100% { background-color: inherit; }
  50% { background-color: rgba(40, 167, 69, 0.1); }
}

/* Error Animation */
.connection-error {
  animation: error-flash 1s ease;
}

@keyframes error-flash {
  0%, 100% { background-color: inherit; }
  50% { background-color: rgba(220, 53, 69, 0.1); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .connection-manager .table {
    font-size: 0.8rem;
  }
  
  .connection-manager .badge {
    font-size: 0.7rem;
    padding: 4px 6px;
  }
  
  .connection-label {
    font-size: 8px;
  }
  
  .modal-body .card {
    margin-bottom: 15px;
  }
  
  .connection-endpoint {
    r: 3;
  }
  
  .connection-line:hover .connection-endpoint {
    r: 5;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .connection-path {
    stroke-width: 3 !important;
  }
  
  .connection-endpoint {
    r: 5;
    stroke: #000;
    stroke-width: 1;
  }
  
  .connection-label {
    text-shadow: 2px 2px 4px rgba(255,255,255,1);
    font-weight: 700;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .connection-path,
  .connection-endpoint,
  .connection-label,
  .connection-manager .table tbody tr,
  .connection-manager .btn,
  .modal-body .card {
    transition: none;
  }
  
  .fiber-pulse,
  .status-pulse,
  .status-blink {
    animation: none;
  }
}

/* Print Styles */
@media print {
  .connection-manager .btn,
  .modal {
    display: none !important;
  }
  
  .connection-path {
    stroke: #000 !important;
    stroke-width: 2 !important;
  }
  
  .connection-endpoint {
    fill: #000 !important;
  }
  
  .connection-label {
    fill: #000 !important;
    opacity: 1 !important;
  }
}

/* Dark Mode Support - DISABLED */
/*
@media (prefers-color-scheme: dark) {
  .connection-manager {
    background-color: #2c3e50;
    color: #ecf0f1;
  }
  
  .connection-manager .table {
    background-color: #34495e;
    color: #ecf0f1;
  }
  
  .connection-manager .table thead th {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    color: #ecf0f1;
    border-color: #495057;
  }
  
  .connection-manager .table tbody tr:hover {
    background-color: rgba(52, 73, 94, 0.3);
  }
  
  .connection-label {
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  }
  
  .modal-content {
    background-color: #2c3e50;
    color: #ecf0f1;
  }
  
  .form-control {
    background-color: #34495e;
    border-color: #495057;
    color: #ecf0f1;
  }
  
  .form-control:focus {
    background-color: #34495e;
    border-color: #667eea;
    color: #ecf0f1;
  }
} 
*/

/* Force light mode - Override any dark mode styles */
@media (prefers-color-scheme: dark) {
  .connection-manager {
    background-color: #ffffff !important;
    color: #333 !important;
  }
  
  .connection-manager .table {
    background-color: #ffffff !important;
    color: #333 !important;
  }
  
  .connection-manager .table thead th {
    background: #f8f9fa !important;
    color: #333 !important;
    border-color: #dee2e6 !important;
  }
  
  .connection-manager .table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
  }
  
  .connection-label {
    text-shadow: none !important;
    color: #333 !important;
  }
  
  .modal-content {
    background-color: #ffffff !important;
    color: #333 !important;
  }
  
  .form-control {
    background-color: #ffffff !important;
    border-color: #ced4da !important;
    color: #333 !important;
  }
  
  .form-control:focus {
    background-color: #ffffff !important;
    border-color: #667eea !important;
    color: #333 !important;
  }
} 