/* AI Agent Audit - Futuristic Dark Mode Theme */

:root {
  --primary-color: #9F4CFF;
  --secondary-color: #3C8DFF;
  --accent-color: #1B1F3B;
  --bg-color: #0D0D0F;
  --bg-elevated: #151518;
  --bg-card: #1A1A1F;
  --text-color: #E6E6EA;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;
  --border-color: #2A2A30;
  --success-color: #10B981;
  --warning-color: #F59E0B;
  --danger-color: #EF4444;
  --glow-primary: rgba(159, 76, 255, 0.4);
  --glow-secondary: rgba(60, 141, 255, 0.4);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-color);
}

/* Header */
.header {
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-color) 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header h1 {
  font-size: 1.25rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header .logo {
  height: 32px;
  filter: brightness(1.1);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-nav a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.2s ease;
}

.header-nav a:hover {
  color: var(--text-color);
}

.header-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  transition: width 0.2s ease;
}

.header-nav a:hover::after {
  width: 100%;
}

/* Main Content */
.main-content {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.container {
  width: 100%;
}

/* Cards */
.card, .stat-card, .agent-card, .audit-card, .section-card, .settings-form, .sync-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover, .agent-card:hover, .audit-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 0 20px var(--glow-primary);
}

.stat-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--accent-color) 100%);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  box-shadow: 0 2px 10px var(--glow-primary);
}

.btn-primary:hover {
  box-shadow: 0 0 20px var(--glow-primary), 0 0 40px var(--glow-secondary);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--accent-color);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--primary-color);
  box-shadow: 0 0 10px var(--glow-primary);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

button:hover {
  box-shadow: 0 0 15px var(--glow-primary);
  transform: translateY(-1px);
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  font-size: 0.875rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 10px var(--glow-primary);
}

input[type="color"] {
  width: 100%;
  height: 44px;
  padding: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
}

input::placeholder {
  color: var(--text-muted);
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
}

.data-table th {
  background: var(--accent-color);
  color: var(--text-secondary);
  font-weight: 600;
  text-align: left;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
}

.data-table tr:hover td {
  background: var(--bg-elevated);
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* Score Badges */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
}

.score-good {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.score-warn {
  background: rgba(245, 158, 11, 0.2);
  color: #FBBF24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.score-bad {
  background: rgba(239, 68, 68, 0.2);
  color: #F87171;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #F87171;
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.alert-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-error {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Violations */
.violation-item {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid var(--danger-color);
  padding: 1rem;
  border-radius: 0 8px 8px 0;
  margin-bottom: 0.75rem;
}

.violation-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.violation-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--danger-color);
  color: white;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: bold;
}

.violation-suggestion {
  color: #FCA5A5;
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.prompt-fix {
  background: var(--bg-elevated);
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  border: 1px solid var(--border-color);
}

/* Messages */
.messages-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.message {
  padding: 1rem;
  border-radius: 12px;
}

.message.assistant {
  background: linear-gradient(135deg, rgba(159, 76, 255, 0.1) 0%, rgba(60, 141, 255, 0.1) 100%);
  border: 1px solid rgba(159, 76, 255, 0.2);
  margin-right: 2rem;
}

.message.user {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  margin-left: 2rem;
}

.message-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.role-badge {
  font-weight: 600;
  color: var(--primary-color);
}

.timestamp {
  color: var(--text-muted);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.empty-state h3 {
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* Page Headers */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-header h1, .page-header h2 {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Section Titles */
h2, h3, h4 {
  color: var(--text-color);
}

.section-title {
  color: var(--text-color);
  margin-bottom: 1rem;
}

/* Grids */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

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

/* Stat Cards */
.stat-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Sync Results */
.sync-results {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
  display: none;
}

.sync-results:not(:empty) {
  display: block;
}

.sync-results.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34D399;
}

.sync-results.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #F87171;
}

/* Text utilities */
.text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}

/* Checkbox styling */
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Animation utilities */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 10px var(--glow-primary);
  }
  50% {
    box-shadow: 0 0 20px var(--glow-primary), 0 0 30px var(--glow-secondary);
  }
}

.glow-animation {
  animation: glow 2s ease-in-out infinite;
}

/* Admin Navigation */
.admin-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.admin-nav .nav-link {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.admin-nav .nav-link:hover {
  color: var(--text-color);
  background: var(--bg-elevated);
}

.admin-nav .nav-link.active {
  color: white;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  box-shadow: 0 0 10px var(--glow-primary);
}

.admin-nav .nav-spacer {
  flex: 1;
}

/* Alert Messages */
.alert {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34D399;
}

.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #F87171;
}

/* Plan Info Banner */
.plan-info-banner {
  background: linear-gradient(135deg, rgba(159, 76, 255, 0.1) 0%, rgba(60, 141, 255, 0.1) 100%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  margin-bottom: 1.5rem;
}

.plan-info-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.plan-tier-badge {
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tier-demo {
  background: rgba(107, 114, 128, 0.2);
  color: #9CA3AF;
  border: 1px solid rgba(107, 114, 128, 0.3);
}

.tier-pro {
  background: rgba(59, 130, 246, 0.2);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.tier-enterprise {
  background: linear-gradient(135deg, rgba(159, 76, 255, 0.2) 0%, rgba(236, 72, 153, 0.2) 100%);
  color: #C084FC;
  border: 1px solid rgba(159, 76, 255, 0.3);
}

.plan-usage-summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.usage-item strong {
  color: var(--text-color);
}

.usage-divider {
  color: var(--border-color);
}

.upgrade-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  padding: 0.375rem 0.75rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.upgrade-link:hover {
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--glow-primary);
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    padding: 1rem;
  }
  
  .header-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
  
  .main-content {
    padding: 1rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .agents-grid, .audits-grid {
    grid-template-columns: 1fr;
  }
}
