/* ========== GLOBAL STYLES ========== */
body {
  background-color: #f0f2f5;
  margin: 0;
  padding: 0;
  width: 100%;
}

main {
  background-color: #f0f2f5;
  min-height: calc(100vh - 56px);
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.container-fluid {
  background-color: #f0f2f5;
  width: 100%;
}

/* ========== CONTAINER CENTERING ========== */
.container {
  width: 100% !important;
  padding-right: 15px !important;
  padding-left: 15px !important;
  margin-right: auto !important;
  margin-left: auto !important;
  display: block !important;
  box-sizing: border-box !important;
}
@media (min-width: 576px) {
  .container { max-width: 540px !important; }
}
@media (min-width: 768px) {
  .container { max-width: 720px !important; }
}
@media (min-width: 992px) {
  .container { max-width: 960px !important; }
}
@media (min-width: 1200px) {
  .container { max-width: 1140px !important; }
}
@media (min-width: 1400px) {
  .container { max-width: 1320px !important; }
}
@media (min-width: 1920px) {
  .container { max-width: 1500px !important; padding-right: 30px !important; padding-left: 30px !important; }
}
@media (min-width: 2560px) {
  .container { max-width: 1680px !important; padding-right: 40px !important; padding-left: 40px !important; }
}

/* ========== SECTION CENTERING ========== */
section {
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
}

section > .container {
  width: auto !important;
  max-width: 100% !important;
}

/* ========== ROW CENTERING (Bootstrap Grid) ========== */
.row {
  margin-left: auto !important;
  margin-right: auto !important;
}

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* Animation Classes */
.animate-fade-up {
  animation: fadeInUp 0.8s ease-out forwards;
  opacity: 0;
}

.animate-slide-left {
  animation: slideInLeft 0.8s ease-out forwards;
  opacity: 0;
}

.animate-slide-right {
  animation: slideInRight 0.8s ease-out forwards;
  opacity: 0;
}

.animate-scale {
  animation: scaleIn 0.8s ease-out forwards;
  opacity: 0;
}

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

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ========== CARD STYLES ========== */
.card {
  transition: all 0.3s ease;
  background-color: #ffffff;
}

.card:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}

/* ========== COURSE CARDS ========== */
.course-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 15px !important;
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
}

/* ========== TABLE STYLES ========== */
.table-hover tbody tr:hover {
  background-color: #f8f9fa;
}

.table-dark {
  background-color: #2c3e50;
}

.table-success-light {
  background-color: #d5f4e6 !important;
}

.table-warning-light {
  background-color: #fef5e7 !important;
}

/* ========== BADGE STYLES ========== */
.badge {
  padding: 0.5rem 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.badge:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Badge color variants with hover */
.badge.bg-danger:hover {
  background-color: #c0392b !important;
}

.badge.bg-warning:hover {
  background-color: #d68910 !important;
}

.badge.bg-success:hover {
  background-color: #229954 !important;
}

.badge.bg-info:hover {
  background-color: #2980b9 !important;
}

/* ========== BUTTON STYLES ========== */
.btn {
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: #3498db;
  border-color: #3498db;
}

.btn-primary:hover {
  background-color: #2980b9;
  border-color: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-success {
  background-color: #27ae60;
  border-color: #27ae60;
}

.btn-success:hover {
  background-color: #229954;
  border-color: #229954;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

/* ========== FORM STYLES ========== */
.form-control,
.form-select {
  border: 1px solid #ddd;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.form-label {
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

/* ========== ROUNDED CORNERS ========== */
.rounded-3 {
  border-radius: 15px !important;
}

.rounded-4 {
  border-radius: 20px !important;
}

/* ========== SPACING ========== */
.mb-4 {
  margin-bottom: 1.5rem !important;
}

.shadow-sm {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

/* ========== TEXT COLORS ========== */
.text-primary {
  color: #3498db !important;
}

.text-success {
  color: #27ae60 !important;
}

.text-warning {
  color: #f39c12 !important;
}

.text-info {
  color: #16a085 !important;
}

/* ========== ALERT STYLES ========== */
.alert {
  border: none;
  border-radius: 12px;
}

.alert-info {
  background-color: #d6eaf8;
  color: #1a5f7a;
}

.alert-success {
  background-color: #d5f4e6;
  color: #0e6251;
}

.alert-warning {
  background-color: #fef5e7;
  color: #7d6608;
}

.alert-danger {
  background-color: #fadbd8;
  color: #78281f;
}

/* ========== HEADER STYLES ========== */
h1, h2, h3, h4, h5, h6 {
  color: #2c3e50;
  font-weight: 600;
}

/* ========== RESPONSIVE IMPROVEMENTS ========== */
@media (max-width: 768px) {
  /* ===== AGGRESSIVE MOBILE OPTIMIZATION ===== */
  
  /* Base spacing - much more compact */
  /* NOTE: the old wildcard "* { margin-top: 0 !important }" was removed because
     it zeroed out #main-wrapper's topbar-offset margin, causing the fixed header
     to overlap all page content on mobile. Specific classes below still compact spacing. */
  .course-card {
    margin-bottom: 0.75rem !important;
  }
  
  .card {
    margin-bottom: 0.75rem !important;
  }
  
  /* Balanced reduce padding on mobile screens */
  .card-body {
    padding: 0.75rem !important;
  }
  
  .card-header {
    padding: 0.75rem !important;
  }
  
  .card-body.p-4,
  .card-header.p-4,
  .p-4 {
    padding: 0.75rem !important;
  }
  
  .card-body.p-5,
  .card-header.p-5,
  .p-5 {
    padding: 0.75rem !important;
  }
  
  .card-body.p-3,
  .p-3 {
    padding: 0.6rem !important;
  }
  
  /* Reduce all padding classes */
  .p-1 { padding: 0.3rem !important; }
  .p-2 { padding: 0.4rem !important; }
  
  /* Reduce container padding */
  .container-fluid {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
  
  .container {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
  
  /* Balanced margin reduction */
  .mb-1 { margin-bottom: 0.3rem !important; }
  .mb-2 { margin-bottom: 0.4rem !important; }
  .mb-3 { margin-bottom: 0.6rem !important; }
  .mb-4 { margin-bottom: 0.75rem !important; }
  .mb-5 { margin-bottom: 0.75rem !important; }
  .mt-1 { margin-top: 0.3rem !important; }
  .mt-2 { margin-top: 0.4rem !important; }
  .mt-3 { margin-top: 0.6rem !important; }
  .mt-4 { margin-top: 0.75rem !important; }
  .mt-5 { margin-top: 0.75rem !important; }
  
  /* Balanced gap reduction */
  .gap-1 { gap: 0.3rem !important; }
  .gap-2 { gap: 0.4rem !important; }
  .gap-3 { gap: 0.6rem !important; }
  .gap-4 { gap: 0.75rem !important; }
  .gap-5 { gap: 0.75rem !important; }
  
  /* Reduce icon size significantly */
  .card-body .fa-3x,
  .card-body [style*="font-size: 3rem"] {
    font-size: 1.5rem !important;
  }
  
  .fa-2x {
    font-size: 1rem !important;
  }
  
  /* Aggressive font size reduction */
  h1 {
    font-size: 1.5rem !important;
  }
  
  h2 {
    font-size: 1.25rem !important;
  }
  
  h3 {
    font-size: 1.1rem !important;
  }
  
  h4 {
    font-size: 1rem !important;
  }
  
  h5 {
    font-size: 0.95rem !important;
  }
  
  h6 {
    font-size: 0.9rem !important;
  }
  
  /* Card title */
  .card-title {
    font-size: 0.95rem !important;
    margin-bottom: 0.25rem !important;
  }
  
  /* Card text */
  .card-text {
    font-size: 0.8rem !important;
    line-height: 1.3 !important;
  }
  
  /* Paragraph text */
  p {
    font-size: 0.85rem !important;
    margin-bottom: 0.25rem !important;
  }
  
  /* Small text */
  small {
    font-size: 0.75rem !important;
  }
  
  /* Adjust badge sizes */
  .badge {
    font-size: 0.7rem !important;
    padding: 0.2rem 0.4rem !important;
    display: inline-block !important;
  }
  
  /* Display headings */
  .display-4 {
    font-size: 1.5rem !important;
    line-height: 1.3 !important;
  }
  
  .display-5 {
    font-size: 1.3rem !important;
  }
  
  .display-6 {
    font-size: 1.1rem !important;
  }
  
  /* Button optimization */
  .btn {
    padding: 0.4rem 0.75rem !important;
    font-size: 0.8rem !important;
  }
  
  .btn-sm {
    padding: 0.3rem 0.5rem !important;
    font-size: 0.7rem !important;
  }
  
  .btn-lg {
    padding: 0.5rem 1rem !important;
    font-size: 0.9rem !important;
  }
  
  /* Reduce lead font size */
  .lead {
    font-size: 1rem !important;
  }
  
  /* Reduce table sizes */
  .table {
    font-size: 0.8rem !important;
  }
  
  .table th,
  .table td {
    padding: 0.3rem !important;
  }
  
  /* Form elements */
  .form-control,
  .form-select {
    padding: 0.4rem 0.5rem !important;
    font-size: 0.85rem !important;
  }
  
  .form-label {
    margin-bottom: 0.15rem !important;
    font-size: 0.85rem !important;
  }
  
  /* Alert boxes */
  .alert {
    padding: 0.75rem !important;
    margin-bottom: 0.75rem !important;
    font-size: 0.8rem !important;
  }
  
  .alert-heading {
    font-size: 0.9rem !important;
    margin-bottom: 0.4rem !important;
  }
  
  /* Remove shadows for more compact look */
  .shadow-sm {
    box-shadow: none !important;
  }
  
  .shadow,
  .shadow-lg {
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
  }
  
  /* Reduce border radius on mobile */
  .rounded-3 {
    border-radius: 8px !important;
  }
  
  .rounded-4 {
    border-radius: 10px !important;
  }
  
  /* Flex gap reduction */
  .d-flex {
    gap: 0.4rem !important;
  }
  
  /* Row grid gap */
  .row {
    --bs-gutter-x: 0.75rem !important;
    --bs-gutter-y: 0.75rem !important;
  }
  
  /* Collapse spacing */
  .collapse-content {
    padding: 0.75rem !important;
  }
  
  /* List spacing */
  ul, ol {
    margin-bottom: 0.75rem !important;
    padding-left: 1.2rem !important;
  }
  
  li {
    margin-bottom: 0.2rem !important;
  }
}

/* ========== ICON COLORS ========== */
.fas {
  transition: color 0.3s ease;
}

/* ========== GRADIENT BACKGROUNDS ========== */
.bg-gradient {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%) !important;
}

/* ========== UTILITY CLASSES ========== */
.border-0 {
  border: none !important;
}

.shadow-lg {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}