/* CSS Variables for Color Palette */
:root {
  --primary-color: #393E46;
  --secondary-color: #222831;
  --accent-color: #00ADB5;
  --light-color: #EEEEEE;
  --highlight-color: #FFD369;
  --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  --gradient-secondary: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
  --holographic-gradient: linear-gradient(45deg, 
    rgba(0, 173, 181, 0.1) 0%, 
    rgba(255, 211, 105, 0.1) 25%, 
    rgba(57, 62, 70, 0.1) 50%, 
    rgba(0, 173, 181, 0.1) 75%, 
    rgba(255, 211, 105, 0.1) 100%);
  --shadow-holographic: 0 8px 32px rgba(0, 173, 181, 0.2);
  --border-holographic: 1px solid rgba(255, 211, 105, 0.3);
}

/* Dark Mode Variables */
[data-bs-theme="dark"] {
  --bs-body-bg: var(--secondary-color);
  --bs-body-color: var(--light-color);
  --bs-card-bg: var(--primary-color);
  --bs-border-color: rgba(255, 211, 105, 0.2);
}

/* Global Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  background: linear-gradient(135deg, var(--light-color) 0%, #f8f9fa 100%);
  min-height: 100vh;
  transition: all 0.3s ease;
}

[data-bs-theme="dark"] body {
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
}

/* Holographic Design Elements */
.holographic-card {
  background: var(--holographic-gradient), 
              linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  backdrop-filter: blur(10px);
  border: var(--border-holographic);
  box-shadow: var(--shadow-holographic);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.holographic-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 211, 105, 0.1), 
    transparent);
  transition: left 0.5s ease;
}

.holographic-card:hover::before {
  left: 100%;
}

.holographic-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 173, 181, 0.3);
}

/* Navigation Styles */
.navbar {
  background: var(--gradient-primary) !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Button Styles */
.btn-primary {
  background: var(--gradient-primary);
  border: none;
  box-shadow: 0 4px 15px rgba(0, 173, 181, 0.3);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 173, 181, 0.4);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--highlight-color);
}

/* Form Styles */
.form-control, .form-select {
  border: 2px solid rgba(0, 173, 181, 0.2);
  border-radius: 10px;
  padding: 12px 16px;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.9);
}

.form-control:focus, .form-select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 0.2rem rgba(0, 173, 181, 0.25);
  background: rgba(255, 255, 255, 1);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background: rgba(57, 62, 70, 0.8);
  border-color: rgba(255, 211, 105, 0.3);
  color: var(--light-color);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background: rgba(57, 62, 70, 0.9);
  border-color: var(--highlight-color);
}

.form-label {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 8px;
}

[data-bs-theme="dark"] .form-label {
  color: var(--highlight-color);
}

/* Card Styles */
.card {
  border: none;
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.card-header {
  background: var(--gradient-primary);
  border: none;
  padding: 20px;
}

.card-body {
  padding: 30px;
}

/* Result Cards */
.card.text-center .display-4 {
  margin-bottom: 15px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.card h3 {
  font-weight: 700;
  font-size: 2rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Table Styles */
.table {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.table thead th {
  background: var(--gradient-primary);
  color: white;
  border: none;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table tbody tr:hover {
  background: rgba(0, 173, 181, 0.05);
  transform: scale(1.01);
  transition: all 0.2s ease;
}

[data-bs-theme="dark"] .table tbody tr:hover {
  background: rgba(255, 211, 105, 0.1);
}

/* Tab Styles */
.nav-tabs .nav-link {
  border: none;
  border-radius: 10px 10px 0 0;
  margin-right: 5px;
  transition: all 0.3s ease;
}

.nav-tabs .nav-link.active {
  background: var(--accent-color);
  color: white;
  box-shadow: 0 -3px 10px rgba(0, 173, 181, 0.3);
}

.nav-tabs .nav-link:hover:not(.active) {
  background: rgba(0, 173, 181, 0.1);
}

/* Chart Container */
#inflationChart {
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

/* Loading Spinner */
.spinner-border {
  width: 3rem;
  height: 3rem;
  border-width: 0.3em;
}

/* Ad Banner Styles */
.ad-banner {
  border: 2px dashed #dee2e6;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.ad-banner:hover {
  border-color: var(--accent-color);
  background: rgba(0, 173, 181, 0.05) !important;
}

.ad-placeholder {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

/* Modal Styles */
.modal-content {
  border: none;
  border-radius: 15px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: 15px 15px 0 0;
}

/* Offcanvas Styles */
.offcanvas {
  border: none;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);
}

.offcanvas-header {
  background: var(--gradient-primary);
  color: white;
}

/* Accordion Styles */
.accordion-button {
  background: rgba(0, 173, 181, 0.1);
  border: none;
  border-radius: 10px;
  margin-bottom: 5px;
  font-weight: 600;
}

.accordion-button:not(.collapsed) {
  background: var(--accent-color);
  color: white;
  box-shadow: none;
}

.accordion-button:focus {
  box-shadow: 0 0 0 0.2rem rgba(0, 173, 181, 0.25);
}

.accordion-body {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 0 0 10px 10px;
}

[data-bs-theme="dark"] .accordion-body {
  background: rgba(57, 62, 70, 0.5);
}

/* Footer Styles */
footer {
  background: var(--gradient-secondary) !important;
  margin-top: auto;
}

footer a {
  color: var(--highlight-color) !important;
  transition: all 0.3s ease;
}

footer a:hover {
  color: white !important;
  text-shadow: 0 0 10px var(--highlight-color);
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }
  
  .card-body {
    padding: 20px;
  }
  
  .card h3 {
    font-size: 1.5rem;
  }
  
  .display-4 {
    font-size: 2rem;
  }
  
  .navbar-brand {
    font-size: 1.2rem;
  }
  
  .btn-lg {
    padding: 12px 20px;
  }
}

@media (max-width: 576px) {
  .card-body {
    padding: 15px;
  }
  
  .btn {
    font-size: 0.9rem;
  }
  
  .card h3 {
    font-size: 1.3rem;
  }
  
  .table-responsive {
    font-size: 0.9rem;
  }
}

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

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 173, 181, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(0, 173, 181, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 173, 181, 0);
  }
}

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

.pulse-animation {
  animation: pulse 2s infinite;
}

/* Accessibility Improvements */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus Styles */
.btn:focus,
.form-control:focus,
.form-select:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .holographic-card {
    border: 2px solid var(--accent-color);
    background: white;
  }
  
  [data-bs-theme="dark"] .holographic-card {
    background: var(--secondary-color);
    border: 2px solid var(--highlight-color);
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print Styles */
@media print {
  .navbar,
  .btn,
  .ad-banner,
  footer {
    display: none !important;
  }
  
  .card {
    border: 1px solid #000;
    box-shadow: none;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--light-color);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-track {
  background: var(--secondary-color);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--highlight-color);
}

/* Utility Classes */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-holographic {
  background: var(--holographic-gradient);
}

.border-holographic {
  border: var(--border-holographic);
}

.shadow-holographic {
  box-shadow: var(--shadow-holographic);
}

/* Loading States */
.loading {
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--accent-color);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Error States */
.error {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.error-message {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 5px;
}

/* Success States */
.success {
  border-color: #198754 !important;
  box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25) !important;
}

.success-message {
  color: #198754;
  font-size: 0.875rem;
  margin-top: 5px;
}
