/* ===== MODERN ELEARNING DESIGN ===== */

/* Variables & Base Styling */
:root {
  --primary-color: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #3b82f6;
  --secondary-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --light-bg: #f9fafb;
  --card-bg: #ffffff;
  --border-color: #e5e7eb;
  --text-dark: #111827;
  --text-light: #6b7280;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--light-bg);
  color: var(--text-dark);
  padding-top: 60px;
  line-height: 1.6;
}

/* ===== NAVBAR STYLING ===== */
.navbar {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  box-shadow: var(--shadow-lg);
  z-index: 1030 !important;
  padding: 0.75rem 1rem;
  border-bottom: 3px solid var(--secondary-color);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.5px;
  color: white !important;
  transition: transform 0.3s ease;
}

.navbar-brand:hover {
  transform: translateX(5px);
}

#sidebarToggle {
  border: none;
  color: white;
  font-size: 1.25rem;
  padding: 0.5rem 0.75rem;
  transition: all 0.3s ease;
  margin-right: 0.5rem;
}

#sidebarToggle:hover {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 0.375rem;
  transform: scale(1.1);
}

.nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
  transition: all 0.3s ease;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
}

.nav-link:hover {
  color: white !important;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 0.375rem;
}

/* ===== LAYOUT STRUCTURE ===== */
#wrapper {
  display: flex;
  min-height: calc(100vh - 60px);
  position: relative;
}

#sidebar {
  position: fixed;
  top: 60px;
  left: 0;
  bottom: 0;
  width: 260px;
  background: var(--card-bg);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 1020;
  box-shadow: var(--shadow-md);
}

#sidebar::-webkit-scrollbar {
  width: 6px;
}

#sidebar::-webkit-scrollbar-track {
  background: transparent;
}

#sidebar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

#content {
  flex: 1;
  margin-left: 260px;
  padding: 2rem;
  width: calc(100% - 260px);
  transition: all 0.3s ease;
  min-height: calc(100vh - 60px);
}

/* Sidebar Toggle States */
#sidebar.toggled {
  transform: translateX(-100%);
}

#content.sidebar-collapsed {
  margin-left: 0;
  width: 100%;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1010;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile: Sidebar close button inside sidebar header */
.sidebar-close {
  position: absolute;
  top: 10px;
  right: 12px;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 992px) {
  .sidebar-close { display: none !important; }
}

/* ===== SIDEBAR MENU STYLING ===== */

/* ===== HERO / DASHBOARD STYLES ===== */
.hero-card {
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(2,6,23,0.08);
  border-left: 6px solid var(--primary-color);
  background: linear-gradient(180deg, rgba(37,99,235,0.04), rgba(255,255,255,0.02));
}

.hero-card .avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.stat-card {
  border-radius: 0.75rem;
  padding: 0;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stat-card .card-body {
  padding: 1.25rem 1rem;
}

.stat-card .fa-2x { font-size: 1.75rem !important; }

.stat-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.small-action {
  font-size: 0.85rem;
}

.sidebar-heading {
  padding: 1.5rem 1.5rem 1rem;
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  border-bottom: 2px solid var(--border-color);
}

.list-group {
  border: none;
  padding: 0.5rem 0;
}

.list-group-item {
  border: none;
  border-left: 3px solid transparent;
  padding: 1rem 1.5rem;
  color: var(--text-dark);
  background-color: transparent;
  transition: all 0.3s ease;
  font-weight: 500;
}

.list-group-item:hover {
  background-color: var(--light-bg);
  border-left-color: var(--primary-color);
  padding-left: 1.75rem;
  color: var(--primary-color);
}

.list-group-item.active {
  background-color: var(--light-bg);
  border-left-color: var(--primary-color);
  color: var(--primary-color);
  font-weight: 600;
}

/* ===== CONTENT STYLING ===== */
#content {
  _animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

#content h1, #content h2, #content h3, #content h4 {
  color: var(--text-dark);
  font-weight: 700;
  margin-bottom: 1.5rem;
  margin-top: 2rem;
}

#content h1 { font-size: 2rem; }
#content h2 { font-size: 1.75rem; }
#content h3 { font-size: 1.5rem; }

/* ===== CARD STYLING ===== */
.card {
  border: none;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  background-color: var(--card-bg);
  border-top: 3px solid var(--primary-color);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-header {
  background-color: var(--light-bg);
  border-bottom: 1px solid var(--border-color);
  border-radius: 0.5rem 0.5rem 0 0;
  font-weight: 600;
  color: var(--text-dark);
}

.card-body {
  padding: 1.75rem;
}

/* ===== BUTTON STYLING ===== */
.btn {
  border-radius: 0.375rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  transition: all 0.3s ease;
  border: none;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #1d3a8a 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background-color: #059669;
  color: white;
  transform: translateY(-2px);
}

.btn-danger {
  background-color: var(--danger-color);
  color: white;
}

.btn-danger:hover {
  background-color: #dc2626;
  color: white;
}

.btn-outline-primary {
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline-primary:hover {
  background-color: var(--primary-color);
  color: white;
}

/* ===== TABLE STYLING ===== */
.table {
  background-color: var(--card-bg);
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table thead th {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  color: var(--text-dark);
  font-weight: 700;
  border-bottom: 2px solid var(--border-color);
  padding: 1rem;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
}

.table tbody td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-light);
}

.table tbody tr {
  transition: background-color 0.2s ease;
}

.table tbody tr:hover {
  background-color: var(--light-bg);
}

.table-bordered {
  border: none;
}

/* ===== FORM STYLING ===== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-control, .form-select, textarea {
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.form-control:focus, .form-select:focus, textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.form-label {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  display: block;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.5;
}

.form-label i {
  margin-right: 0.4rem;
  display: inline;
  vertical-align: text-bottom;
}

.form-label .text-danger {
  margin-left: 0.2rem;
}

.form-text {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.875rem;
}

.form-text.text-muted {
  color: var(--text-light) !important;
}

/* Row dan column spacing */
.row {
  margin-left: -0.75rem;
  margin-right: -0.75rem;
}

.col-md-6 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

/* ===== ALERT STYLING ===== */
.alert {
  border: none;
  border-radius: 0.5rem;
  border-left: 4px solid transparent;
}

.alert-danger {
  background-color: #fee2e2;
  color: #991b1b;
  border-left-color: var(--danger-color);
}

.alert-success {
  background-color: #dcfce7;
  color: #166534;
  border-left-color: var(--secondary-color);
}

.alert-warning {
  background-color: #fef3c7;
  color: #92400e;
  border-left-color: var(--warning-color);
}

.alert-info {
  background-color: #dbeafe;
  color: #0c4a6e;
  border-left-color: var(--primary-color);
}

/* ===== BADGE STYLING ===== */
.badge {
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.badge-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
}

.badge-success {
  background-color: var(--secondary-color);
  color: white;
}

.badge-danger {
  background-color: var(--danger-color);
  color: white;
}

.badge-info {
  background-color: var(--primary-color);
  color: white;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 991.98px) {
  #sidebar {
    transform: translateX(-100%);
  }

  #sidebar.toggled {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }

  #content {
    margin-left: 0;
    width: 100%;
  }

  .navbar-collapse {
    position: absolute;
    top: 60px;
    right: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 0 0 0 0.5rem;
  }
}

@media (max-width: 767.98px) {
  body {
    padding-top: 50px;
  }

  .navbar {
    padding: 0.5rem 0.75rem;
  }

  .navbar-brand {
    font-size: 1.25rem;
  }

  #sidebar {
    top: 50px;
    width: 100%;
    max-width: 100%;
  }

  #content {
    padding: 1rem;
    margin-left: 0;
    width: 100%;
  }

  #content h1 { font-size: 1.5rem; }
  #content h2 { font-size: 1.25rem; }
  #content h3 { font-size: 1.125rem; }

  .table {
    font-size: 0.875rem;
  }

  .table thead th, .table tbody td {
    padding: 0.75rem 0.5rem;
  }

  .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
  }

  .d-flex {
    flex-direction: column;
  }

  .d-flex > div:first-child {
    margin-bottom: 1rem;
  }

  /* Form pada mobile */
  .row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
  }

  .col-md-6 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    width: 100%;
  }

  .card {
    margin-bottom: 1rem;
  }
}

@media (max-width: 576px) {
  .navbar-brand {
    font-size: 1rem;
  }

  #content {
    padding: 0.75rem;
  }

  #content h1 { font-size: 1.25rem; }
  #content h2 { font-size: 1rem; }
  #content h3 { font-size: 0.95rem; }

  .card {
    margin-bottom: 1rem;
  }

  .list-group-item {
    padding: 0.75rem 1rem;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .btn-lg {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }

  .form-label {
    font-size: 0.95rem;
  }

  .form-control, .form-select, textarea {
    font-size: 16px;
  }
}

/* ===== UTILITY CLASSES ===== */
.container-fluid {
  padding-right: 1rem;
  padding-left: 1rem;
}

.mb-3 {
  margin-bottom: 1.5rem !important;
}

.mt-3 {
  margin-top: 1.5rem !important;
}

/* ===== BOOTSTRAP MODALS FIX ===== */
.modal {
  z-index: 1060 !important;
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: transparent;
  padding-right: 0;
}

.modal.show {
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-right: 17px !important;
  overflow-y: hidden;
}

.modal.fade {
  transition: opacity 0.15s linear;
  opacity: 0;
}

.modal.fade.show {
  opacity: 1;
}

.modal-backdrop {
  z-index: 1050 !important;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  opacity: 0.5;
}

/* Sticky sidebar helper */
.sticky-sidebar {
  position: sticky;
  top: calc(60px + 1rem);
  z-index: 5;
}

@media (max-width: 767.98px) {
  .sticky-sidebar { top: calc(50px + 0.5rem); }
}

/* Ensure cards and text wrap correctly */
.card, .card-body {
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow: visible !important;
}

.form-group {
  overflow: visible !important;
  position: relative;
}

.container, .container-fluid {
  overflow: visible !important;
}

/* Form label and controls styling */
.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-dark);
  white-space: normal;
  word-break: break-word;
}

.form-label {
  position: relative;
  z-index: 5;
  background: transparent;
  padding: 0 0.25rem;
}

.form-control, textarea, select {
  width: 100%;
  box-sizing: border-box;
  min-height: calc(1.5em + 0.75rem);
  padding: 0.5rem 0.75rem;
}

.form-control, select {
  position: relative;
  z-index: 1;
}

.form-group select {
  margin-top: 0.25rem;
}

.form-control::placeholder {
  color: var(--text-light);
}

.form-group .form-control,
.form-group select {
  z-index: 1;
}

/* ===== ANIMATION & TRANSITIONS ===== */
.fade-in {
  animation: fadeIn 0.3s ease;
}

.slide-in {
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ===== COMPREHENSIVE BOOTSTRAP MODAL STYLING ===== */
.modal-dialog {
  position: relative;
  width: auto;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 90vh;
  max-width: 90vw;
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 85vh;
  pointer-events: auto;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 0.3rem;
  outline: 0;
}

.modal-header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid #dee2e6;
  border-top-left-radius: calc(0.3rem - 1px);
  border-top-right-radius: calc(0.3rem - 1px);
}

.modal-title {
  margin-bottom: 0;
  line-height: 1.5;
  font-size: 1.25rem;
  font-weight: 500;
}

.modal-header .close {
  padding: 0;
  background-color: transparent;
  border: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: #000;
  text-shadow: 0 1px 0 #fff;
  opacity: 0.5;
  cursor: pointer;
}

.modal-header .close:hover {
  opacity: 0.75;
}

.modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 1rem;
  overflow-y: auto;
  max-height: calc(85vh - 180px);
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  padding: 0.75rem;
  border-top: 1px solid #dee2e6;
  border-bottom-right-radius: calc(0.3rem - 1px);
  border-bottom-left-radius: calc(0.3rem - 1px);
}

/* ===== ACCESSIBILITY ===== */
focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary-dark);
}

/* ===== ENHANCED BUTTON STYLING ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.btn i {
  width: auto;
  height: 1em;
  display: inline-block;
}

.btn-primary {
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.35);
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px -1px rgba(37, 99, 235, 0.2);
}

.btn-secondary {
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.btn-secondary:hover {
  box-shadow: 0 6px 12px rgba(16, 185, 129, 0.3);
}

.btn-danger {
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  box-shadow: 0 6px 12px rgba(239, 68, 68, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, var(--secondary-color) 0%, #047857 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #065f46 100%);
  box-shadow: 0 6px 12px rgba(16, 185, 129, 0.3);
  transform: translateY(-2px);
}

.btn-info {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(6, 182, 212, 0.2);
}

.btn-info:hover {
  background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
  box-shadow: 0 6px 12px rgba(6, 182, 212, 0.3);
  transform: translateY(-2px);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

.btn-warning:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  box-shadow: 0 6px 12px rgba(245, 158, 11, 0.3);
  transform: translateY(-2px);
}

.btn-sm {
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.25rem;
}

.btn-lg {
  font-size: 1.125rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
}

.btn-action {
  padding: 0.375rem 0.625rem;
  font-size: 0.85rem;
  margin: 0.125rem;
}

.btn-action i {
  margin-right: 0.25rem;
}

/* ===== ENHANCED MODAL STYLING ===== */
.modal-content {
  border: none;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.modal-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  padding: 1.5rem;
}

.modal-header .modal-title {
  font-weight: 700;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-header .modal-title i {
  font-size: 1.75rem;
}

.modal-header .close {
  color: white;
  opacity: 0.8;
  text-shadow: none;
  filter: brightness(1.2);
}

.modal-header .close:hover {
  opacity: 1;
}

.modal-body {
  padding: 2rem;
  background-color: var(--card-bg);
}

.modal-footer {
  background-color: var(--light-bg);
  border-top: 1px solid var(--border-color);
  padding: 1.5rem;
  gap: 0.75rem;
}

.modal-footer .btn {
  min-width: 100px;
}

/* ===== ENHANCED TABLE STYLING ===== */
.table-action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.table-action-buttons .btn {
  padding: 0.375rem 0.75rem;
  font-size: 0.85rem;
}

.table .btn-edit {
  background-color: #3b82f6;
  color: white;
}

.table .btn-edit:hover {
  background-color: #2563eb;
  color: white;
}

.table .btn-delete {
  background-color: #ef4444;
  color: white;
}

.table .btn-delete:hover {
  background-color: #dc2626;
  color: white;
}

.table .btn-view {
  background-color: #06b6d4;
  color: white;
}

.table .btn-view:hover {
  background-color: #0891b2;
  color: white;
}

/* ===== ENHANCED FORM STYLING ===== */
.form-group {
  animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-control:focus, .form-select:focus, textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1), inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-control:disabled, .form-select:disabled {
  background-color: var(--light-bg);
  border-color: var(--border-color);
  opacity: 0.7;
}

/* ===== CARD ENHANCEMENTS ===== */
.card {
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.75rem;
  font-weight: 700;
}

.card-header i {
  font-size: 1.25rem;
  color: var(--primary-color);
}

/* ===== BADGE ANIMATIONS ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  animation: fadeIn 0.3s ease-out;
}

/* ===== BREADCRUMB STYLING ===== */
.breadcrumb {
  background-color: transparent;
  padding: 0.5rem 0;
  margin-bottom: 1.5rem;
}

.breadcrumb-item {
  color: var(--text-light);
}

.breadcrumb-item.active {
  color: var(--text-dark);
  font-weight: 600;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: '→';
  padding: 0 0.5rem;
  color: var(--border-color);
}

/* ===== PAGE TRANSITIONS ===== */
#content {
  animation: pageLoad 0.3s ease-out;
}

@keyframes pageLoad {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== LOADING STATE ===== */
.btn.loading {
  position: relative;
  color: transparent;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== TOOLTIP STYLING ===== */
.tooltip-inner {
  background-color: var(--text-dark);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.tooltip.show {
  opacity: 1 !important;
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* ===== MODAL RESPONSIVE SCROLLING ===== */
@media (min-width: 992px) {
  .modal-dialog {
    max-height: 90vh;
    max-width: 90vw;
  }
  
  .modal-content {
    max-height: 85vh;
  }
  
  .modal-body {
    max-height: calc(85vh - 180px);
  }
}

@media (max-width: 991px) {
  .modal-dialog {
    max-height: 90vh;
    max-width: 95vw;
    margin-top: 20px;
    margin-bottom: 20px;
  }
  
  .modal-content {
    max-height: 80vh;
  }
  
  .modal-body {
    max-height: calc(80vh - 150px);
    font-size: 0.95rem;
  }
  
  .modal-header {
    padding: 0.875rem;
  }
  
  .modal-footer {
    padding: 0.65rem;
  }
}

@media (max-width: 575px) {
  .modal-dialog {
    max-height: 95vh;
    max-width: 100vw;
    margin: 10px;
    display: flex !important;
    align-items: flex-start !important;
  }
  
  .modal-content {
    max-height: 90vh;
    margin-top: auto;
    margin-bottom: auto;
  }
  
  .modal-body {
    max-height: calc(90vh - 140px);
    padding: 0.875rem;
    font-size: 0.9rem;
  }
  
  .modal-header {
    padding: 0.75rem;
    flex-wrap: wrap;
  }
  
  .modal-title {
    font-size: 1.1rem;
  }
  
  .modal-footer {
    padding: 0.5rem;
    flex-direction: column-reverse;
  }
  
  .modal-footer .btn {
    width: 100%;
    margin-bottom: 0.25rem;
    margin-left: 0;
  }
  
  .modal-footer .btn:first-child {
    margin-bottom: 0;
  }
}