/* CSS Variable Definition */
:root {
  --bg-primary: #060913;
  --bg-secondary: #0c0f1f;
  --bg-card: rgba(15, 20, 38, 0.7);
  --border-color: rgba(0, 255, 204, 0.08);
  --border-color-focus: #00ffcc;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-secops: #00ffcc; /* Cyber Cyan */
  --accent-secops-glow: rgba(0, 255, 204, 0.25);
  --accent-success: #10b981; /* Security OK (Green) */
  --accent-success-glow: rgba(16, 185, 129, 0.25);
  
  --severity-critical: #ef4444; /* Critical (Red) */
  --severity-high: #f59e0b; /* High (Amber) */
  --severity-medium: #3b82f6; /* Medium (Blue) */
  --severity-low: #8b5cf6; /* Low (Purple) */
  
  --font-sans: 'Inter', sans-serif;
  --font-title: 'Outfit', sans-serif;
  --font-mono: 'Fira Code', monospace;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(0, 255, 204, 0.03) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(16, 185, 129, 0.03) 0%, transparent 45%);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  background-color: rgba(10, 13, 27, 0.9);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 1.6rem;
  background-color: rgba(0, 255, 204, 0.06);
  border: 1px solid var(--accent-secops);
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  box-shadow: 0 0 10px var(--accent-secops-glow);
}

.logo-area h1 {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

/* Navigation Tabs */
.app-nav {
  display: flex;
  gap: 0.5rem;
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-btn:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.02);
}

.nav-btn.active {
  color: var(--accent-secops);
  background-color: rgba(0, 255, 204, 0.05);
  border-color: rgba(0, 255, 204, 0.2);
  box-shadow: 0 0 8px rgba(0, 255, 204, 0.1);
}

/* Main Content Area */
.app-main {
  flex: 1;
  padding: 2rem;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

/* Tab panes visibility */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Grid Layout for auditing tabs */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Card Elements */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

.intro-card {
  padding: 1.25rem 1.5rem;
  border-left: 3px solid var(--accent-secops);
}

.card-title {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.card-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.panel-subtitle {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 0.5rem;
}

/* Form Elements & Inputs */
textarea {
  width: 100%;
  height: 380px;
  background-color: #04060c;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: all var(--transition-fast);
}

textarea:focus {
  border-color: var(--border-color-focus);
  box-shadow: 0 0 10px rgba(0, 255, 204, 0.15);
}

input[type="text"] {
  background-color: #04060c;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  width: 100%;
  transition: all var(--transition-fast);
}

input[type="text"]:focus {
  border-color: var(--border-color-focus);
  box-shadow: 0 0 8px rgba(0, 255, 204, 0.15);
}

.editor-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.btn-row {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.55rem 1.2rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary {
  background-color: var(--accent-secops);
  color: #060913;
  box-shadow: 0 4px 12px rgba(0, 255, 204, 0.2);
}

.btn-primary:hover {
  background-color: #00cca3;
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-outline:hover {
  background-color: rgba(0, 255, 204, 0.05);
  border-color: rgba(0, 255, 204, 0.2);
}

.btn-xs {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-critical { background-color: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.25); }
.badge-high { background-color: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.25); }
.badge-medium { background-color: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.25); }
.badge-low { background-color: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.25); }
.badge-success { background-color: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.25); }

.summary-badge-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.summary-badge-row.hidden {
  display: none !important;
}

/* Results Display */
.results-card {
  min-height: 480px;
  display: flex;
  flex-direction: column;
}

.results-list {
  flex: 1;
  overflow-y: auto;
  max-height: 500px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.no-data {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  flex: 1;
}

/* Audit Item Cards */
.audit-item {
  background-color: #04060b;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform var(--transition-fast) ease;
}

.audit-item:hover {
  transform: translateX(3px);
  border-color: rgba(0, 255, 204, 0.15);
}

.audit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.audit-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.audit-location {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.audit-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.audit-match {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  color: #ff3355;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mode toggles styling for SSL tab */
.mode-card {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-subtitle-small {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.mode-toggles {
  display: flex;
  background-color: #04060c;
  padding: 3px;
  border-radius: 6px;
}

.toggle-btn {
  flex: 1;
  background-color: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.toggle-btn.active {
  background-color: var(--bg-card);
  color: var(--accent-secops);
  box-shadow: var(--shadow-sm);
}

.query-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.query-card.hidden {
  display: none;
}

.query-card label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 0.75rem;
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

/* Connection pipeline loader animation */
.connection-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  gap: 0.75rem;
}

.connection-card.hidden {
  display: none;
}

.pipeline-loader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 320px;
}

.pipeline-node {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
}

.pipeline-line {
  flex: 1;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.05);
  margin: 0 0.5rem;
  position: relative;
  overflow: hidden;
}

.pipeline-pulse {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 20px;
  background-color: var(--accent-secops);
  box-shadow: 0 0 8px var(--accent-secops);
  animation: pulse-forward 1s infinite linear;
}

@keyframes pulse-forward {
  from { left: -20px; }
  to { left: 100%; }
}

.pipeline-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-secops);
  animation: blink 1s infinite alternate;
}

@keyframes blink {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

/* SSL report details components */
.ssl-report-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.report-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.report-table {
  background-color: #04060c;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.table-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  padding: 0.2rem 0;
}

.table-row-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.table-row-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
}

/* Footer styling */
.app-footer-bar {
  text-align: center;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border-color);
  background-color: rgba(10, 13, 27, 0.5);
  margin-top: auto;
}

.app-footer-bar p {
  font-size: 0.75rem;
  color: var(--text-muted);
}
