/* TechToolsHive OAuth Flow Visualizer
   Location: app/static/css/tools/sso/oauth-flow-visualizer.css
   Purpose: OAuth/OIDC Flow 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';

/* ===== FLOW SELECTION TABS ===== */
.flow-selection-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.flow-tab {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  text-decoration: none;
}

.flow-tab:hover {
  border-color: var(--primary-color);
  background: rgba(102, 126, 234, 0.1);
  color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.flow-tab.active {
  border-color: var(--primary-color);
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.flow-tab .badge {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
}

/* Configuration Panel */
.config-group {
  margin-bottom: 1rem;
}

.config-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #495057;
  margin-bottom: 0.25rem;
}

.config-group input,
.config-group select,
.config-group textarea {
  border: 2px solid #dee2e6;
  border-radius: 6px;
  padding: 0.5rem;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.config-group input:focus,
.config-group select:focus,
.config-group textarea:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.config-group .form-text {
  font-size: 0.8rem;
  color: #6c757d;
  margin-top: 0.25rem;
}

.imported-value {
  background: #e6f7ff !important;
  border-color: #00b8ff !important;
}
.generated-value {
  background: #f6ffe6 !important;
  border-color: #7ed957 !important;
}
.user-modified-value {
  background: #fffbe6 !important;
  border-color: #ffd700 !important;
}

/* ===== SECURITY ANALYSIS ===== */
/* Security items are now imported from ../sso/components/security.css */

/* Step Details */
.step-detail {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  transition: all 0.3s ease;
}

.step-detail:hover {
  border-color: #007bff;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.1);
}

.step-detail.active {
  border-color: #007bff;
  background: #e3f2fd;
}

.step-title {
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.5rem;
}

.step-description {
  color: #6c757d;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.step-parameters {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 0.75rem;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: #495057;
}

/* Code Examples */
.code-block {
  background: #2d3748;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
  position: relative;
}

.code-block pre {
  color: #e2e8f0;
  margin: 0;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
}

.code-block .language-label {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: #4a5568;
  color: #e2e8f0;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* ===== HTTP REQUESTS ===== */
/* HTTP request styles are now imported from ../sso/components/security.css */

/* Flow Comparison */
.comparison-table-container {
  overflow-x: auto;
  margin-bottom: 1rem;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.comparison-table th,
.comparison-table td {
  padding: 0.75rem;
  text-align: left;
  border: 1px solid #dee2e6;
  vertical-align: top;
}

.comparison-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
}

.comparison-table tr:nth-child(even) {
  background-color: #f8f9fa;
}

.comparison-table .feature-cell {
  font-weight: 600;
  background-color: #e9ecef;
}

.comparison-table .security-high {
  background-color: #d4edda;
  color: #155724;
}

.comparison-table .security-medium {
  background-color: #fff3cd;
  color: #856404;
}

.comparison-table .security-low {
  background-color: #f8d7da;
  color: #721c24;
}

.comparison-table .recommended {
  background-color: #d1ecf1;
  color: #0c5460;
  font-weight: 600;
}

.comparison-table .deprecated {
  background-color: #f8d7da;
  color: #721c24;
  text-decoration: line-through;
}

.comparison-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 0.375rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.legend-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-block;
}

.legend-icon.high {
  background-color: #28a745;
}

.legend-icon.medium {
  background-color: #ffc107;
}

.legend-icon.low {
  background-color: #dc3545;
}

.legend-icon.recommended {
  background-color: #17a2b8;
  color: white;
  text-align: center;
  line-height: 16px;
  font-size: 10px;
}

.legend-icon.deprecated {
  background-color: #dc3545;
  color: white;
  text-align: center;
  line-height: 16px;
  font-size: 10px;
}

/* Export Sections */
.export-section {
  padding: 1.5rem;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  background-color: #f8f9fa;
}

.export-section h4 {
  color: #495057;
  margin-bottom: 0.5rem;
}

.export-section p {
  color: #6c757d;
  margin-bottom: 1rem;
}

.api-endpoints {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.api-endpoint {
  padding: 1rem;
  background-color: white;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
}

.api-endpoint strong {
  color: #495057;
  display: block;
  margin-bottom: 0.25rem;
}

.api-endpoint p {
  color: #6c757d;
  margin-bottom: 0.5rem;
}

.api-endpoint code {
  background-color: #e9ecef;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  color: #495057;
}

/* Tutorial Overlay */
.tutorial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutorial-content {
  background-color: white;
  border-radius: 0.5rem;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

.tutorial-header h3 {
  margin: 0;
  color: #495057;
}

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

.tutorial-close:hover {
  background-color: #f8f9fa;
  color: #495057;
}

.tutorial-body {
  padding: 1.5rem;
  line-height: 1.6;
}

.tutorial-body h4 {
  color: #495057;
  margin-bottom: 1rem;
}

.tutorial-body p {
  color: #6c757d;
  margin-bottom: 1rem;
}

.tutorial-body ul {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.tutorial-body li {
  color: #6c757d;
  margin-bottom: 0.5rem;
}

.tutorial-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-top: 1px solid #dee2e6;
  background-color: #f8f9fa;
}

.tutorial-footer button {
  min-width: 80px;
}

#tutorial-progress {
  color: #6c757d;
  font-size: 0.875rem;
}

#tutorial-skip {
  color: #6c757d;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
}

#tutorial-skip:hover {
  color: #495057;
  text-decoration: underline;
}

/* Tutorial Start Button */
.tutorial-start-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 50px;
  padding: 1rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tutorial-start-btn:hover {
  background-color: #0056b3;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
}

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

.tutorial-start-btn i {
  font-size: 1rem;
}

/* Tutorial Highlight */
.tutorial-highlight {
  box-shadow: 0 0 0 4px #ffd700, 0 0 16px 8px #ffd70066;
  z-index: 1051 !important;
  position: relative;
  animation: tutorial-pulse 1s infinite alternate;
}

@keyframes tutorial-pulse {
  0% { box-shadow: 0 0 0 4px #ffd700, 0 0 16px 8px #ffd70066; }
  100% { box-shadow: 0 0 0 8px #ffe066, 0 0 32px 16px #ffd70099; }
}

.tutorial-pulse {
  animation: tutorial-pulse 1s infinite alternate;
}

.tutorial-tooltip {
  background: #fffbe6;
  border: 1px solid #ffd700;
  color: #333;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  box-shadow: 0 2px 8px #ffd70033;
  margin-bottom: 8px;
  text-align: center;
  z-index: 2000;
}

#tutorial-overlay {
  pointer-events: auto;
}

.tutorial-highlight, .tutorial-pulse {
  pointer-events: auto !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .flow-selection-tabs {
    flex-direction: column;
  }
  
  .flow-tab {
    width: 100%;
    justify-content: center;
  }
  
  .flow-diagram-container {
    min-height: 300px;
  }
  
  .col-lg-8,
  .col-lg-4 {
    margin-bottom: 1rem;
  }
  
  .comparison-table {
    font-size: 0.8rem;
  }
  
  .comparison-table th,
  .comparison-table td {
    padding: 0.5rem;
  }
  
  .tutorial-content {
    width: 95%;
    margin: 1rem;
  }
  
  .tutorial-start-btn {
    bottom: 1rem;
    right: 1rem;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
  }
  
  .api-endpoints {
    grid-template-columns: 1fr;
  }
}

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

/* 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); }
}

/* Tooltip Styles */
.tooltip {
  position: absolute;
  background: #2d3748;
  color: #e2e8f0;
  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;
}

/* ===== SECURITY ANALYSIS ===== */
/* Security analysis styles are now imported from ../sso/components/security.css */

.auto-selected {
  box-shadow: 0 0 0 3px #00c3ff, 0 0 8px 4px #00c3ff66;
  border: 2px solid #00c3ff;
  transition: box-shadow 0.3s, border 0.3s;
}

.enhanced-bg {
  background: linear-gradient(135deg, #f8f9fa 60%, #e3f0ff 100%);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
  border-radius: 12px;
  border: 1.5px solid #cfe2ff;
  transition: box-shadow 0.3s, background 0.3s;
} 