/* Activity Tracking  */

:root {
  --act-primary: #4a6bdf;
  --act-primary-light: #eef1fd;
  --act-primary-dark: #324a9c;
  --act-secondary: #6c757d;
  --act-success: #28a745;
  --act-danger: #dc3545;
  --act-warning: #ffc107;
  --act-info: #17a2b8;
  --act-light: #f8f9fa;
  --act-dark: #343a40;
  --act-white: #ffffff;
  --act-gray-100: #f8f9fa;
  --act-gray-200: #e9ecef;
  --act-gray-300: #dee2e6;
  --act-gray-400: #ced4da;
  --act-gray-500: #adb5bd;
  --act-gray-600: #6c757d;
  --act-gray-700: #495057;
  --act-gray-800: #343a40;
  --act-gray-900: #212529;
  --act-border-radius: 0.375rem;
  --act-box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --act-box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
  --act-box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
  --act-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --act-font-size: 1rem;
  --act-font-weight: 400;
  --act-line-height: 1.5;
}

/* Container and Grid System */
.act-container {
  width: 100%;
  max-width: 1200px;
  padding-right: 1rem;
  padding-left: 1rem;
  margin-right: auto;
  margin-left: auto;
}

.act-row {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  margin-right: -0.5rem;
  margin-left: -0.5rem;
}

.act-col {
  position: relative;
  width: 100%;
  padding-right: 0.5rem;
  padding-left: 0.5rem;
  flex-basis: 0;
  flex-grow: 1;
  max-width: 100%;
}

/* Responsive columns */
.act-col-md-2, .act-col-md-3, .act-col-md-4, .act-col-md-8, .act-col-lg-3, .act-col-lg-4, .act-col-lg-5, .act-col-lg-7, .act-col-lg-8 {
  position: relative;
  width: 100%;
  padding-right: 0.1rem;
  padding-left: 0.1rem;
  margin: 7px auto;
}

@media (min-width: 768px) {
  .act-col-md-2 {
    flex: 0 0 16.666667%;
    max-width: 16.666667%;
  }
  .act-col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
  }
  .act-col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }
  .act-col-md-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
  }
}

@media (min-width: 992px) {
  .act-col-lg-3 {
    flex: 0 0 25%;
    max-width: 25%;
  }
  .act-col-lg-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }
  .act-col-lg-5 {
    flex: 0 0 41.666667%;
    max-width: 41.666667%;
  }
  .act-col-lg-7 {
    flex: 0 0 58.333333%;
    max-width: 58.333333%;
  }
  .act-col-lg-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
  }
}

/* Spacing utilities */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }
.me-2 { margin-right: 0.5rem; }
.me-3 { margin-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 1rem; padding-bottom: 1rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }
.p-0 { padding: 0; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }

/* Typography */

h1.display-5 {
  font-size: 2.5rem;
  font-weight: 300;
}

.lead {
  font-size: 1.25rem;
  font-weight: 300;
}

.text-center { text-align: center; }
.text-end { text-align: right; }
.text-muted { color: var(--act-gray-600); }
.small, small { font-size: 0.875em; }
.fw-bold { font-weight: 700; }
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Card Components */
.act-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-color: var(--act-white);
  background-clip: border-box;
  border: 1px solid var(--act-gray-300);
  border-radius: var(--act-border-radius);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}


.shadow-sm {
  box-shadow: var(--act-box-shadow-sm);
}

.h-100 {
  height: 100%;
}

.act-card-body {
  flex: 1 1 auto;
  padding: 1rem;
}

.act-card-body h5{
  color: #686868;
}
.act-card-header {
  padding: 0.75rem 1.25rem;
  background-color: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid var(--act-gray-300);
}

.act-card-footer {
  padding: 0.75rem 1.25rem;
  background-color: rgba(0, 0, 0, 0.03);
  border-top: 1px solid var(--act-gray-300);
}

.act-card .display-4 {
  font-size: 3.5rem;
  font-weight: 300;
  line-height: 1.2;
}

.bg-transparent {
  background-color: transparent !important;
  border: none;
}

/* List Groups */
.act-list-group {
  display: flex;
  flex-direction: column;
  padding-left: 0;
  margin-bottom: 0;
  border-radius: var(--act-border-radius);
}

.act-list-group-item {
  position: relative;
  display: block;
  padding: 0.75rem 1.25rem;
  background-color: var(--act-white);
  border: 1px solid var(--act-gray-300);
  border-width: 0 0 1px;
  transition: background-color 0.2s ease;
}

.act-list-group-item:first-child {
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}

.act-list-group-item:last-child {
  border-bottom-width: 0;
  border-bottom-right-radius: inherit;
  border-bottom-left-radius: inherit;
}

.act-list-group-item:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.list-group-flush {
  border-radius: 0;
}

.list-group-flush .act-list-group-item {
  border-right-width: 0;
  border-left-width: 0;
  border-radius: 0;
}

/* Badges */
.act-badge {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  color: var(--act-white);
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
}

.bg-primary { background-color: var(--act-primary); }
.bg-secondary { background-color: var(--act-secondary); }
.bg-success { background-color: var(--act-success); }
.bg-info { background-color: var(--act-info); }
.bg-warning { background-color: var(--act-warning); }
.bg-danger { background-color: var(--act-danger); }
.bg-light { background-color: var(--act-light); color: var(--act-dark); }

/* Buttons */
.act-btn {
  display: inline-block;
  font-weight: 400;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  background-color: transparent;
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 0.25rem;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.act-btn:hover {
  opacity: 0.9;
}

.btn-primary {
  color: var(--act-white);
  background-color: var(--act-primary);
  border-color: var(--act-primary);
}

.btn-outline-primary {
  color: var(--act-primary);
  border-color: var(--act-primary);
  background-color: transparent;
}

.btn-outline-primary:hover {
  color: var(--act-white);
  background-color: var(--act-primary);
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  border-radius: 0.2rem;
}

/* Forms */
.form-control {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--act-gray-700);
  background-color: var(--act-white);
  background-clip: padding-box;
  border: 1px solid var(--act-gray-400);
  border-radius: 0.25rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-select {
  display: block;
  width: 100%;
  padding: 0.375rem 2.25rem 0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--act-gray-700);
  background-color: var(--act-white);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  border: 1px solid var(--act-gray-400);
  border-radius: 0.25rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  appearance: none;
}

.form-label {
  margin-bottom: 0.5rem;
  font-weight: 500;
}

#act-period-form {
  display: flex;
  align-items: center;
}

/* Flexbox utilities */
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.justify-content-between { justify-content: space-between; }
.justify-content-around { justify-content: space-around; }
.justify-content-center { justify-content: center; }
.align-items-center { align-items: center; }
.align-items-end { align-items: flex-end; }

/* Leaderboard specific styles */
.act-leaderboard-rank {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: bold;
  margin-right: 10px;
}

.act-rank-1 {
  background-color: gold;
  color: #212529;
  font-size: 1.3rem;
}

.act-rank-2 {
  background-color: silver;
  color: #212529;
  font-size: 1.3rem;
}

.act-rank-3 {
  background-color: #cd7f32; /* Bronze */
  color: white;
  font-size: 1.3rem;
}

/* Achievement badge styling */
.act-achievement-badge {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--act-gray-100);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
  margin: 0 auto 1rem;
  font-size: 1.5rem;
  transition: transform 0.2s ease-in-out, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.act-achievement-badge:hover {
  transform: rotate(360deg) scale(1.15);
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1); /* Accelerate then decelerate */
}

.act-achievement-unlocked {
  background: linear-gradient(145deg, #34c759, #30d158);
  color: white;
  box-shadow: 0 4px 12px rgba(52, 199, 89, 0.4), 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
}

/* Add subtle shine effect */
.act-achievement-unlocked::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0.05) 40%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(-45deg);
  pointer-events: none;
}

/* Optional: Add a subtle pulse animation for unlocked badges */
@keyframes subtle-pulse {
  0% { box-shadow: 0 4px 12px rgba(52, 199, 89, 0.4), 0 2px 4px rgba(0, 0, 0, 0.1); }
  50% { box-shadow: 0 4px 15px rgba(52, 199, 89, 0.5), 0 2px 5px rgba(0, 0, 0, 0.15); }
  100% { box-shadow: 0 4px 12px rgba(52, 199, 89, 0.4), 0 2px 4px rgba(0, 0, 0, 0.1); }
}

.act-achievement-unlocked:not(:hover) {
  animation: subtle-pulse 2s ease-in-out infinite;
}




.act-achievement-locked {
  filter: grayscale(100%);
  opacity: 0.5;
}

/* Streak styles */
.act-streak-flame {
  color: #ff5722;
}

.act-streak-flame-animated {
  animation: act-flame-pulse 1.5s ease-in-out infinite;
}

@keyframes act-flame-pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.9; }
  100% { transform: scale(1); opacity: 1; }
}

/* Dashboard widget containers */
.act-dashboard-widget {
  background-color: var(--act-white);
  border-radius: var(--act-border-radius);
  box-shadow: var(--act-box-shadow);
}

.act-activity-summary, .act-streak-widget, .act-recent-achievements {
  background-color: var(--act-white);
  border-radius: var(--act-border-radius);
  overflow: hidden;
}

.act-border {
  border: 1px solid var(--act-gray-300);
  border-radius: var(--act-border-radius);
}

/* Alert styling */
.act-alert {
  position: relative;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 0.25rem;
}

.alert-info {
  color: #0c5460;
  background-color: #d1ecf1;
  border-color: #bee5eb;
}


/* Pagination styling */
.act-pagination {
  display: flex;
  padding-left: 0;
  list-style: none;
  border-radius: 0.25rem;
}

.page-item:first-child .page-link {
  margin-left: 0;
  border-top-left-radius: 0.25rem;
  border-bottom-left-radius: 0.25rem;
}

.page-item:last-child .page-link {
  border-top-right-radius: 0.25rem;
  border-bottom-right-radius: 0.25rem;
}

.page-item.active .page-link {
  z-index: 3;
  color: var(--act-white);
  background-color: var(--act-primary);
  border-color: var(--act-primary);
}

.page-item.disabled .page-link {
  color: var(--act-gray-600);
  pointer-events: none;
  cursor: auto;
  background-color: var(--act-white);
  border-color: var(--act-gray-300);
}

.page-link {
  position: relative;
  display: block;
  padding: 0.5rem 0.75rem;
  margin-left: -1px;
  line-height: 1.25;
  color: var(--act-primary);
  background-color: var(--act-white);
  border: 1px solid var(--act-gray-300);
  text-decoration: none;
}

.page-link:hover {
  z-index: 2;
  color: var(--act-primary-dark);
  text-decoration: none;
  background-color: var(--act-gray-200);
  border-color: var(--act-gray-300);
}

/* Utilities */
.text-decoration-none {
  text-decoration: none;
}

.opacity-50 {
  opacity: 0.5;
}

.w-100 {
  width: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  h1.display-5 {
    font-size: 2rem;
  }
  
  .act-card .display-4 {
    font-size: 2rem;
  }
  
  .act-achievement-badge {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }
  
  .container {
    padding-right: 0.5rem;
    padding-left: 0.5rem;
  }
  
  #act-period-form {
    flex-wrap: wrap;
  }
  
  #act-period-form label,
  #act-period-form select,
  #act-period-form button {
    margin-bottom: 0.5rem;
  }
}