/*
 * Dashboard Components CSS
 * Reusable styles for all dashboard pages
 * Based on Kids template design patterns
 */

/* ==========================
   Dashboard Container
   ========================== */
.container-dashboard {
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
  width: 100%;
}

/* ==========================
   Dashboard Header Section
   ========================== */
.dashboard-header {
  background: #f8f9fa; /* bg-light color to differentiate from white background */
  border-radius: 0.94rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
  border: 1px solid #e9ecef;
}

@media (min-width: 768px) {
  .dashboard-header {
    padding: 2rem 2.5rem;
    margin-bottom: 2.0rem;
  }
}

/* Dashboard header buttons - responsive layout */
.dashboard-header-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dashboard-header-buttons .btn {
  flex: 1; /* Make all buttons equal width */
  white-space: nowrap; /* Prevent text wrapping */
}

/* Keep buttons stacked vertically on tablet (md) and large (lg) sizes */
@media (min-width: 768px) {
  .dashboard-header-buttons {
    gap: 0.65rem;
  }
}

/* Switch to horizontal layout only on extra-large screens (xl) and up */
@media (min-width: 1200px) {
  .dashboard-header-buttons {
    flex-direction: row;
    justify-content: flex-end;
    gap: 0.75rem;
  }
}

/* ==========================
   Dashboard Statistics Cards
   ========================== */
.dashboard-stats-card {
  margin-bottom: 0; /* Remove extra margin, using row gutters instead */
  height: 100%; /* Ensure wrapper takes full height */
}

.dashboard-stats-card .card {
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
  position: relative;
  border: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%; /* Make all cards same height */
  display: flex;
  flex-direction: column;
}

.dashboard-stats-card .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.15);
}

.dashboard-stats-card .card-body {
  padding: 0;
  padding-bottom: 0.75rem;
  flex: 1; /* Allow body to grow and maintain equal heights */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

@media (min-width: 768px) {
  .dashboard-stats-card .card-body {
    padding-bottom: 1rem;
  }
}

/* Circular Icon Badge */
.card-icon-border-large {
  width: 60px;
  height: 60px;
  margin: 0 auto;
  background-color: #fff;
  border: 4px solid;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 52px;
  color: #666;
  margin-top: -1.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .card-icon-border-large {
    width: 70px;
    height: 70px;
    font-size: 1.5rem;
    line-height: 62px;
    margin-top: -2.2rem;
  }
}

/* Counter Display */
.counter-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  padding: 0.5rem 0 0.15rem 0;
  margin: 0;
  font-family: 'Dosis', sans-serif;
}

@media (min-width: 768px) {
  .counter-value {
    font-size: 1.75rem;
  }
}

/* Stat Label */
.stat-label {
  display: inline-block;
  color: #fff;
  text-transform: uppercase;
  font-weight: 500;
  border-radius: 0.25rem;
  margin-top: 0.1rem;
  padding: 0.3rem 0.6rem;
  margin-bottom: 0.35rem;
  font-size: 0.938rem;
}

/* Stat Detail (small text under value) */
.stat-detail {
  display: inline-block;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 400;
  padding: 0.1rem 0.4rem;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
}

/* Section Title with Decorative Shapes */
.dashboard-section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .dashboard-section-title {
    margin-bottom: 2rem;
  }
}

.dashboard-section-title h2 {
  margin: 0;
  padding: 0 1rem;
  font-family: 'Dosis', sans-serif;
  font-weight: 600;
}

.dashboard-section-title .shape {
  width: 50px;
  height: 4px;
  border-radius: 2px;
}

@media (min-width: 768px) {
  .dashboard-section-title .shape {
    width: 80px;
  }
}

/* ==========================
   Media Objects (Feature Lists)
   ========================== */
.dashboard-media {
  margin-bottom: 2rem;
}

.dashboard-media-icon {
  width: 76px;
  height: 76px;
  padding: 0.375rem;
  box-shadow: 0.25rem 0.25rem 0 rgba(0, 0, 0, 0.1);
  display: block;
  margin-right: 0.94rem;
  border-radius: 50%;
}

.dashboard-media-icon i {
  width: 62px;
  height: 62px;
  line-height: 62px;
  border-radius: 50%;
  text-align: center;
  border: 2px solid #fff;
  font-size: 1.38rem;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================
   Button Styles
   ========================== */
.btn-dashboard {
  border: none;
  color: white;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  font-weight: 500;
}

.btn-dashboard:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  color: white;
}

/* ==========================
   Utility Classes
   ========================== */
.text-shadow-sm {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.box-shadow-card {
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
}

/* ==========================
   Responsive Adjustments
   ========================== */
@media (max-width: 767.98px) {
  .dashboard-header {
    text-align: center;
  }

  .dashboard-header .btn-dashboard {
    margin-top: 1rem;
    width: 100%;
  }

  .counter-value {
    font-size: 2rem;
  }

  .card-icon-border-large {
    width: 80px;
    height: 80px;
    font-size: 1.5rem;
    line-height: 70px;
    margin-top: -2.5rem;
  }
}

/* ==========================
   Color-Specific Borders
   (Following Bootstrap color variables)
   ========================== */
.border-primary.card-icon-border-large {
  border-color: var(--bs-primary);
}

.border-success.card-icon-border-large {
  border-color: var(--bs-success);
}

.border-danger.card-icon-border-large {
  border-color: var(--bs-danger);
}

.border-info.card-icon-border-large {
  border-color: var(--bs-info);
}

.border-warning.card-icon-border-large {
  border-color: var(--bs-warning);
}

.border-purple.card-icon-border-large {
  border-color: #a597e7;
}

.border-pink.card-icon-border-large {
  border-color: #ea77ad;
}

/* Background colors for custom colors not in Bootstrap */
.bg-purple {
  background-color: #a597e7 !important;
}

.bg-pink {
  background-color: #ea77ad !important;
}

.text-purple {
  color: #a597e7 !important;
}

.text-pink {
  color: #ea77ad !important;
}

/* ==========================
   Quick Action Buttons
   ========================== */
.quick-action-btn {
  transition: all 0.2s ease;
  cursor: pointer;
}

.quick-action-btn:hover {
  border-color: var(--bs-info) !important;
  background-color: rgba(var(--bs-info-rgb), 0.05) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(var(--bs-info-rgb), 0.15) !important;
  color: var(--bs-info) !important;
}

/* ==========================
   Teacher Group Cards
   ========================== */
.teacher-group-card-wrapper {
  margin-bottom: 1.5rem; /* spacing between cards */
}

.teacher-group-card {
  transition: all 0.2s ease;
  margin-bottom: 0 !important; /* eliminate extra bottom space from card */
  overflow: hidden; /* clip action bar animation within card bounds */
}

.teacher-group-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  border-color: #667eea !important;
}

.teacher-group-card-image {
  height: 160px;
  object-fit: cover;
}

.teacher-group-stat-label {
  font-size: 0.7rem;
}

/* ==========================
   Group Action Bar - Adaptive Hybrid
   ========================== */
.teacher-group-action-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.1) 100%);
  padding: 0.5rem;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;
  border-radius: 0.75rem 0.75rem 0 0; /* match card's rounded top corners */
}

.teacher-group-action-bar .btn {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.2s ease;
  font-size: 0.875rem;
  padding: 0.4rem 0.65rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  color: var(--bs-dark); /* Bootstrap dark color for icons initially */
}

.teacher-group-action-bar .btn:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.teacher-group-action-bar .btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Hover/Active states using Bootstrap color variables */
.teacher-group-action-bar .btn-icon-move-up:hover,
.teacher-group-action-bar .btn-icon-move-up:active,
.teacher-group-action-bar .btn-icon-move-down:hover,
.teacher-group-action-bar .btn-icon-move-down:active {
  color: var(--bs-info); /* Bootstrap info color */
  border-color: var(--bs-info) !important;
}

.teacher-group-action-bar .btn-icon-delete:hover,
.teacher-group-action-bar .btn-icon-delete:active {
  color: var(--bs-danger); /* Bootstrap danger color */
  border-color: var(--bs-danger) !important;
}

/* Mobile: Always visible with compact styling */
@media (max-width: 768px) {
  .teacher-group-action-bar {
    opacity: 1;
    transform: translateY(0);
    padding: 0.4rem;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.3) 100%);
  }

  .teacher-group-action-bar .btn {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
  }
}

/* Desktop: Hidden by default, show on hover */
@media (min-width: 769px) {
  .teacher-group-action-bar {
    opacity: 0;
    transform: translateY(-100%);
  }

  .teacher-group-card:hover .teacher-group-action-bar {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================
   Teacher Group Subscribe Badge
   ========================== */
.teacher-group-subscribe-badge {
  z-index: 5; /* Below action bar but above image */
  max-width: 180px;
}

.teacher-group-subscribe-badge .badge {
  font-size: 0.75rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: pulse-glow 2s ease-in-out infinite;
}

/* Crown icon styling - orange/gold to match warning theme */
.teacher-crown-icon {
  color: #ff9800;
  font-size: 1.3rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  animation: crown-shine 3s ease-in-out infinite;
}

/* Price styling with good contrast on warning background */
.teacher-price-original {
  color: #6c757d;
  font-size: 0.8rem;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
  opacity: 0.85;
}

.teacher-price-discounted {
  font-size: 0.95rem;
  line-height: 1.3;
  color: #198754;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.teacher-price-normal {
  font-size: 0.9rem;
  color: #212529;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

/* Discount badge styling */
.teacher-discount-badge {
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.25rem 0.4rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Clickable badge hover effect */
.teacher-subscribe-clickable {
  cursor: pointer;
  transition: all 0.3s ease;
}

.teacher-subscribe-clickable:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(255, 193, 7, 0.8) !important;
  background-color: #ffca2c !important;
}

/* Pulsing glow animation to attract attention */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.6), 0 0 25px rgba(255, 152, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 25px rgba(255, 193, 7, 0.9), 0 0 40px rgba(255, 152, 0, 0.6);
  }
}

/* Crown icon shine animation */
@keyframes crown-shine {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  }
  50% {
    transform: scale(1.08);
    filter: drop-shadow(0 3px 6px rgba(255, 152, 0, 0.8));
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .teacher-group-subscribe-badge {
    max-width: 170px;
  }

  .teacher-group-subscribe-badge .badge {
    padding: 0.5rem !important;
  }

  .teacher-crown-icon {
    font-size: 1.1rem !important;
  }

  .teacher-price-original {
    font-size: 0.7rem;
  }

  .teacher-price-discounted {
    font-size: 0.85rem;
  }

  .teacher-price-normal {
    font-size: 0.8rem;
  }

  .teacher-discount-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.35rem;
  }
}

/* Hover effect on card enhances badge visibility */
.teacher-group-card:hover .teacher-group-subscribe-badge .badge {
  transform: scale(1.05);
  transition: transform 0.2s ease;
}

/* ==========================
   Activity Feed & Alerts (UNIFIED)
   ========================== */

/* Activity Items - Base Style */
.activity-item {
  padding: 0.875rem;
  border-left: 3px solid #0d6efd; /* Bootstrap primary */
  margin-bottom: 0.75rem;
  background: #f8f9fa;
  border-radius: 0.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.activity-item:hover {
  transform: translateX(5px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* High Priority Alerts */
.activity-item.alert-high {
  border-color: #dc3545; /* Bootstrap danger (red) */
  background: #fff5f5; /* Light red background */
}

/* Medium Priority Alerts */
.activity-item.alert-medium {
  border-color: #ffc107; /* Bootstrap warning (yellow) */
  background: #fffef5; /* Light yellow background */
}

/* Activity Type Borders */
.activity-item.success {
  border-color: #198754; /* Bootstrap success (green) */
}

.activity-item.warning {
  border-color: #ffc107; /* Bootstrap warning (yellow) */
}

.activity-item.danger {
  border-color: #dc3545; /* Bootstrap danger (red) */
}

.activity-item.info {
  border-color: #0dcaf0; /* Bootstrap info (cyan) */
}

.activity-item.primary {
  border-color: #0d6efd; /* Bootstrap primary (blue) */
}

/* Activity Time */
.activity-time {
  font-size: 0.75rem;
  color: #6c757d;
  margin-top: 0.25rem;
}

/* Activity Actions */
.activity-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.activity-actions .btn {
  font-size: 0.813rem;
  padding: 0.375rem 0.75rem;
}

