/* Custom Styles for AI Workbook Generator - Bootstrap 5 Compatible */

/* Color Pattern - Sky Blue Freshness - Professional Design System */
:root {
  --baltic-blue: #05668d;
  --steel-blue: #427aa1;
  --alice-blue: #ebf2fa;
  --sage-green: #679436;
  --lime-moss: #a5be00;
  
  /* Color Usage Strategy */
  --primary: var(--baltic-blue);        /* Main actions, headers */
  --secondary: var(--steel-blue);       /* Secondary elements, borders */
  --accent: var(--lime-moss);           /* Highlights, CTAs, active states */
  --success: var(--sage-green);         /* Success states, positive actions */
  --background: var(--alice-blue);      /* Page backgrounds */
  --surface: #ffffff;                   /* Cards, surfaces */
  --text-primary: #1a1a1a;              /* Main text */
  --text-secondary: #6c757d;             /* Secondary text */
}

/* Global Enhancements */
body {
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  background-color: var(--alice-blue);
}

/* Ensure Nunito is used throughout the application */
* {
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* Nunito font weights */
.font-nunito {
  font-family: 'Nunito', sans-serif;
}

.font-nunito-bold {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
}

.font-nunito-normal {
  font-family: 'Nunito', sans-serif;
  font-weight: 400;
}

/* Navbar Enhancements */
.navbar-brand {
  font-weight: 600;
  font-size: 1.25rem;
}

.navbar-dark.bg-primary {
  background: linear-gradient(135deg, var(--baltic-blue) 0%, var(--steel-blue) 50%, var(--sage-green) 100%) !important;
  box-shadow: 0 2px 10px rgba(5, 102, 141, 0.2);
  position: relative;
  overflow: hidden;
}

.navbar-dark.bg-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: shimmer 5s infinite;
}

/* Sidebar Navigation */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 280px;
  background: linear-gradient(180deg, var(--baltic-blue) 0%, var(--steel-blue) 50%, var(--sage-green) 100%);
  color: white;
  padding: 0;
  z-index: 1000;
  box-shadow: 2px 0 20px rgba(5, 102, 141, 0.3);
  transition: transform 0.3s ease;
  overflow-y: auto;
  position: fixed;
  float: left;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(165, 190, 0, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(0, 0, 0, 0.1);
}

.sidebar-header h4 {
  margin: 0;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-nav {
  padding: 1rem 0;
}

.sidebar-nav .nav-item {
  margin: 0.25rem 0;
}

.sidebar-nav .nav-link {
  color: rgba(255, 255, 255, 0.9);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.sidebar-nav .nav-link {
  position: relative;
  overflow: hidden;
}

.sidebar-nav .nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(165, 190, 0, 0.2) 0%, rgba(103, 148, 54, 0.1) 100%);
  transition: width 0.3s ease;
}

.sidebar-nav .nav-link:hover::before,
.sidebar-nav .nav-link.active::before {
  width: 100%;
}

.sidebar-nav .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: white;
  border-left-color: var(--lime-moss);
  transform: translateX(5px);
}

.sidebar-nav .nav-link.active {
  background-color: rgba(165, 190, 0, 0.15);
  color: white;
  border-left-color: var(--lime-moss);
  font-weight: 600;
  box-shadow: inset 0 0 20px rgba(165, 190, 0, 0.1);
}

.sidebar-nav .nav-link i {
  transition: transform 0.3s ease, color 0.3s ease;
}

.sidebar-nav .nav-link:hover i {
  transform: scale(1.2) rotate(5deg);
  color: var(--lime-moss);
}

.sidebar-nav .nav-link.active i {
  color: var(--lime-moss);
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.sidebar-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(0, 0, 0, 0.1);
}

.main-content {
  margin-left: 280px;
  min-height: 100vh;
  background-color: var(--alice-blue);
  transition: margin-left 0.3s ease;
}

.main-content.no-sidebar {
  margin-left: 0;
}

/* Auth Pages Layout - Professional Design */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--alice-blue) 0%, rgba(235, 242, 250, 0.5) 50%, rgba(103, 148, 54, 0.05) 100%);
  position: relative;
  overflow: hidden;
  background-image: 
    url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(5,102,141,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>'),
    radial-gradient(circle at 20% 50%, rgba(5, 102, 141, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(103, 148, 54, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(165, 190, 0, 0.06) 0%, transparent 50%);
  background-size: 100px 100px, 600px 600px, 500px 500px, 400px 400px;
  background-position: 0 0, 0 0, 100% 100%, 50% 0;
}

.auth-container::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(5, 102, 141, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 20s ease-in-out infinite;
}

.auth-container::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(165, 190, 0, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 25s ease-in-out infinite reverse;
}

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

.auth-wrapper {
  display: flex;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(5, 102, 141, 0.15);
  overflow: hidden;
  min-height: 600px;
}

.auth-image {
  flex: 1;
  background: linear-gradient(135deg, var(--baltic-blue) 0%, var(--steel-blue) 50%, var(--sage-green) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

.auth-image::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
  animation: pulse 15s ease-in-out infinite;
}

.auth-image::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -30%;
  width: 150%;
  height: 150%;
  background: radial-gradient(circle, rgba(165, 190, 0, 0.2) 0%, transparent 60%);
  animation: pulse 20s ease-in-out infinite reverse;
}

@keyframes pulse {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.5; }
  50% { transform: scale(1.2) rotate(180deg); opacity: 0.8; }
}

/* Animated Icon Container */
.auth-icon-wrapper {
  position: relative;
  z-index: 2;
  margin-bottom: 2rem;
}

.auth-icon-wrapper i {
  font-size: 8rem;
  color: white;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
  animation: iconFloat 3s ease-in-out infinite;
  display: inline-block;
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

.auth-icon-wrapper::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  animation: ripple 3s ease-out infinite;
}

@keyframes ripple {
  0% { transform: translate(-50%, -50%) scale(0.8); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

.auth-image-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: white;
}

.auth-image-content i {
  font-size: 8rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.auth-image-content h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.auth-image-content p {
  font-size: 1.1rem;
  opacity: 0.9;
  line-height: 1.6;
}

.auth-form-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.auth-form {
  width: 100%;
  max-width: 450px;
}

.auth-form h3 {
  color: var(--baltic-blue);
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-size: 2rem;
}

.auth-form p {
  color: #6c757d;
  margin-bottom: 2rem;
}

.auth-form .form-label {
  color: var(--baltic-blue);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.auth-form .form-control {
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

.auth-form .form-control:focus {
  border-color: var(--steel-blue);
  box-shadow: 0 0 0 0.2rem rgba(66, 122, 161, 0.25);
}

.auth-form .btn-primary {
  background: linear-gradient(135deg, var(--baltic-blue) 0%, var(--steel-blue) 50%, var(--sage-green) 100%);
  border: none;
  border-radius: 12px;
  padding: 0.875rem 2.5rem;
  font-weight: 600;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(5, 102, 141, 0.3);
}

.auth-form .btn-primary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.auth-form .btn-primary:hover::before {
  width: 300px;
  height: 300px;
}

.auth-form .btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(5, 102, 141, 0.4);
}

.auth-form .btn-primary:active {
  transform: translateY(-1px) scale(0.98);
}

.auth-form .btn-outline-primary {
  border-color: var(--steel-blue);
  color: var(--steel-blue);
  border-radius: 10px;
  padding: 0.75rem 2rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.auth-form .btn-outline-primary:hover {
  background-color: var(--steel-blue);
  color: white;
  transform: translateY(-2px);
}

.auth-links {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e0e0e0;
}

.auth-links a {
  color: var(--steel-blue);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.auth-links a:hover {
  color: var(--baltic-blue);
}

@media (max-width: 992px) {
  .auth-wrapper {
    flex-direction: column;
  }
  
  .auth-image {
    min-height: 300px;
  }
  
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.show {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
}

/* Card Enhancements */
.hover-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-radius: 12px;
}

.hover-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0.5rem 1rem rgba(5, 102, 141, 0.2) !important;
}

.card {
  border-radius: 12px;
  border: none;
  box-shadow: 0 2px 8px rgba(5, 102, 141, 0.1);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(5, 102, 141, 0.15);
}

.card-header.bg-primary {
  background: linear-gradient(135deg, var(--baltic-blue) 0%, var(--steel-blue) 50%, var(--sage-green) 100%) !important;
  border-radius: 12px 12px 0 0 !important;
  position: relative;
  overflow: hidden;
}

.card-header.bg-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.card-header {
  border-bottom: 2px solid rgba(235, 242, 250, 0.3);
  font-weight: 600;
}

/* Section Cards */
.section-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.section-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-prompt {
  margin-bottom: 1rem;
}

.section-prompt label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #6c757d;
}

.section-prompt textarea {
  min-height: 80px;
  resize: vertical;
}

.section-output {
  margin-top: 1rem;
}

.section-output label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #6c757d;
}

.section-output textarea {
  min-height: 150px;
  resize: vertical;
  font-family: inherit;
}

.word-count {
  font-size: 0.875rem;
  color: #6c757d;
  margin-top: 0.5rem;
}

/* Image Upload Styles */
.section-image {
  margin-bottom: 1rem;
}

.image-preview {
  margin-top: 0.75rem;
}

.image-preview img {
  max-width: 100%;
  height: auto;
  border-radius: 0.375rem;
  border: 1px solid #dee2e6;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.image-placeholder {
  color: #adb5bd;
  font-size: 0.9rem;
  padding: 1rem;
  text-align: center;
  border: 2px dashed #dee2e6;
  border-radius: 0.375rem;
  background-color: #f8f9fa;
}

/* Button Enhancements */
.btn-generate {
  background-color: var(--sage-green);
  border-color: var(--sage-green);
  color: white;
}

.btn-generate:hover:not(:disabled) {
  background-color: var(--lime-moss);
  border-color: var(--lime-moss);
  color: white;
}

.btn-primary {
  background: linear-gradient(135deg, var(--baltic-blue) 0%, var(--steel-blue) 100%);
  border: none;
  color: white;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.5s, height 0.5s;
}

.btn-primary:hover::after {
  width: 300px;
  height: 300px;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--steel-blue) 0%, var(--baltic-blue) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(5, 102, 141, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, var(--sage-green) 0%, var(--lime-moss) 100%);
  border: none;
  color: white;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-success:hover {
  background: linear-gradient(135deg, var(--lime-moss) 0%, var(--sage-green) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(103, 148, 54, 0.4);
}

.btn-outline-primary {
  border: 2px solid var(--steel-blue);
  color: var(--steel-blue);
  background: transparent;
  transition: all 0.3s ease;
}

.btn-outline-primary:hover {
  background: linear-gradient(135deg, var(--steel-blue) 0%, var(--baltic-blue) 100%);
  border-color: var(--baltic-blue);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(66, 122, 161, 0.3);
}

.btn-generate.loading {
  opacity: 0.7;
  cursor: wait;
  position: relative;
}

.btn-generate.loading::before {
  content: '';
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 0.5rem;
  vertical-align: middle;
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 0.5rem;
  vertical-align: middle;
}

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

/* Custom Bootstrap Toast Styles */
.toast {
  min-width: 300px;
  max-width: 400px;
}

.toast.error {
  background-color: #f8d7da;
  color: #721c24;
  border-left: 4px solid #dc3545;
}

.toast.success {
  background-color: #d1e7dd;
  color: #0f5132;
  border-left: 4px solid #198754;
}

.toast.info {
  background-color: #cfe2ff;
  color: #084298;
  border-left: 4px solid #0d6efd;
}

.toast.warning {
  background-color: #fff3cd;
  color: #664d03;
  border-left: 4px solid #ffc107;
}

/* Modal Enhancements */
.modal-content {
  border: none;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.section-modal {
  display: flex;
  gap: 1.5rem;
  min-height: 400px;
}

.section-modal__content {
  flex: 1;
}

.section-modal__content pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  background-color: #f8f9fa;
  padding: 1rem;
  border-radius: 0.375rem;
  border: 1px solid #dee2e6;
  font-size: 0.9rem;
  max-height: 500px;
  overflow-y: auto;
}

.section-modal__versions {
  width: 250px;
  border-left: 1px solid #dee2e6;
  padding-left: 1.5rem;
}

.version-item {
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  background-color: #f8f9fa;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.version-item:hover {
  background-color: #e9ecef;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6c757d;
}

/* Form Enhancements */
.form-control:focus,
.form-select:focus {
  border-color: var(--steel-blue);
  box-shadow: 0 0 0 0.25rem rgba(66, 122, 161, 0.25);
}

.form-control,
.form-select {
  border-radius: 8px;
  border: 2px solid #e0e0e0;
  transition: all 0.3s ease;
}

.form-control:hover,
.form-select:hover {
  border-color: var(--steel-blue);
}

.table {
  border-radius: 8px;
  overflow: hidden;
}

.table thead {
  background: linear-gradient(135deg, var(--alice-blue) 0%, rgba(235, 242, 250, 0.8) 100%);
}

.table-hover tbody tr {
  transition: all 0.3s ease;
}

.table-hover tbody tr:hover {
  background: linear-gradient(90deg, var(--alice-blue) 0%, rgba(235, 242, 250, 0.5) 100%);
  cursor: pointer;
  transform: scale(1.01);
  box-shadow: 0 2px 8px rgba(5, 102, 141, 0.1);
}

.table-hover tbody tr:hover td {
  color: var(--baltic-blue);
  font-weight: 500;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-title {
    width: 100%;
  }

  .section-modal {
    flex-direction: column;
  }

  .section-modal__versions {
    width: 100%;
    border-left: none;
    border-top: 1px solid #dee2e6;
    padding-left: 0;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
  }

  .toast {
    min-width: 280px;
    max-width: calc(100vw - 2rem);
  }
}

/* Animation for smooth transitions */
@media (prefers-reduced-motion: no-preference) {
  * {
    transition-duration: 0.2s;
    transition-timing-function: ease;
  }
}

/* Print Styles */
@media print {
  .navbar,
  .btn,
  .toast-container {
    display: none !important;
  }

  .section-card {
    page-break-inside: avoid;
  }
}

/* Accessibility Enhancements */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
  outline: 2px solid var(--steel-blue);
  outline-offset: 2px;
}

/* Breadcrumb Enhancements */
.breadcrumb {
  background-color: white;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(5, 102, 141, 0.1);
}

.breadcrumb-item a {
  color: var(--steel-blue);
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
  color: var(--baltic-blue);
}

/* Alert Enhancements */
.alert-info {
  background-color: var(--alice-blue);
  border-color: var(--steel-blue);
  color: var(--baltic-blue);
}

.alert-success {
  background-color: rgba(103, 148, 54, 0.1);
  border-color: var(--sage-green);
  color: var(--sage-green);
}

.alert-warning {
  background-color: rgba(255, 193, 7, 0.1);
  border-color: #ffc107;
  color: #856404;
}

.alert-danger {
  background-color: rgba(220, 53, 69, 0.1);
  border-color: #dc3545;
  color: #721c24;
}

/* Badge Enhancements */
.badge {
  border-radius: 6px;
  padding: 0.35em 0.65em;
}

.bg-primary {
  background-color: var(--baltic-blue) !important;
}

.text-primary {
  color: var(--baltic-blue) !important;
}

/* Spinner Enhancements */
.spinner-border.text-primary {
  color: var(--baltic-blue) !important;
}

/* Modal Enhancements */
.modal-header {
  background: linear-gradient(135deg, var(--baltic-blue) 0%, var(--steel-blue) 50%, var(--sage-green) 100%);
  color: white;
  border-radius: 12px 12px 0 0;
  position: relative;
  overflow: hidden;
}

.modal-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  animation: shimmer 4s infinite;
}

.modal-header .btn-close {
  filter: invert(1);
  transition: transform 0.3s ease;
}

.modal-header .btn-close:hover {
  transform: rotate(90deg) scale(1.1);
}

/* Section Icons Mapping (for future use) */
.section-icon {
  font-size: 1.25rem;
  margin-right: 0.5rem;
  transition: all 0.3s ease;
}

.section-icon:hover {
  transform: scale(1.2) rotate(10deg);
  color: var(--lime-moss);
}

/* Animated Background Elements */
.animated-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.animated-bg::before,
.animated-bg::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  opacity: 0.1;
  animation: float 20s infinite ease-in-out;
}

.animated-bg::before {
  width: 300px;
  height: 300px;
  background: var(--baltic-blue);
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.animated-bg::after {
  width: 200px;
  height: 200px;
  background: var(--sage-green);
  bottom: 10%;
  right: 10%;
  animation-delay: 5s;
}

/* Professional Card Hover Effects */
.card-hover-lift {
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-hover-lift:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 40px rgba(5, 102, 141, 0.2);
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, var(--baltic-blue) 0%, var(--steel-blue) 50%, var(--sage-green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* Animated Icon Spinner */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.icon-spin {
  animation: spin 2s linear infinite;
}

.icon-bounce {
  animation: bounce 1s ease-in-out infinite;
}

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

/* Professional Loading States */
.loading-shimmer {
  background: linear-gradient(90deg, 
    var(--alice-blue) 0%, 
    rgba(255, 255, 255, 0.5) 50%, 
    var(--alice-blue) 100%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* Status Indicators with Colors */
.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  animation: pulse-dot 2s ease-in-out infinite;
}

.status-indicator.success {
  background-color: var(--sage-green);
  box-shadow: 0 0 10px rgba(103, 148, 54, 0.5);
}

.status-indicator.warning {
  background-color: var(--lime-moss);
  box-shadow: 0 0 10px rgba(165, 190, 0, 0.5);
}

.status-indicator.info {
  background-color: var(--steel-blue);
  box-shadow: 0 0 10px rgba(66, 122, 161, 0.5);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.2); }
}

/* Enhanced Nav Pills */
.nav-pills .nav-link {
  border-radius: 8px;
  transition: all 0.3s ease;
  margin: 0 0.25rem;
}

.nav-pills .nav-link:hover {
  background-color: var(--alice-blue);
  transform: translateY(-2px);
}

.nav-pills .nav-link.active {
  background: linear-gradient(135deg, var(--baltic-blue) 0%, var(--steel-blue) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(5, 102, 141, 0.3);
}

/* File Upload Area */
.cursor-pointer {
  cursor: pointer;
}

/* Enhanced Course Cards */
.course-card {
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(5, 102, 141, 0.2) !important;
}

/* Loading Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Enhanced Empty States */
.empty-state-enhanced {
  padding: 4rem 2rem;
  text-align: center;
}

.empty-state-enhanced i {
  opacity: 0.3;
  animation: iconFloat 3s ease-in-out infinite;
}

/* Enhanced Modal Design */
.modal-content {
  border-radius: 16px;
  overflow: hidden;
}

.modal-body {
  padding: 2rem;
}

/* Enhanced Form Labels */
.form-label.fw-bold {
  color: var(--baltic-blue);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

/* Enhanced Badges */
.badge.rounded-pill {
  padding: 0.5em 1em;
  font-weight: 500;
}

/* Smooth Page Transitions */
.page-transition {
  animation: fadeInUp 0.6s ease-out;
}

/* Enhanced Loading States */
.spinner-border {
  border-width: 3px;
}

/* Creative Hover Effects for Cards */
.card-hover-lift:hover .bg-primary,
.card-hover-lift:hover .bg-success,
.card-hover-lift:hover .bg-info {
  transform: scale(1.1);
  transition: transform 0.3s ease;
}

/* Gradient Backgrounds for Sections */
.section-gradient-bg {
  background: linear-gradient(135deg, var(--alice-blue) 0%, rgba(235, 242, 250, 0.3) 100%);
  border-radius: 12px;
  padding: 1.5rem;
}

/* Enhanced Button Groups */
.btn-group-sm .btn {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

/* Creative Icon Animations */
@keyframes iconRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.icon-rotate:hover {
  animation: iconRotate 0.6s ease-in-out;
}

/* Enhanced Table Design */
.table thead th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  color: var(--baltic-blue);
}

/* Creative Divider */
.creative-divider {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--steel-blue), transparent);
  margin: 2rem 0;
}

/* Enhanced Dashboard Cards */
.dashboard-stat-card {
  position: relative;
  overflow: hidden;
}

.dashboard-stat-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(5, 102, 141, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  transition: transform 0.5s ease;
}

.dashboard-stat-card:hover::before {
  transform: scale(1.5);
}

/* Enhanced Page Headers */
.page-header-gradient {
  position: relative;
  overflow: hidden;
}

.page-header-gradient::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--lime-moss), var(--sage-green), var(--steel-blue), var(--baltic-blue));
  animation: shimmer 3s linear ;
}

/* Creative Input Focus States */
.form-control:focus {
  border-color: var(--steel-blue);
  box-shadow: 0 0 0 0.25rem rgba(66, 122, 161, 0.15), 0 4px 12px rgba(5, 102, 141, 0.1);
  transform: translateY(-1px);
  transition: all 0.3s ease;
}

/* Enhanced Card Shadows */
.card {
  box-shadow: 0 2px 12px rgba(5, 102, 141, 0.08);
}

.card:hover {
  box-shadow: 0 8px 30px rgba(5, 102, 141, 0.15);
}

/* Creative Badge Styles */
.badge {
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* Enhanced Empty States */
#empty-state {
  background: linear-gradient(135deg, var(--alice-blue) 0%, rgba(235, 242, 250, 0.3) 100%);
  border-radius: 16px;
}

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

/* Enhanced Navigation Active States */
.sidebar-nav .nav-link.active {
  position: relative;
}

.sidebar-nav .nav-link.active::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  background: var(--lime-moss);
  border-radius: 2px 0 0 2px;
  box-shadow: -2px 0 8px rgba(165, 190, 0, 0.4);
}

/* Creative Button Styles */
.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Enhanced Table Design */
.table-hover tbody tr {
  border-left: 3px solid transparent;
  transition: all 0.3s ease;
}

.table-hover tbody tr:hover {
  border-left-color: var(--steel-blue);
  background: linear-gradient(90deg, var(--alice-blue) 0%, rgba(235, 242, 250, 0.5) 100%);
}

/* Creative Alert Styles */
.alert {
  border-radius: 12px;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Enhanced Breadcrumb */
.breadcrumb-item + .breadcrumb-item::before {
  content: "›";
  color: var(--steel-blue);
  font-weight: bold;
}

/* Creative Progress Indicators */
.progress {
  height: 8px;
  border-radius: 10px;
  background-color: var(--alice-blue);
}

.progress-bar {
  background: linear-gradient(90deg, var(--baltic-blue) 0%, var(--steel-blue) 50%, var(--sage-green) 100%);
  border-radius: 10px;
}

/* Enhanced Dropdowns */
.dropdown-menu {
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(5, 102, 141, 0.15);
  border: none;
  padding: 0.5rem;
}

.dropdown-item {
  border-radius: 8px;
  margin: 0.25rem 0;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background: var(--alice-blue);
  transform: translateX(5px);
}

/* Creative Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--alice-blue);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--baltic-blue) 0%, var(--steel-blue) 100%);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--steel-blue) 0%, var(--sage-green) 100%);
}

i.fas {
  color: #679436;
}

/* PDF Preview Slide Panel - Slide from right animation */
.pdf-preview-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 832px;
  height: 100vh;
  z-index: 9999;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.pdf-preview-panel.show {
  right: 0;
}

.pdf-preview-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: -1;
}

.pdf-preview-panel.show .pdf-preview-overlay {
  opacity: 1;
  visibility: visible;
}

.pdf-preview-content {
  background-color: #ffffff;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.pdf-preview-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e0e0e0;
  background-color: #f8f9fa;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.pdf-preview-header h5 {
  color: var(--baltic-blue);
  font-weight: 600;
  margin: 0;
}

.pdf-preview-body {
  flex: 1;
  overflow: auto;
  padding: 0;
  background-color: #f5f5f5;
}

.pdf-preview-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.pdf-preview-body .preview-html-content {
  width: 100%;
  min-height: 100%;
  padding: 2rem;
  background-color: #ffffff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .pdf-preview-panel {
    max-width: 100vw;
  }
}