/* Implied Defense - Jicho Platform Custom Styles */
/* Matches impliedd.com design system */

/* Import fonts to match main site */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700&family=Inter:wght@400;500;600&family=Cormorant+Garamond:wght@400;500;600&display=swap');

:root {
  /* Implied Defense Brand Colors */
  --id-primary: #243C5A;        /* Deep Navy Blue */
  --id-accent-green: #557A46;   /* Field Green */
  --id-accent-clay: #C9A27E;    /* Warm Clay */
  --id-white: #FFFFFF;
  --id-charcoal: #4D4D4D;
  
  /* Backgrounds */
  --id-bg: #0C1018;             /* Deep navy-black */
  --id-surface: #111826;        /* Card surface */
  --id-surface-soft: #182133;   /* Softer variation */
  
  /* Text */
  --id-text: #F5F7FA;
  --id-text-muted: #A3AEC0;
  --id-border: rgba(255, 255, 255, 0.06);
  
  /* Status Colors */
  --id-critical: #EF4444;
  --id-high: #F59E0B;
  --id-medium: #3B82F6;
  --id-low: #10B981;
  
  /* Shadows */
  --id-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
  --id-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  
  /* Typography */
  --id-font-header: 'Montserrat', system-ui, sans-serif;
  --id-font-body: 'Inter', system-ui, sans-serif;
  --id-font-narrative: 'Cormorant Garamond', Georgia, serif;
  
  /* Spacing */
  --id-space-xs: 4px;
  --id-space-s: 8px;
  --id-space-m: 16px;
  --id-space-l: 24px;
  --id-space-xl: 40px;
  
  /* Radii */
  --id-radius-sm: 6px;
  --id-radius-md: 10px;
  --id-radius-lg: 16px;
}

/* Global overrides for Dash components */
body {
  font-family: var(--id-font-body) !important;
  background-color: var(--id-bg) !important;
  color: var(--id-text) !important;
  -webkit-font-smoothing: antialiased;
}

#dashboard-shell {
  background-color: var(--id-bg) !important;
  color: var(--id-text) !important;
  min-height: 100vh;
}

/* Headers */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--id-font-header) !important;
  color: var(--id-text) !important;
  font-weight: 600 !important;
}

h1 { font-size: 2.5rem; margin-bottom: var(--id-space-l); }
h2 { font-size: 2rem; margin-bottom: var(--id-space-m); }
h3 { font-size: 1.5rem; margin-bottom: var(--id-space-m); }
h4 { font-size: 1.25rem; margin-bottom: var(--id-space-s); }

/* Login Panel Styling */
#login-panel {
  background: linear-gradient(135deg, var(--id-surface) 0%, var(--id-surface-soft) 100%) !important;
  border: 1px solid var(--id-border) !important;
  border-radius: var(--id-radius-lg) !important;
  padding: var(--id-space-xl) !important;
  box-shadow: var(--id-shadow) !important;
  max-width: 500px;
  margin: 80px auto !important;
}

#login-panel h2 {
  color: var(--id-accent-green) !important;
  margin-bottom: var(--id-space-m) !important;
}

/* Input fields */
input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select,
.Select-control {
  background-color: var(--id-surface-soft) !important;
  border: 1px solid var(--id-border) !important;
  color: var(--id-text) !important;
  border-radius: var(--id-radius-sm) !important;
  padding: 12px 16px !important;
  font-family: var(--id-font-body) !important;
  transition: all 0.2s ease !important;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--id-accent-green) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(85, 122, 70, 0.25) !important;
}

/* Buttons */
button,
.btn,
a.btn {
  font-family: var(--id-font-header) !important;
  font-weight: 600 !important;
  border-radius: var(--id-radius-sm) !important;
  padding: 12px 24px !important;
  transition: all 0.2s ease !important;
  border: none !important;
  cursor: pointer !important;
  text-decoration: none !important;
  display: inline-block !important;
}

/* Primary button (green) */
button[style*="#557A46"],
button[style*="backgroundColor: #557A46"],
.btn-primary {
  background-color: var(--id-accent-green) !important;
  color: var(--id-white) !important;
}

button[style*="#557A46"]:hover,
button[style*="backgroundColor: #557A46"]:hover,
.btn-primary:hover {
  background-color: #3F5B36 !important;
  transform: translateY(-2px);
  box-shadow: var(--id-shadow-sm);
}

/* Danger button (red) */
button[style*="#d9534f"],
.btn-danger {
  background-color: var(--id-critical) !important;
  color: var(--id-white) !important;
}

/* Cards & Surfaces */
div[style*="backgroundColor: #f9f9f9"],
div[style*="backgroundColor: white"],
div[style*="backgroundColor: #ffffff"],
div[style*="backgroundColor: #f0f8ff"],
div[style*="backgroundColor: #d9edf7"] {
  background-color: var(--id-surface) !important;
  border: 1px solid var(--id-border) !important;
  border-radius: var(--id-radius-md) !important;
  box-shadow: var(--id-shadow-sm) !important;
}

/* Executive Summary Card */
#executive-summary-card {
  background: linear-gradient(135deg, var(--id-surface) 0%, var(--id-surface-soft) 100%) !important;
  border-left: 4px solid var(--id-accent-green) !important;
  border-radius: var(--id-radius-md) !important;
  padding: var(--id-space-l) !important;
  box-shadow: var(--id-shadow) !important;
}

#executive-summary-card h4 {
  color: var(--id-accent-green) !important;
}

/* Summary stat boxes */
#executive-summary-card div[style*="backgroundColor: white"] {
  background-color: var(--id-surface-soft) !important;
  border: 1px solid var(--id-border) !important;
}

/* Welcome Section */
#welcome-section {
  background: linear-gradient(135deg, var(--id-primary) 0%, var(--id-surface) 100%) !important;
  border: 1px solid var(--id-accent-green) !important;
  border-left: 4px solid var(--id-accent-green) !important;
}

#welcome-section h3 {
  color: var(--id-accent-green) !important;
}

/* IOC Checker */
#ioc-results,
#bulk-ioc-results {
  background-color: var(--id-surface) !important;
  border: 1px solid var(--id-border) !important;
  border-radius: var(--id-radius-md) !important;
  padding: var(--id-space-m) !important;
}

/* Tables */
table {
  background-color: var(--id-surface) !important;
  border: 1px solid var(--id-border) !important;
  border-radius: var(--id-radius-sm) !important;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

table th {
  background-color: var(--id-surface-soft) !important;
  color: var(--id-accent-green) !important;
  font-family: var(--id-font-header) !important;
  font-weight: 600 !important;
  padding: 12px 16px !important;
  border-bottom: 2px solid var(--id-border) !important;
  text-align: left;
}

table td {
  padding: 12px 16px !important;
  border-bottom: 1px solid var(--id-border) !important;
  color: var(--id-text) !important;
}

table tr:hover {
  background-color: var(--id-surface-soft) !important;
}

table tr:last-child td {
  border-bottom: none !important;
}

/* Severity badges */
span[style*="#d9534f"],
strong[style*="#d9534f"] {
  color: var(--id-critical) !important;
}

span[style*="#f0ad4e"],
strong[style*="#f0ad4e"] {
  color: var(--id-high) !important;
}

span[style*="#5bc0de"],
strong[style*="#5bc0de"] {
  color: var(--id-medium) !important;
}

span[style*="#5cb85c"],
strong[style*="#5cb85c"] {
  color: var(--id-low) !important;
}

/* Horizontal rules */
hr {
  border: none !important;
  border-top: 2px solid var(--id-accent-green) !important;
  margin: var(--id-space-xl) 0 !important;
}

/* Filter section */
div[style*="backgroundColor: #e8f4f0"] {
  background-color: var(--id-surface) !important;
  border: 1px solid var(--id-border) !important;
  border-left: 4px solid var(--id-accent-green) !important;
}

/* Session timer area */
div[style*="backgroundColor: #f0f0f0"] {
  background-color: var(--id-surface) !important;
  border: 1px solid var(--id-border) !important;
}

div[style*="backgroundColor: #f0f0f0"] span {
  color: var(--id-text-muted) !important;
}

/* Links */
a {
  color: var(--id-accent-green) !important;
  transition: color 0.2s ease !important;
}

a:hover {
  color: #3F5B36 !important;
}

/* Dropdowns */
.Select-menu-outer {
  background-color: var(--id-surface) !important;
  border: 1px solid var(--id-border) !important;
  box-shadow: var(--id-shadow) !important;
}

.Select-option {
  background-color: var(--id-surface) !important;
  color: var(--id-text) !important;
  padding: 8px 12px !important;
}

.Select-option:hover {
  background-color: var(--id-surface-soft) !important;
}

.Select-option.is-focused {
  background-color: var(--id-surface-soft) !important;
}

/* Date picker */
.DateInput_input {
  background-color: var(--id-surface-soft) !important;
  color: var(--id-text) !important;
  border: 1px solid var(--id-border) !important;
}

.CalendarDay__selected {
  background: var(--id-accent-green) !important;
  border: 1px solid var(--id-accent-green) !important;
}

/* Loading spinner */
._dash-loading {
  color: var(--id-accent-green) !important;
}

._dash-loading-callback {
  color: var(--id-accent-green) !important;
}

/* Scroll bars (webkit) */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--id-surface);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb {
  background: var(--id-accent-green);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3F5B36;
}

/* Status indicators */
.status-critical {
  color: var(--id-critical) !important;
  font-weight: 600 !important;
}

.status-high {
  color: var(--id-high) !important;
  font-weight: 600 !important;
}

.status-medium {
  color: var(--id-medium) !important;
}

.status-low {
  color: var(--id-low) !important;
}

/* Navbar styling */
.jicho-nav {
  background-color: var(--id-surface) !important;
  border-bottom: 1px solid var(--id-border) !important;
  padding: var(--id-space-m) var(--id-space-xl) !important;
  display: flex !important;
  align-items: center !important;
  box-shadow: var(--id-shadow-sm) !important;
}

.jicho-nav img {
  height: 40px;
  margin-right: var(--id-space-m);
}

.jicho-nav h3 {
  margin: 0 !important;
  color: var(--id-accent-green) !important;
}

/* Dark mode toggle button styling */
#dark-mode-btn {
  background-color: var(--id-surface) !important;
  border: 2px solid var(--id-accent-green) !important;
  color: var(--id-accent-green) !important;
}

#dark-mode-btn:hover {
  background-color: var(--id-accent-green) !important;
  color: var(--id-white) !important;
}

/* SITREP embed iframe */
#sitrep-embed-frame {
  border: 1px solid var(--id-border) !important;
  border-radius: var(--id-radius-md) !important;
  box-shadow: var(--id-shadow) !important;
}

/* Alerts */
.alert {
  padding: var(--id-space-m) !important;
  border-radius: var(--id-radius-sm) !important;
  border-left: 4px solid var(--id-accent-green) !important;
  background-color: var(--id-surface) !important;
  margin-bottom: var(--id-space-m) !important;
}

.alert-critical {
  border-left-color: var(--id-critical) !important;
}

.alert-high {
  border-left-color: var(--id-high) !important;
}

/* Details/Summary elements */
details {
  background-color: var(--id-surface) !important;
  border: 1px solid var(--id-border) !important;
  border-radius: var(--id-radius-sm) !important;
  padding: var(--id-space-s) !important;
}

summary {
  cursor: pointer !important;
  font-weight: 600 !important;
  color: var(--id-accent-green) !important;
  padding: var(--id-space-s) !important;
}

summary:hover {
  background-color: var(--id-surface-soft) !important;
  border-radius: var(--id-radius-sm) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #login-panel {
    margin: var(--id-space-l) !important;
    padding: var(--id-space-l) !important;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  
  .jicho-nav {
    padding: var(--id-space-m) !important;
  }
  
  table {
    font-size: 0.875rem;
  }
  
  table th,
  table td {
    padding: 8px !important;
  }
}

/* Animation for page transitions */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#dashboard-main-content > * {
  animation: fadeIn 0.3s ease-out;
}

/* Professional polish */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ensure dark theme always */
body[data-theme="light"] {
  background-color: var(--id-bg) !important;
}

/* Color overrides for any remaining light theme elements */
[style*="color: #666"],
[style*="color: #999"] {
  color: var(--id-text-muted) !important;
}

[style*="backgroundColor: #0b3d2e"] {
  background-color: var(--id-accent-green) !important;
}

/* Logout button override */
#logout-button {
  background-color: var(--id-critical) !important;
}

#logout-button:hover {
  background-color: #DC2626 !important;
}

/* Ensure proper text contrast */
#dashboard-shell p,
#dashboard-shell span,
#dashboard-shell li {
  color: var(--id-text) !important;
}

/* Make sure all text is bright white */
h1, h2, h3, h4, h5, h6, p, span, div, li, label {
  color: #F5F7FA !important;
}

/* Section headers in field green */
.section-header,
h3[style*="color"] {
  color: #557A46 !important;
}

/* Muted text in lighter gray */
.text-muted,
small {
  color: #A3AEC0 !important;
}

/* Special styling for section headers */
#dashboard-shell > div > h3 {
  color: var(--id-accent-green) !important;
  border-bottom: 2px solid var(--id-accent-green) !important;
  padding-bottom: var(--id-space-s) !important;
  margin-top: var(--id-space-xl) !important;
}

/* FORCE ALL TEXT TO BE VISIBLE - STRONGEST OVERRIDES */
* {
  color: #F5F7FA !important;
}

h1, h2, h3, h4, h5, h6 {
  color: #557A46 !important;
}

p, span, div, li, label, td, th {
  color: #F5F7FA !important;
}

/* Override any gray text */
[style*="color: #666"],
[style*="color: #999"],
[style*="color: gray"],
[style*="color: grey"],
[style*="color: #333"] {
  color: #F5F7FA !important;
}

/* Session timer */
#session-timer {
  color: #557A46 !important;
  font-weight: bold !important;
}

/* Make sure buttons are visible */
button {
  color: #FFFFFF !important;
}

/* Links */
a {
  color: #557A46 !important;
}
