/* Modern Light Design System 2025 - Subtle Blue */
:root {
  --primary-color: #4f46e5;
  --secondary-color: #64748b;
  --accent-color: #6366f1;
  --light-gray: #f8fafc;
  --medium-gray: #e2e8f0;
  --dark-gray: #475569;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --white: #ffffff;
  --blue-50: #f0f9ff;
  --blue-100: #e0f2fe;
  --blue-500: #6366f1;
  --blue-600: #4f46e5;
  --blue-700: #4338ca;
  --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-large: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

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

/* Modern Light Cards */
.glass-card {
  background: var(--white);
  border: 1px solid var(--medium-gray);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
  overflow: hidden;
}

.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: #9ca3af;
}

/* Modern Light Buttons - Subtle Blue */
.btn-modern {
  background: #6b7280;
  border: none;
  border-radius: var(--border-radius-sm);
  padding: 14px 28px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.025em;
  transition: var(--transition);
  box-shadow: var(--shadow-soft);
  color: white;
  font-size: 0.95rem;
}

.btn-modern:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-large);
  background: #4b5563;
  color: white;
}

.btn-modern-secondary {
  background: var(--white);
  border: 2px solid #9ca3af;
  border-radius: var(--border-radius-sm);
  padding: 12px 26px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: var(--transition);
  box-shadow: var(--shadow-soft);
  color: #6b7280 !important;
  font-size: 0.95rem;
}

.btn-modern-secondary:hover {
  background: #6b7280;
  border-color: #6b7280;
  transform: translateY(-2px);
  box-shadow: var(--shadow-large);
  color: white !important;
}

/* Focus states */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem #f3f4f6, 0 0 0 0.25rem rgba(107, 114, 128, 0.15);
}

/* Navigation */
.navbar {
  background: var(--white) !important;
  border-bottom: 1px solid var(--medium-gray);
  transition: var(--transition);
  box-shadow: var(--shadow-soft);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-primary) !important;
}

.nav-link {
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  color: var(--text-secondary) !important;
  padding: 0.75rem 1rem !important;
}

.nav-link:hover {
  color: #6b7280 !important;
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background: #6b7280;
  transition: var(--transition);
}

.nav-link:hover::after {
  width: 100%;
  left: 0;
}

/* Hero Section - Very Subtle */
.hero-section {
  background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%) !important;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--medium-gray);
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(107, 114, 128, 0.02) 0%, rgba(107, 114, 128, 0.05) 100%);
}

.hero-section .container {
  position: relative;
  z-index: 2;
}

/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--medium-gray);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: #9ca3af;
}

.card-header {
  background: var(--light-gray);
  border-bottom: 1px solid var(--medium-gray);
  border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
  color: var(--text-primary);
}

/* Tables */
.table {
  background: var(--white) !important;
  color: var(--text-primary) !important;
  --bs-table-bg: var(--white) !important;
  --bs-table-striped-bg: var(--light-gray) !important;
  --bs-table-active-bg: var(--blue-50) !important;
  --bs-table-hover-bg: var(--blue-50) !important;
}

.table th {
  background: var(--light-gray) !important;
  color: var(--text-primary) !important;
  border-bottom: 1px solid var(--medium-gray) !important;
  border-top: none !important;
  font-weight: 600;
}

.table td {
  background: var(--white) !important;
  color: var(--text-primary) !important;
  border-bottom: 1px solid var(--medium-gray) !important;
  border-top: none !important;
}

.table tbody tr {
  background: var(--white) !important;
}

.table tbody tr:hover {
  background: var(--blue-50) !important;
}

.table a {
  color: #6b7280 !important;
  text-decoration: none;
}

.table a:hover {
  color: #4b5563 !important;
  text-decoration: underline;
}

.table code {
  background-color: var(--light-gray) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--medium-gray) !important;
  padding: 2px 6px;
  border-radius: 4px;
}

.table-light {
  background: var(--light-gray) !important;
  color: var(--text-primary) !important;
}

.table-hover tbody tr:hover {
  background: var(--blue-50) !important;
  color: var(--text-primary) !important;
}

/* Force override Bootstrap table styles */
.table > :not(caption) > * > * {
  background-color: var(--white) !important;
  color: var(--text-primary) !important;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Form Controls - Light Theme */
.form-control {
  border: 1px solid var(--medium-gray) !important;
  background: var(--white) !important;
  color: var(--text-primary) !important;
  border-radius: var(--border-radius-sm);
  padding: 12px 16px;
  font-size: 0.95rem;
}

.form-control:focus {
  border-color: #6b7280 !important;
  box-shadow: 0 0 0 0.2rem rgba(107, 114, 128, 0.15) !important;
  background: var(--white) !important;
  color: var(--text-primary) !important;
}

.form-control::placeholder {
  color: var(--text-muted) !important;
}

/* Form Select */
.form-select {
  border: 1px solid var(--medium-gray) !important;
  background: var(--white) !important;
  color: var(--text-primary) !important;
  border-radius: var(--border-radius-sm);
}

.form-select:focus {
  border-color: #6b7280 !important;
  box-shadow: 0 0 0 0.2rem rgba(107, 114, 128, 0.15) !important;
  background: var(--white) !important;
  color: var(--text-primary) !important;
}

/* Input Group */
.input-group-text {
  background: var(--light-gray) !important;
  border: 1px solid var(--medium-gray) !important;
  color: var(--text-secondary) !important;
}

/* Form Labels */
.form-label {
  color: var(--text-primary) !important;
  font-weight: 500;
  margin-bottom: 8px;
}

/* Badges */
.badge {
  border-radius: 8px;
  font-weight: 500;
  padding: 6px 12px;
}

/* Floating Elements */
.floating {
  animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* Pulse Animation */
.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Responsive */
body {
  margin-bottom: 60px;
  position: relative;
  min-height: 100vh;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .glass-card {
    margin: 1rem;
  }

  .hero-section h1 {
    font-size: 2.5rem !important;
  }

  .btn-modern {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--text-muted);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Additional Light Theme Enhancements - Subtle */
.bg-gradient-light {
  background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
}

.text-gradient {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-divider {
  background: var(--light-gray);
  border-top: 1px solid var(--medium-gray);
  border-bottom: 1px solid var(--medium-gray);
}

/* Icon styling for light theme */
.icon-primary {
  color: #6b7280;
}

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

/* Enhanced card hover effects */
.glass-card:hover .icon-primary {
  color: #4b5563;
  transform: scale(1.1);
  transition: var(--transition);
}

/* Light theme specific overrides */
.hero-section .text-white {
  color: var(--text-primary) !important;
}

.text-white-50 {
  color: var(--text-secondary) !important;
}

/* Override Bootstrap's text colors with softer gray colors */
.text-primary {
  color: #4b5563 !important;
}

.text-secondary {
  color: #6b7280 !important;
}

.text-white {
  color: #4b5563 !important;
}

.text-white-50 {
  color: #6b7280 !important;
}

.text-muted {
  color: #9ca3af !important;
}

.text-dark {
  color: #4b5563 !important;
}

/* Override any remaining text colors */
h1, h2, h3, h4, h5, h6 {
  color: #4b5563 !important;
}

p, span, div, td, th, li {
  color: #4b5563 !important;
}

/* Specific overrides for admin pages */
.text-white, .text-white-50 {
  color: #4b5563 !important;
}

/* Modal and Admin Form Overrides */
.modal-content {
  background: var(--white) !important;
  border: 1px solid var(--medium-gray);
  border-radius: var(--border-radius);
}

.modal-header {
  border-bottom: 1px solid var(--medium-gray) !important;
}

.modal-footer {
  border-top: 1px solid var(--medium-gray) !important;
}

.modal-title {
  color: var(--text-primary) !important;
}

/* Override inline styles for forms */
input[style*="background: rgba(255,255,255,0.1)"],
select[style*="background: rgba(255,255,255,0.1)"],
input[style*="color: white"],
select[style*="color: white"] {
  background: var(--white) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--medium-gray) !important;
}

/* Admin search form specific */
.admin-search .form-control {
  background: var(--white) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--medium-gray) !important;
}

.admin-search .form-select {
  background: var(--white) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--medium-gray) !important;
}

/* Close button for modals */
.btn-close-white {
  filter: invert(1) grayscale(100%) brightness(200%);
}


/* ===== Admin Contrast Fixes (2025-09-10) ===== */
/* Ensure readable text on colored backgrounds regardless of earlier overrides */
.card.bg-primary, .bg-primary, .badge.bg-primary,
.card.bg-success, .bg-success, .badge.bg-success,
.card.bg-danger, .bg-danger, .badge.bg-danger,
.card.bg-info, .bg-info, .badge.bg-info {
  color: #ffffff !important;
}

/* Yellow (warning) surfaces should have dark text for readability */
.card.bg-warning, .bg-warning, .badge.bg-warning { color: #000000 !important; }

/* Make muted text inside colored cards also white (except warning) */
.card.bg-primary .text-muted, .card.bg-success .text-muted, .card.bg-danger .text-muted, .card.bg-info .text-muted { color: #ffffff !important; opacity: 0.95; }

/* Dark surfaces (code/pre/blocks) must use light text */
.bg-dark, pre.bg-dark, code.bg-dark { color: #ffffff !important; }

/* Dropdown menus: force light background with dark text for readability */
.dropdown-menu { background-color: #ffffff !important; color: var(--text-primary) !important; }
.dropdown-menu .dropdown-item { color: var(--text-primary) !important; }
.dropdown-menu .dropdown-item:hover { background-color: var(--blue-50) !important; }

/* Admin search controls: visible borders and light background */
.admin-search .form-control, .admin-search .form-select {
  background-color: #ffffff !important;
  color: var(--text-primary) !important;
  border: 1px solid #9ca3af !important;
}

/* Tables inside cards: keep header/body text dark on light backgrounds */
.table thead th, .table tbody td { color: var(--text-primary) !important; }
