/* DFND InfoSec Toolkit - Modern Top Navigation Theme 2025 */

:root {
  /* Modern Color Palette */
  --primary-red: #dc2626;
  --primary-red-hover: #b91c1c;
  --primary-red-light: #ef4444;
  --primary-black: #0f0f0f;
  --secondary-black: #1a1a1a;
  --tertiary-black: #2d2d2d;
  
  /* Background Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.95);
  --bg-dark-glass: rgba(15, 15, 15, 0.95);
  
  /* Text Colors */
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --text-white: #ffffff;
  
  /* Modern Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-red: 0 4px 14px 0 rgba(220, 38, 38, 0.25);
  
  /* Modern Gradients */
  --gradient-primary: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  --gradient-dark: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
  --gradient-light: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
  
  /* Border Colors */
  --border-light: #e5e7eb;
  --border-medium: #d1d5db;
  --border-strong: #9ca3af;
  
  /* Animation */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

/* ========== GLOBAL RESET AND BASE STYLES ========== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Hide sidebar completely for modern layout */
.sidebar {
  display: none !important;
}

.app-container {
  display: block !important;
  min-height: 100vh;
}

.main-content {
  margin-left: 0 !important;
  padding-left: 0 !important;
  width: 100% !important;
  padding-top: 90px; /* Space for fixed navbar */
}

/* ========== MODERN TOP NAVIGATION ========== */
.modern-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1050;
  background: var(--bg-dark-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-normal);
  height: 80px;
}

.modern-navbar.scrolled {
  height: 70px;
  box-shadow: var(--shadow-xl);
}

.navbar-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Brand */
.navbar-brand-modern {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-white) !important;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  transition: all var(--transition-fast);
}

.navbar-brand-modern:hover {
  color: var(--primary-red-light) !important;
  transform: translateY(-1px);
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
}

/* Navigation Menu */
.navbar-nav-modern {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item-modern {
  position: relative;
}

.nav-link-modern {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  color: rgba(255, 255, 255, 0.8) !important;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.nav-link-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: -1;
}

.nav-link-modern:hover {
  color: white !important;
  transform: translateY(-2px);
}

.nav-link-modern:hover::before {
  opacity: 1;
}

.nav-link-modern.active {
  color: white !important;
  background: var(--gradient-primary);
  box-shadow: var(--shadow-red);
}

/* Dropdown Menus */
.dropdown-modern {
  position: relative;
}

.dropdown-toggle-modern {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  cursor: pointer;
}

.dropdown-toggle-modern::after {
  content: '▼';
  font-size: 0.7rem;
  transition: transform var(--transition-fast);
}

.dropdown-toggle-modern:hover::after {
  transform: translateY(-1px);
}

.dropdown-menu-modern {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-sm);
  margin-top: var(--space-xs);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-normal);
  z-index: 9999;
}

.dropdown-modern:hover .dropdown-menu-modern,
.dropdown-modern.show .dropdown-menu-modern {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item-modern {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  color: var(--text-primary) !important;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  font-weight: 500;
  font-size: 0.9rem;
}

.dropdown-item-modern:hover {
  background: var(--primary-red);
  color: white !important;
  transform: translateX(4px);
}

.dropdown-item-modern i {
  width: 16px;
  text-align: center;
  color: var(--primary-red);
  transition: color var(--transition-fast);
}

.dropdown-item-modern:hover i {
  color: white;
}

/* User Section */
.navbar-user-modern {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  position: relative;
  z-index: 1051;
}

.user-avatar-modern {
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.user-avatar-modern:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-red);
}

/* Badge for notifications */
.nav-badge-modern {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--primary-red);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.mobile-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.mobile-menu-overlay.show {
  opacity: 1;
  visibility: visible;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 100vh;
  background: var(--bg-primary);
  box-shadow: var(--shadow-xl);
  padding: var(--space-xl);
  transform: translateX(100%);
  transition: transform var(--transition-normal);
  z-index: 1041;
  overflow-y: auto;
}

.mobile-menu.show {
  transform: translateX(0);
}

.mobile-menu-close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-primary);
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  color: var(--text-primary) !important;
  text-decoration: none;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  transition: all var(--transition-fast);
}

.mobile-nav-link:hover {
  background: var(--primary-red);
  color: white !important;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 1024px) {
  .navbar-nav-modern {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  .navbar-container {
    padding: 0 var(--space-md);
  }
}

@media (max-width: 768px) {
  .modern-navbar {
    height: 70px;
  }
  
  .main-content {
    padding-top: 80px;
  }
  
  .navbar-brand-modern {
    font-size: 1.3rem;
  }
  
  .brand-icon {
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }
}

/* ========== CONTENT AREA IMPROVEMENTS ========== */
.content-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}

/* Modern page headers */
.page-header-modern {
  margin-bottom: var(--space-2xl);
  text-align: center;
}

.page-title-modern {
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: var(--space-md);
  letter-spacing: -0.025em;
}

.page-subtitle-modern {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* Modern cards */
.card-modern {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  overflow: hidden;
}

.card-modern:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-red-light);
}

.card-header-modern {
  background: var(--gradient-light);
  border-bottom: 1px solid var(--border-light);
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.card-body-modern {
  padding: var(--space-xl);
}

/* Modern forms */
.form-modern {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
}

.form-group-modern {
  margin-bottom: var(--space-lg);
  position: relative;
}

.form-control-modern {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  transition: all var(--transition-fast);
  background: var(--bg-primary);
}

.form-control-modern:focus {
  outline: none;
  border-color: var(--primary-red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
  transform: translateY(-1px);
}

/* Modern buttons */
.btn-modern {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border: none;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.btn-primary-modern {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-red);
}

.btn-primary-modern:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  color: white;
}

.btn-secondary-modern {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid var(--border-medium);
}

.btn-secondary-modern:hover {
  background: var(--primary-red);
  color: white;
  border-color: var(--primary-red);
  transform: translateY(-2px);
}

/* Modern alerts */
.alert-modern {
  border-radius: var(--radius-lg);
  border: 1px solid;
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.alert-success-modern {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: #166534;
}

.alert-danger-modern {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.3);
  color: #991b1b;
}

.alert-info-modern {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: #1e40af;
}

/* ========== GLOBAL LINK STYLING FOR DARK BACKGROUNDS ========== */
/* Ensure all links on dark backgrounds are white/light gray, NOT blue */
.card-header a,
.breach-header a,
.bg-dark a,
.table-header a,
.dark-header a,
[style*="background: #0b0b0c"] a,
[style*="background: #0f0f0f"] a,
[style*="background: #1a1a1a"] a,
[style*="background-color: #0b0b0c"] a,
[style*="background-color: #0f0f0f"] a,
[style*="background-color: #1a1a1a"] a,
.table-dark a,
thead.table-dark a,
.bg-black a,
.navbar-dark a {
  color: white !important;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.card-header a:hover,
.breach-header a:hover,
.bg-dark a:hover,
.table-header a:hover,
.dark-header a:hover,
[style*="background: #0b0b0c"] a:hover,
[style*="background: #0f0f0f"] a:hover,
[style*="background: #1a1a1a"] a:hover,
[style*="background-color: #0b0b0c"] a:hover,
[style*="background-color: #0f0f0f"] a:hover,
[style*="background-color: #1a1a1a"] a:hover,
.table-dark a:hover,
thead.table-dark a:hover,
.bg-black a:hover {
  color: var(--primary-red-light) !important;
  text-decoration: underline;
}

/* Override Bootstrap's default link colors on dark backgrounds */
.bg-dark a:not(.btn),
.table-dark a:not(.btn),
thead[style*="background"] a:not(.btn) {
  color: rgba(255, 255, 255, 0.95) !important;
}

/* ========== REUSABLE COMPONENT CLASSES ========== */

/* Dark Header Component */
.dark-header {
  background: var(--gradient-dark);
  color: white !important;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-weight: 600;
  border-bottom: 2px solid var(--primary-red);
}

.dark-header * {
  color: white !important;
}

.dark-header h1,
.dark-header h2,
.dark-header h3,
.dark-header h4,
.dark-header h5,
.dark-header h6 {
  margin: 0;
  color: white !important;
}

/* Table headers with dark backgrounds */
.table-header {
  background: var(--primary-black);
  color: white !important;
  font-weight: 600;
  padding: var(--space-md);
  border-bottom: 2px solid var(--primary-red);
}

.breach-header {
  background: var(--gradient-dark);
  color: white !important;
  padding: var(--space-md) var(--space-lg);
  font-weight: 600;
  border-bottom: 2px solid var(--primary-red);
}

/* ========== STANDARDIZED BUTTON CLASSES ========== */

/* Primary Action Button - White background with red text and border */
.action-button-primary,
.btn-action-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: white;
  color: var(--primary-red) !important;
  border: 2px solid var(--primary-red);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none !important;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.action-button-primary:hover,
.btn-action-primary:hover {
  background: var(--gradient-primary);
  color: white !important;
  border-color: var(--primary-red-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-red);
}

.action-button-primary:active,
.btn-action-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Secondary Action Button - Outlined style */
.action-button-secondary,
.btn-action-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: transparent;
  color: var(--text-primary) !important;
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none !important;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.action-button-secondary:hover,
.btn-action-secondary:hover {
  background: var(--bg-secondary);
  color: var(--primary-red) !important;
  border-color: var(--primary-red);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.action-button-secondary:active,
.btn-action-secondary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Danger/Warning Button - Red background with white text */
.action-button-danger,
.btn-action-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: var(--gradient-primary);
  color: white !important;
  border: 2px solid var(--primary-red);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none !important;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-red);
}

.action-button-danger:hover,
.btn-action-danger:hover {
  background: var(--primary-red-hover);
  border-color: var(--primary-red-hover);
  color: white !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.action-button-danger:active,
.btn-action-danger:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Button Group Styling */
.button-group {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  align-items: center;
}

/* Small button variants */
.action-button-primary.btn-sm,
.action-button-secondary.btn-sm,
.action-button-danger.btn-sm {
  padding: var(--space-xs) var(--space-md);
  font-size: 0.875rem;
}

/* Large button variants */
.action-button-primary.btn-lg,
.action-button-secondary.btn-lg,
.action-button-danger.btn-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: 1.1rem;
}

/* ========== BOOTSTRAP OVERRIDES FOR DARK BACKGROUNDS ========== */

/* Override Bootstrap's default blue links */
.bg-dark a,
.bg-black a,
.table-dark a,
.card-header.bg-dark a,
thead.bg-dark a,
thead.table-dark a {
  color: white !important;
}

.bg-dark a:hover,
.bg-black a:hover,
.table-dark a:hover,
.card-header.bg-dark a:hover,
thead.bg-dark a:hover,
thead.table-dark a:hover {
  color: var(--primary-red-light) !important;
}

/* Ensure table headers with dark backgrounds have white text */
.table thead th {
  color: inherit;
}

.table-dark thead th,
.table thead.table-dark th,
thead[style*="background: #0"] th,
thead[style*="background-color: #0"] th {
  color: white !important;
}

/* Card headers with dark backgrounds */
.card-header[style*="background: #0"],
.card-header[style*="background-color: #0"],
.card-header.bg-dark {
  color: white !important;
}

.card-header[style*="background: #0"] *,
.card-header[style*="background-color: #0"] *,
.card-header.bg-dark * {
  color: white !important;
}

/* Force proper contrast for inline-styled dark backgrounds */
[style*="background: #0b0b0c"],
[style*="background: #0f0f0f"],
[style*="background: #1a1a1a"],
[style*="background-color: #0b0b0c"],
[style*="background-color: #0f0f0f"],
[style*="background-color: #1a1a1a"] {
  color: white !important;
}

[style*="background: #0b0b0c"] *,
[style*="background: #0f0f0f"] *,
[style*="background: #1a1a1a"] *,
[style*="background-color: #0b0b0c"] *,
[style*="background-color: #0f0f0f"] *,
[style*="background-color: #1a1a1a"] * {
  color: white !important;
}

/* Ensure buttons maintain their styling on dark backgrounds */
[style*="background: #0"] .btn,
[style*="background-color: #0"] .btn,
.bg-dark .btn,
.table-dark .btn {
  color: initial !important;
}