/* Modern Glassmorphism and Sky Blue Gradient Design */

body {
  padding-top: 67px;
  font-family: "Plus Jakarta Sans", sans-serif;
  background: linear-gradient(135deg, #7dd3fc 0%, #0ea5e9 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.75;
  position: relative;
  overflow-x: hidden;
}

body.home-page {
  padding-top: 67px;
  padding-bottom: 0;
}

.home-footer footer {
  margin-top: 0 !important;
}


/* Wave decoration - top right */
body::before {
  content: "";
  position: fixed;
  top: -15%;
  right: -10%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(186, 230, 253, 0.6) 0%, rgba(147, 197, 253, 0.4) 30%, transparent 70%);
  border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  pointer-events: none;
  z-index: 1;
  animation: wave-float 20s ease-in-out infinite;
  filter: blur(2px);
}

/* Wave decoration - bottom left */
body::after {
  content: "";
  position: fixed;
  bottom: -15%;
  left: -10%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(125, 211, 252, 0.5) 0%, rgba(56, 189, 248, 0.3) 30%, transparent 70%);
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  pointer-events: none;
  z-index: 1;
  animation: wave-float 18s ease-in-out infinite reverse;
  filter: blur(2px);
}

@keyframes wave-float {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(30px, -30px) rotate(5deg);
  }
  66% {
    transform: translate(-20px, 20px) rotate(-5deg);
  }
}

/* Navigation with glassmorphism */
.navbar {
  background: rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px 0 rgba(14, 165, 233, 0.15);
  z-index: 1000;
}

.navbar-dark .navbar-brand {
  color: #fff;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-dark .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.9);
  transition: all 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link:hover {
  color: #fff;
  transform: translateY(-2px);
}

/* Dropdown with glassmorphism */
.dropdown-menu {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
  position: absolute;
  left: auto;
  right: auto;
}

/* Auto adjust dropdown position to prevent overflow */
.navbar-nav .dropdown-menu {
  margin: 0;
}

/* Right-align dropdown if it would overflow on the right */
@media (min-width: 992px) {
  .navbar-nav > li:nth-last-child(-n+2) .dropdown-menu {
    right: 0;
    left: auto;
  }
}

.dropdown-item {
  color: #333;
  transition: all 0.3s ease;
}

.dropdown-item:hover {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(125, 211, 252, 0.1));
  transform: translateX(5px);
}

.left-aligned {
  margin-left: auto;
}

.bg-dark {
  background: rgba(52, 58, 64, 0.9) !important;
  backdrop-filter: blur(10px);
}

/* Hero section with modern gradient */
.bg-hero {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  position: relative;
  overflow: hidden;
  z-index: 5;
}


/* Content containers with glassmorphism */
.container.content {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 30px;
  margin-top: 50px;
  margin-bottom: 50px;
  box-shadow: 0 20px 40px rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
  z-index: 5;
}

/* Full width content for home page */
.container-fluid.content-full-width {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 0;
  padding: 0;
  margin-top: 0;
  margin-bottom: 0;
  box-shadow: none;
  border: none;
  position: relative;
  z-index: 5;
  max-width: 100%;
  min-height: calc(100vh - 67px);
}

.container-fluid.content-full-width .row {
  margin: 0;
}

.container-fluid.content-full-width .col-12 {
  padding: 0;
}

@media (max-width: 768px) {
  .container-fluid.content-full-width {
    padding: 0;
  }
}

/* Modern cards */
.card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 15px;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.25);
}

/* CALLOUT with glassmorphism */
.bd-callout {
  padding: 1.25rem;
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-left-width: 0.25rem;
  border-radius: 10px;
  box-shadow: 0 4px 16px 0 rgba(31, 38, 135, 0.1);
}

.bd-callout h4 {
  margin-bottom: 0.25rem;
  color: #333;
}

.bd-callout p:last-child {
  margin-bottom: 0;
}

.bd-callout code {
  border-radius: 0.25rem;
  background: rgba(255, 255, 255, 0.8);
  padding: 2px 5px;
}

.bd-callout + .bd-callout {
  margin-top: -0.25rem;
}

.bd-callout-info {
  border-left-color: #0ea5e9;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(255, 255, 255, 0.6));
}

.bd-callout-warning {
  border-left-color: #f0ad4e;
  background: linear-gradient(135deg, rgba(240, 173, 78, 0.1), rgba(255, 255, 255, 0.6));
}

.bd-callout-danger {
  border-left-color: #d9534f;
  background: linear-gradient(135deg, rgba(217, 83, 79, 0.1), rgba(255, 255, 255, 0.6));
}

/* Modern buttons */
.btn {
  border-radius: 50px;
  padding: 10px 25px;
  transition: all 0.3s ease;
  border: none;
  box-shadow: 0 4px 15px 0 rgba(31, 38, 135, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
}

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

/* Links with gradient hover effect */
a {
  color: #0284c7;
  transition: all 0.3s ease;
  position: relative;
}

a:hover {
  color: #0369a1;
}

/* Tables with enhanced sky blue glassmorphism design */
table {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(14, 165, 233, 0.2);
  box-shadow: 0 8px 32px rgba(14, 165, 233, 0.1);
  margin: 20px 0;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

/* Table header with sky blue gradient */
thead {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  position: relative;
}

thead::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  pointer-events: none;
}

/* Table header cells */
thead th {
  color: white;
  font-weight: 600;
  padding: 15px 20px;
  text-align: center;
  font-size: 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: none;
  position: relative;
  z-index: 1;
}

thead th:first-child {
  border-top-left-radius: 12px;
}

thead th:last-child {
  border-top-right-radius: 12px;
}

/* Table body */
tbody {
  background: rgba(255, 255, 255, 0.9);
}

/* Table rows */
tbody tr {
  border-bottom: 1px solid rgba(14, 165, 233, 0.1);
}

tbody tr:last-child {
  border-bottom: none;
}

/* Table data cells */
tbody td {
  padding: 12px 20px;
  color: #374151;
  border: none;
  font-size: 14px;
  line-height: 1.5;
}

tbody tr:last-child td:first-child {
  border-bottom-left-radius: 12px;
}

tbody tr:last-child td:last-child {
  border-bottom-right-radius: 12px;
}

/* Alternating row colors */
tbody tr:nth-child(even) {
  background: rgba(14, 165, 233, 0.02);
}

/* Table responsive wrapper */
.table-responsive {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(14, 165, 233, 0.1);
}

/* Small tables */
.table-sm th,
.table-sm td {
  padding: 8px 15px;
  font-size: 13px;
}

/* Table with borders */
.table-bordered {
  border: 2px solid rgba(14, 165, 233, 0.2);
}

.table-bordered th,
.table-bordered td {
  border: 1px solid rgba(14, 165, 233, 0.15);
}

/* Dark table variant */
.table-dark {
  background: linear-gradient(135deg, #0c4a6e 0%, #075985 100%);
  color: white;
}

.table-dark thead th {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.2);
}


/* Success table variant */
.table-success {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(2, 132, 199, 0.05));
}

.table-success thead {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

/* Footer with gradient */
footer {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  padding: 30px 0;
  margin-top: 50px;
  box-shadow: 0 -5px 20px 0 rgba(14, 165, 233, 0.15);
  position: relative;
  z-index: 5;
}

footer a {
  color: white;
  font-weight: bold;
  text-decoration: none;
  transition: all 0.3s ease;
}

footer a:hover {
  color: white;
  text-decoration: underline;
  transform: translateY(-2px);
}

/* Form inputs with glassmorphism */
.form-control {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.form-control:focus {
  background: rgba(255, 255, 255, 0.9);
  border-color: #0ea5e9;
  box-shadow: 0 0 0 0.2rem rgba(14, 165, 233, 0.25);
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Section spacing */
h3 {
  margin-top: 64px;
  margin-bottom: 16px;
}

h3:first-child {
  margin-top: 0;
}

/* Global image max size (both width and height) */
img {
  max-width: min(768px, 100%) !important;
  max-height: min(768px, 100vh) !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}

/* Content container images */
.container.content img {
  max-width: min(768px, 100%) !important;
  max-height: min(768px, 100vh) !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}

/* Image caption styling - width matches image */
.container.content div[style*="text-align: center"] p[style*="color: #6c757d"] {
  max-width: min(768px, 100%);
  margin-left: auto;
  margin-right: auto;
  display: block;
  text-align: center;
  word-wrap: break-word;
}

/* Reference target highlight effect */
:target {
  animation: referenceTextGlow 3s ease-out;
  scroll-margin-top: 100px;
}

@keyframes referenceTextGlow {
  0%, 67% {
    color: #0284c7;
    text-shadow: 0 0 15px rgba(14, 165, 233, 0.8), 0 0 25px rgba(14, 165, 233, 0.5);
  }
  100% {
    color: inherit;
    text-shadow: none;
  }
}

/* Selection color */
::selection {
  background: rgba(15, 23, 42, 0.95);
  color: #fff;
}

::-moz-selection {
  background: rgba(15, 23, 42, 0.95);
  color: #fff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .container.content {
    border-radius: 0;
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
    padding: 20px;
    max-width: 100%;
    width: 100%;
  }

  .navbar {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .container.content {
    margin-left: 24px;
    margin-right: 24px;
    max-width: calc(100% - 48px);
    width: calc(100% - 48px);
  }
}

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

.container.content > * {
  animation: fadeIn 0.6s ease-out;
}

/* Code blocks with modern style */
pre {
  background: rgba(52, 58, 64, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(52, 58, 64, 0.1);
  border-radius: 10px;
  padding: 15px;
}

code {
  background: rgba(14, 165, 233, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  color: #0284c7;
}

/* Math equation center alignment */
.math-center {
  text-align: center;
  margin: 1.5em 0;
  display: block;
}