/* TechToolsHive Redirect Chain Visualizer
   Location: app/static/css/tools/sso/redirect-chain-visualizer.css
   Purpose: Redirect Chain Visualizer specific styles
*/

/* Import shared components */
@import '../../core/variables.css';
@import '../../core/base.css';
@import '../../core/themes.css';
@import '../../components/buttons.css';
@import '../../components/forms.css';
@import '../../components/cards.css';
@import '../../components/tables.css';
@import '../../components/modals.css';
@import '../../components/alerts.css';
@import '../sso/components/flow-diagrams.css';
@import '../sso/components/security.css';
@import '../sso/components/upload.css';

/* ===== INPUT STYLING ===== */
#redirectInput {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.95rem;
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
  background: var(--input-bg);
  color: var(--text-color);
}

#redirectInput:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* ===== CHAIN SUMMARY ===== */
.chain-summary {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1rem;
}

.summary-item {
  text-align: center;
  padding: 0.5rem;
}

.summary-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0.25rem;
}

.redirect-arrow.error {
  stroke: #dc3545;
  stroke-width: 2;
}

.redirect-arrow.loop {
  stroke: #fd7e14;
  stroke-width: 2;
  stroke-dasharray: 5,5;
}

/* Step Numbers */
.step-number {
  fill: #fff;
  stroke: #dee2e6;
  stroke-width: 1;
  rx: 12;
  ry: 12;
  transition: all 0.3s ease;
}

.step-number.active {
  fill: #007bff;
  stroke: #0056b3;
  filter: drop-shadow(0 2px 4px rgba(0, 123, 255, 0.3));
}

.step-number.completed {
  fill: #28a745;
  stroke: #1e7e34;
}

.step-number.error {
  fill: #dc3545;
  stroke: #c82333;
}

.step-number-text {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 10px;
  font-weight: 600;
  text-anchor: middle;
  fill: #495057;
  pointer-events: none;
}

.step-number.active .step-number-text,
.step-number.completed .step-number-text,
.step-number.error .step-number-text {
  fill: #fff;
}

/* Timeline Chart */
#timelineChart {
  min-height: 300px;
  background: #fff;
  border-radius: 8px;
  padding: 1rem;
}

.timeline-bar {
  height: 30px;
  margin-bottom: 8px;
  border-radius: 4px;
  background: #e9ecef;
  position: relative;
  overflow: hidden;
}

.timeline-bar .timing {
  height: 100%;
  background: linear-gradient(90deg, #007bff 0%, #0056b3 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
  position: relative;
}

.timeline-bar .label {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  font-weight: 500;
  color: #495057;
  z-index: 1;
}

.timeline-bar .duration {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: #6c757d;
  z-index: 1;
}

/* Security Analysis */
.security-issue {
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: 6px;
  border-left: 4px solid;
  background: #fff;
  transition: all 0.3s ease;
}

.security-issue:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.security-issue.critical {
  border-left-color: #dc3545;
  background: #f8d7da;
}

.security-issue.warning {
  border-left-color: #fd7e14;
  background: #fff3cd;
}

.security-issue.info {
  border-left-color: #17a2b8;
  background: #d1ecf1;
}

.security-issue.success {
  border-left-color: #28a745;
  background: #d4edda;
}

.security-issue .issue-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.security-issue .issue-description {
  font-size: 0.9rem;
  color: #6c757d;
}

/* Security Headers */
.security-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  margin-bottom: 0.25rem;
  border-radius: 4px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
}

.security-header .header-name {
  font-weight: 500;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.85rem;
}

.security-header .header-value {
  font-size: 0.8rem;
  color: #6c757d;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.security-header.present {
  background: #d4edda;
  border-color: #c3e6cb;
}

.security-header.missing {
  background: #f8d7da;
  border-color: #f5c6cb;
}

/* Request Details */
.request-detail {
  border: 1px solid #e9ecef;
  border-radius: 6px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.request-detail .request-header {
  background: #f8f9fa;
  padding: 0.75rem;
  border-bottom: 1px solid #e9ecef;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.request-detail .request-method {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.request-detail .request-method.get { background: #d4edda; color: #155724; }
.request-detail .request-method.post { background: #d1ecf1; color: #0c5460; }
.request-detail .request-method.put { background: #fff3cd; color: #856404; }
.request-detail .request-method.delete { background: #f8d7da; color: #721c24; }

.request-detail .request-url {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.85rem;
  color: #495057;
}

.request-detail .request-body {
  padding: 1rem;
  background: #fff;
}

.request-detail .request-status {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.request-detail .request-status.success { background: #d4edda; color: #155724; }
.request-detail .request-status.redirect { background: #fff3cd; color: #856404; }
.request-detail .request-status.error { background: #f8d7da; color: #721c24; }

/* Responsive Design */
@media (max-width: 768px) {
  .har-drop-area {
    padding: 1rem;
    min-height: 100px;
  }
  
  .chain-diagram-container {
    min-height: 300px;
    padding: 1rem;
  }
  
  .summary-item {
    margin-bottom: 1rem;
  }
  
  .summary-value {
    font-size: 1.2rem;
  }
  
  .security-header .header-value {
    max-width: 120px;
  }
}

/* Fullscreen Mode */
.chain-diagram-container.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: #fff;
  border-radius: 0;
  padding: 2rem;
}

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

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Tooltips */
.tooltip {
  position: absolute;
  background: #333;
  color: #fff;
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tooltip.show {
  opacity: 1;
}

/* Utility Classes */
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cursor-pointer {
  cursor: pointer;
}

.transition-all {
  transition: all 0.3s ease;
}

/* Error States */
.error-message {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
  padding: 0.75rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.success-message {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
  padding: 0.75rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

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

.slide-in {
  animation: slideIn 0.3s ease-out;
}

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