/* ============================================================================
   Business Indicator Application - Bootstrap 5 Enhanced Styles
   ============================================================================ */

:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --success-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* ============================================================================
   Global Styles
   ============================================================================ */

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #f8f9fa;
}

body {
  color: #333;
  line-height: 1.6;
}

/* ============================================================================
   Navbar Enhancements
   ============================================================================ */

.navbar {
  box-shadow: var(--shadow-md);
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.navbar-brand {
  font-size: 1.5rem;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.navbar-brand:hover {
  transform: scale(1.05);
}

.nav-link {
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover {
  transform: translateY(-2px);
  color: #fff !important;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: #ffc107;
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* ============================================================================
   Header & Hero Sections
   ============================================================================ */

.bg-gradient {
  background: var(--primary-gradient) !important;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.bg-gradient::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}

header {
  background: var(--primary-gradient);
  color: white;
  padding: 2rem 0;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

header h1, header h2 {
  letter-spacing: 1px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   Cards & Containers
   ============================================================================ */

.card {
  border: none;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  border: none;
  padding: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  color: white !important;
}

.card-header.bg-primary {
  background: linear-gradient(90deg, #667eea, #764ba2) !important;
}

.card-header.bg-info {
  background: linear-gradient(90deg, #4facfe, #00f2fe) !important;
}

.card-header.bg-success {
  background: linear-gradient(90deg, #43e97b, #38f9d7) !important;
}

.card-header.bg-secondary {
  background: linear-gradient(90deg, #6c757d, #5a6268) !important;
}

.card-header.bg-dark {
  background: linear-gradient(90deg, #2c3e50, #34495e) !important;
}

.card-body {
  padding: 1.5rem;
}

/* Stat cards */
.card .card-body h2 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -1px;
}

.card .card-body h6 {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* ============================================================================
   Badges & Alerts
   ============================================================================ */

.badge {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 50px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.badge:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.badge.bg-primary {
  background: linear-gradient(135deg, #667eea, #764ba2) !important;
}

.badge.bg-success {
  background: linear-gradient(135deg, #43e97b, #38f9d7) !important;
}

.badge.bg-info {
  background: linear-gradient(135deg, #4facfe, #00f2fe) !important;
}

.badge.bg-warning {
  background: linear-gradient(135deg, #f5af19, #f12711) !important;
  color: white !important;
}

.badge.bg-danger {
  background: linear-gradient(135deg, #f5576c, #f093fb) !important;
}

.alert {
  border: none;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  font-weight: 500;
}

.alert-danger {
  background: linear-gradient(135deg, #f5576c, #f093fb);
  color: white;
}

.alert-success {
  background: linear-gradient(135deg, #43e97b, #38f9d7);
  color: white;
}

.alert-warning {
  background: linear-gradient(135deg, #f5af19, #f12711);
  color: white;
}

.alert-info {
  background: linear-gradient(135deg, #4facfe, #00f2fe);
  color: white;
}

/* ============================================================================
   Forms & Input Fields
   ============================================================================ */

.form-control, .form-select {
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  padding: 0.625rem 0.875rem;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
  transform: translateY(-2px);
}

.form-label {
  color: #2c3e50;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.form-label strong {
  font-weight: 600;
}

/* ============================================================================
   Buttons
   ============================================================================ */

.btn {
  padding: 0.625rem 1.25rem;
  font-weight: 600;
  border-radius: 8px;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  border: none;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #764ba2, #667eea);
  color: white;
}

.btn-success {
  background: linear-gradient(135deg, #43e97b, #38f9d7);
  color: white;
}

.btn-success:hover {
  background: linear-gradient(135deg, #38f9d7, #43e97b);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, #f5576c, #f093fb);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #f093fb, #f5576c);
  color: white;
}

.btn-warning {
  background: linear-gradient(135deg, #f5af19, #f12711);
  color: white;
}

.btn-warning:hover {
  background: linear-gradient(135deg, #f12711, #f5af19);
  color: white;
}

.btn-outline-secondary {
  border: 2px solid #6c757d;
  color: #6c757d;
}

.btn-outline-secondary:hover {
  background: #6c757d;
  color: white;
  border-color: #6c757d;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.85rem;
}

/* ============================================================================
   Tables
   ============================================================================ */

.table {
  margin-bottom: 0;
}

.table thead th {
  background-color: #f8f9fa;
  border-bottom: 2px solid #e5e5e5;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 0.75rem 1rem;
}

.table-hover tbody tr {
  transition: all 0.3s ease;
}

.table-hover tbody tr:hover {
  background-color: #f5f5f5;
  transform: scale(1.01);
}

.table-light {
  background-color: #f8f9fa;
}

.table-striped > tbody > tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.02);
}

.table td, .table th {
  vertical-align: middle;
  padding: 0.875rem;
}

.table-responsive {
  border-radius: 10px;
  overflow: hidden;
}

/* ============================================================================
   Pagination
   ============================================================================ */

.pagination {
  gap: 0.5rem;
}

.page-link {
  border: none;
  border-radius: 6px;
  color: #667eea;
  transition: all 0.3s ease;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
}

.page-link:hover {
  background: #667eea;
  color: white;
  transform: translateY(-2px);
}

.page-item.active .page-link {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-color: transparent;
  box-shadow: var(--shadow-md);
}

/* ============================================================================
   Footer
   ============================================================================ */

footer {
  background: #2c3e50;
  color: #ecf0f1;
  border-top: 2px solid rgba(255, 255, 255, 0.1);
  margin-top: 3rem;
  padding: 2rem 0;
}

footer a {
  transition: all 0.3s ease;
}

footer a:hover {
  color: #ffc107;
  text-decoration: none;
}

footer p {
  margin-bottom: 0.5rem;
}

footer small {
  opacity: 0.8;
}

/* ============================================================================
   Responsive Utilities
   ============================================================================ */

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-gradient {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* ============================================================================
   Custom Animations & Hover Effects
   ============================================================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

/* ============================================================================
   Color Utility Classes
   ============================================================================ */

.green { color: #27ae60; font-weight: 600; }
.red { color: #e74c3c; font-weight: 600; }
.text-muted { color: #6c757d !important; }
.text-dark { color: #2c3e50 !important; }

/* ============================================================================
   Print Styles
   ============================================================================ */

@media print {
  .navbar, footer, .btn, .nav-link {
    display: none !important;
  }
  
  body {
    background: white;
  }
  
  .card {
    break-inside: avoid;
  }
}

/* ============================================================================
   Accessibility Enhancements
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ============================================================================
   Dark Mode Support
   ============================================================================ */

@media (prefers-color-scheme: dark) {
  body {
    background-color: #1a1a1a;
    color: #ecf0f1;
  }
  
  .card {
    background-color: #2c3e50;
    color: #ecf0f1;
  }
  
  .table {
    color: #ecf0f1;
  }
  
  .table thead th {
    background-color: #34495e;
    border-bottom-color: #555;
  }
  
  .form-control, .form-select {
    background-color: #34495e;
    color: #ecf0f1;
    border-color: #555;
  }
  
  .form-control:focus, .form-select:focus {
    background-color: #34495e;
    color: #ecf0f1;
    border-color: #667eea;
  }
}

/* ============================================================================
   Utility Classes
   ============================================================================ */

.shadow-sm {
  box-shadow: var(--shadow-sm) !important;
}

.shadow-md {
  box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
  box-shadow: var(--shadow-lg) !important;
}

.rounded-lg {
  border-radius: 12px !important;
}

.fw-bold {
  font-weight: 700;
}

.fw-semibold {
  font-weight: 600;
}

.container-lg {
  max-width: 1200px;
}

/* ============================================================================
   Responsive Breakpoints
   ============================================================================ */

@media (max-width: 768px) {
  .display-5 {
    font-size: 2.5rem;
  }
  
  .card h2 {
    font-size: 2rem;
  }
  
  .navbar-brand {
    font-size: 1.25rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .table-responsive {
    font-size: 0.9rem;
  }
}

@media (max-width: 576px) {
  .display-5 {
    font-size: 2rem;
  }
  
  .card h2 {
    font-size: 1.5rem;
  }
  
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
  
  .container-lg {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
/* Pagination and Per Page Styling */
#perPageSelect {
  position: relative;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem !important;
}

#perPageSelect::-ms-expand {
  display: none;
}