/* ============================================= */
/* Added styles to shrink dashboard components   */
/* to prevent scrolling within the animation.    */
/* ============================================= */

/* Reduce padding in the main dashboard area for the animation */
.dashboard-animation .dashboard-main {
  padding: 10px;
}

/* Make stat cards and their text smaller */
.dashboard-animation .stat-card {
  padding: 8px;
}

.dashboard-animation .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.dashboard-animation .stat-label {
  font-size: 0.7rem;
}

/* Reduce spacing around the chart container */
.dashboard-animation .chart-container {
  margin-top: 15px;
  padding: 10px 5px;
}

.dashboard-animation .chart-header {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 5px;
}


/* ============================================= */
/* Revised Dashboard Chart Styles                */
/* ============================================= */

.attendance-data {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 5px; /* Reduced padding */
}

.attendance-bars {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 110px; /* Reduced height from 150px */
  margin-bottom: 15px;
  position: relative;
  /* Use borders for X and Y axis lines for cleaner code */
  border-left: 1px solid rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

/* Add grid lines for the chart (FIXED: this was previously broken) */
.attendance-bars::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.1) 0px,
    rgba(0, 0, 0, 0.1) 1px,
    transparent 1px,
    transparent 22px /* Adjusted for new height */
  );
  background-size: 100% 22px; /* Adjusted for new height */
  z-index: 0;
  pointer-events: none;
}

.attendance-bar {
  width: 12%;
  background-color: #0d6efd;
  border-radius: 4px 4px 0 0;
  position: relative;
  transition: height 1s ease-in-out;
  z-index: 2;
}

.bar-label {
  position: absolute;
  bottom: -18px; /* Moved closer to the bar */
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px; /* Reduced font size */
  color: #6c757d;
}

.attendance-legend {
  display: flex;
  justify-content: center;
  margin-top: 10px; /* Reduced top margin */
}

.legend-item {
  display: flex;
  align-items: center;
  margin: 0 10px;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 5px;
}

.legend-text {
  font-size: 12px;
  color: #6c757d;
}

/* Animation for bars */
.attendance-bar {
  opacity: 0;
  transform: scaleY(0);
  transform-origin: bottom;
  animation: barGrowScale 1.5s ease-out forwards;
}

@keyframes barGrowScale {
  from { 
    opacity: 0;
    transform: scaleY(0);
  }
  to { 
    opacity: 0.9;
    transform: scaleY(1);
  }
}

/* Adding axis labels and values */
.y-axis-labels {
  position: absolute;
  left: -35px; /* Moved closer */
  top: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0 5px;
  font-size: 9px; /* Reduced font size */
  color: #6c757d;
}

.y-axis-label {
  transform: translateY(50%);
}

/* Enhance responsiveness for iPad */
@media (min-width: 768px) and (max-width: 1024px) {
  .attendance-bars {
    height: 140px; /* Reduced responsive height */
  }
  
  .attendance-bar {
    width: 11%;
  }
  
  .bar-label {
    font-size: 14px;
  }
}