/* ImageGuard — Premium SaaS Stylesheet */

:root {
  --ig-primary: #3b82f6;
  --ig-primary-hover: #2563eb;
  --ig-primary-subtle: #eff6ff;
  --ig-secondary: #64748b;
  --ig-accent: #06b6d4;
  --ig-danger: #ef4444;
  --ig-success: #10b981;
  --ig-warning: #f59e0b;
  
  --ig-bg: #f8fafc;
  --ig-surface: #ffffff;
  --ig-surface-card: #ffffff;
  --ig-surface-hover: #f1f5f9;
  --ig-border: #e2e8f0;
  --ig-border-subtle: #f1f5f9;
  
  --ig-text-main: #0f172a;
  --ig-text-muted: #64748b;
  --ig-text-inverted: #ffffff;
  
  --ig-sidebar-bg: #0f172a;
  --ig-sidebar-hover: #1e293b;
  --ig-sidebar-text: #94a3b8;
  --ig-sidebar-active: #ffffff;
  --ig-sidebar-active-bg: #1e293b;
  
  --ig-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --ig-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --ig-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --ig-radius: 0.75rem;
  --ig-radius-sm: 0.5rem;
}

[data-bs-theme="dark"] {
  --ig-primary: #3b82f6;
  --ig-primary-hover: #60a5fa;
  --ig-primary-subtle: #1e293b;
  --ig-secondary: #94a3b8;
  
  --ig-bg: #090d16;
  --ig-surface: #0f172a;
  --ig-surface-card: #131d31;
  --ig-surface-hover: #1e293b;
  --ig-border: #1e293b;
  --ig-border-subtle: #172033;
  
  --ig-text-main: #f8fafc;
  --ig-text-muted: #94a3b8;
  --ig-text-inverted: #0f172a;
  
  --ig-sidebar-bg: #070a12;
  --ig-sidebar-hover: #131d31;
  --ig-sidebar-text: #64748b;
  --ig-sidebar-active: #f8fafc;
  --ig-sidebar-active-bg: #1e293b;
  
  --ig-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.4);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--ig-bg);
  color: var(--ig-text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Layout Architecture */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.app-sidebar {
  width: 260px;
  background-color: var(--ig-sidebar-bg);
  color: var(--ig-sidebar-text);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease-in-out;
  border-right: 1px solid var(--ig-border);
  z-index: 1000;
}

.app-sidebar .brand-logo {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.brand-logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.app-sidebar-nav {
  padding: 1rem 0.75rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.4);
  padding: 0.75rem 0.75rem 0.25rem;
}

.app-sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: var(--ig-sidebar-text);
  border-radius: var(--ig-radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.15s ease;
  text-decoration: none;
}

.app-sidebar-nav .nav-link i {
  font-size: 1.15rem;
}

.app-sidebar-nav .nav-link:hover {
  background-color: var(--ig-sidebar-hover);
  color: #ffffff;
}

.app-sidebar-nav .nav-link.active {
  background-color: var(--ig-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.app-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--ig-bg);
}

.app-header {
  height: 68px;
  background-color: var(--ig-surface);
  border-bottom: 1px solid var(--ig-border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 900;
}

.app-content {
  padding: 1.75rem;
  flex-grow: 1;
}

/* SaaS Cards */
.card {
  background-color: var(--ig-surface-card);
  border: 1px solid var(--ig-border);
  border-radius: var(--ig-radius);
  box-shadow: var(--ig-shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  border-color: rgba(59, 130, 246, 0.3);
}

.card-metric {
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}

.metric-icon-bubble {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 0.35rem;
  letter-spacing: -0.02em;
}

.metric-label {
  font-size: 0.82rem;
  color: var(--ig-text-muted);
  font-weight: 500;
}

/* Match Investigation Split View */
.match-comparison-box {
  border-radius: var(--ig-radius);
  overflow: hidden;
  background: #000000;
  position: relative;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.match-comparison-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.match-box-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  border-radius: 6px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}

.similarity-meter-bar {
  height: 8px;
  background-color: var(--ig-border);
  border-radius: 4px;
  overflow: hidden;
}

.similarity-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #10b981 100%);
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* Timeline Visualizer */
.timeline-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 2px;
}

.timeline-thumb {
  width: 80px;
  height: 50px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s ease;
}

.timeline-thumb.active {
  border-color: var(--ig-danger);
  transform: scale(1.05);
}

.timeline-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.timeline-thumb .time-tag {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(0,0,0,0.7);
  font-size: 9px;
  color: #fff;
  padding: 1px 3px;
  border-radius: 2px;
}

/* Drag & Drop Upload Zone */
.upload-dropzone {
  border: 2px dashed var(--ig-border);
  border-radius: var(--ig-radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  background-color: var(--ig-surface);
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--ig-primary);
  background-color: var(--ig-primary-subtle);
}

/* Mobile Bottom Navigation */
.app-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background-color: var(--ig-surface);
  border-top: 1px solid var(--ig-border);
  z-index: 1050;
  justify-content: space-around;
  align-items: center;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--ig-text-muted);
  font-size: 0.68rem;
  font-weight: 500;
  gap: 2px;
  flex: 1;
  height: 100%;
}

.bottom-nav-item i {
  font-size: 1.25rem;
}

.bottom-nav-item.active {
  color: var(--ig-primary);
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -260px;
    z-index: 1100;
  }

  .app-sidebar.show {
    left: 0;
    box-shadow: var(--ig-shadow-lg);
  }

  .app-content {
    padding: 1.25rem 1rem 5rem 1rem;
  }

  .app-bottom-nav {
    display: flex;
  }
}

/* Print Styles for Legal / Case Evidence */
@media print {
  .app-sidebar, .app-header, .app-bottom-nav, .no-print {
    display: none !important;
  }
  .app-content {
    padding: 0 !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
}
