/* ============================================================
   SMART SHIKSHA - ACTIVITY CENTER
   5-tab widget replacing: Recent Activities, Birthdays,
   Notice Board, Todo, Upcoming Events
   Inspired by Microsoft Teams, Notion & Zoho Dashboard
   ============================================================ */

/* ===== ACTIVITY CENTER CARD ===== */
.activity-center {
  background: var(--erp-surface);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius-lg);
  box-shadow: var(--erp-shadow-md);
  overflow: hidden;
  margin-bottom: 24px;
  transition: var(--erp-transition);
}

.activity-center:hover {
  box-shadow: var(--erp-shadow-lg);
}

/* ===== HEADER ===== */
.activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--erp-border-light);
  background: var(--erp-surface);
}

.activity-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.activity-title h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--erp-text);
  margin: 0;
}

.activity-title .title-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--erp-gradient-purple);
  color: #fff;
  border-radius: var(--erp-radius-sm);
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

.activity-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.activity-toolbar .btn-sm-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--erp-radius-sm);
  background: var(--erp-surface-alt);
  border: 1px solid var(--erp-border);
  color: var(--erp-text-secondary);
  cursor: pointer;
  transition: var(--erp-transition);
  font-size: 0.9rem;
}

.activity-toolbar .btn-sm-icon:hover {
  background: var(--erp-primary-soft);
  border-color: var(--erp-primary);
  color: var(--erp-primary);
}

.activity-toolbar .ac-search-box {
  display: flex;
  align-items: center;
  background: var(--erp-surface-alt);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius-sm);
  padding: 0 10px;
  transition: var(--erp-transition);
}

.activity-toolbar .ac-search-box:focus-within {
  border-color: var(--erp-primary);
  box-shadow: var(--erp-shadow-glow);
  background: var(--erp-surface);
}

.activity-toolbar .ac-search-box input {
  border: none;
  background: transparent;
  padding: 6px 8px;
  font-size: 0.8rem;
  color: var(--erp-text);
  outline: none;
  width: 140px;
}

.activity-toolbar .ac-search-box i {
  color: var(--erp-text-muted);
  font-size: 0.85rem;
}

.activity-toolbar .ac-filter-btn {
  position: relative;
}

/* ===== TABS ===== */
.activity-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 20px;
  background: var(--erp-surface-alt);
  border-bottom: 1px solid var(--erp-border);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: sticky;
  top: 0;
  z-index: 2;
}

.activity-tabs::-webkit-scrollbar {
  display: none;
}

.activity-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--erp-text-secondary);
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  transition: var(--erp-transition);
  white-space: nowrap;
  text-decoration: none;
}

.activity-tab i {
  font-size: 0.9rem;
  opacity: 0.7;
  transition: var(--erp-transition);
}

.activity-tab:hover {
  color: var(--erp-primary);
  background: var(--erp-primary-softer);
}

.activity-tab:hover i { opacity: 1; }

.activity-tab.active {
  color: var(--erp-primary);
  border-bottom-color: var(--erp-primary);
  background: transparent;
}

.activity-tab.active i { opacity: 1; }

.activity-tab .tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 0.65rem;
  font-weight: 600;
  background: var(--erp-primary-soft);
  color: var(--erp-primary);
}

/* ===== PANELS ===== */
.activity-panel {
  display: none;
  padding: 16px 20px;
  animation: ac-fade-in 0.3s ease-out;
  max-height: 500px;
  overflow-y: auto;
}

.activity-panel.active {
  display: block;
}

.activity-panel::-webkit-scrollbar {
  width: 4px;
}

.activity-panel::-webkit-scrollbar-thumb {
  background: var(--erp-border);
  border-radius: 2px;
}

/* ===== 1. TIMELINE (Recent Activities) ===== */
.ac-timeline {
  position: relative;
  padding-left: 0;
}

.ac-timeline-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--erp-border-light);
  transition: var(--erp-transition);
}

.ac-timeline-item:last-child {
  border-bottom: none;
}

.ac-timeline-item:hover {
  background: var(--erp-surface-alt);
  margin: 0 -12px;
  padding: 10px 12px;
  border-radius: var(--erp-radius-sm);
}

.ac-timeline-dot {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.9rem;
  flex-shrink: 0;
  border: 2px solid var(--erp-surface);
  box-shadow: var(--erp-shadow-sm);
}

.ac-timeline-dot.blue { background: var(--erp-gradient-blue); }
.ac-timeline-dot.green { background: var(--erp-gradient-green); }
.ac-timeline-dot.orange { background: var(--erp-gradient-orange); }
.ac-timeline-dot.red { background: var(--erp-gradient-red); }
.ac-timeline-dot.purple { background: var(--erp-gradient-purple); }
.ac-timeline-dot.teal { background: var(--erp-gradient-teal); }
.ac-timeline-dot.pink { background: var(--erp-gradient-pink); }
.ac-timeline-dot.info { background: var(--erp-gradient-indigo); }

.ac-timeline-body {
  flex: 1;
  min-width: 0;
}

.ac-timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.ac-timeline-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--erp-text);
  margin: 0;
}

.ac-timeline-time {
  font-size: 0.7rem;
  color: var(--erp-text-muted);
  white-space: nowrap;
}

.ac-timeline-desc {
  font-size: 0.78rem;
  color: var(--erp-text-secondary);
  margin: 2px 0 0 0;
}

.ac-timeline-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.ac-timeline-meta span {
  font-size: 0.68rem;
  color: var(--erp-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ac-timeline-status {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.ac-timeline-status.success { background: var(--erp-success-soft); color: var(--erp-success); }
.ac-timeline-status.warning { background: var(--erp-warning-soft); color: var(--erp-warning); }
.ac-timeline-status.danger { background: var(--erp-danger-soft); color: var(--erp-danger); }
.ac-timeline-status.info { background: var(--erp-info-soft); color: var(--erp-info); }

/* ===== 2. BIRTHDAYS ===== */
.ac-birthday-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 575.98px) {
  .ac-birthday-grid {
    grid-template-columns: 1fr;
  }
}

.ac-birthday-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--erp-surface-alt);
  border: 1px solid var(--erp-border-light);
  border-radius: var(--erp-radius);
  transition: var(--erp-transition);
  position: relative;
  overflow: hidden;
}

.ac-birthday-card:hover {
  background: var(--erp-surface);
  box-shadow: var(--erp-shadow);
  transform: translateY(-2px);
}

.ac-birthday-card.today {
  border-color: var(--erp-primary);
  background: var(--erp-primary-softer);
}

.ac-birthday-card.today::before {
  content: '🎂';
  position: absolute;
  top: -6px;
  right: -4px;
  font-size: 1.5rem;
  opacity: 0.3;
  transform: rotate(15deg);
}

.ac-birthday-avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--erp-border);
  flex-shrink: 0;
}

.ac-birthday-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ac-birthday-info {
  flex: 1;
  min-width: 0;
}

.ac-birthday-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--erp-text);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ac-birthday-detail {
  font-size: 0.72rem;
  color: var(--erp-text-secondary);
  margin: 1px 0 0 0;
}

.ac-birthday-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  background: var(--erp-primary-soft);
  color: var(--erp-primary);
}

.ac-birthday-card.today .ac-birthday-badge {
  background: var(--erp-primary);
  color: #fff;
}

.ac-birthday-action {
  width: 30px;
  height: 30px;
  min-width: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--erp-surface);
  border: 1px solid var(--erp-border);
  color: var(--erp-pink);
  cursor: pointer;
  transition: var(--erp-transition);
  font-size: 0.8rem;
}

.ac-birthday-action:hover {
  background: var(--erp-pink-soft);
  border-color: var(--erp-pink);
  transform: scale(1.1);
}

/* ===== 3. NOTICE BOARD ===== */
.ac-notice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ac-notice-card {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  background: var(--erp-surface-alt);
  border: 1px solid var(--erp-border-light);
  border-radius: var(--erp-radius);
  border-left: 3px solid var(--erp-primary);
  transition: var(--erp-transition);
}

.ac-notice-card:hover {
  background: var(--erp-surface);
  box-shadow: var(--erp-shadow);
  transform: translateX(3px);
}

.ac-notice-card.priority-high { border-left-color: var(--erp-danger); }
.ac-notice-card.priority-medium { border-left-color: var(--erp-warning); }
.ac-notice-card.priority-low { border-left-color: var(--erp-success); }

.ac-notice-card.pinned {
  background: var(--erp-primary-softer);
}

.ac-notice-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: var(--erp-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: #fff;
  flex-shrink: 0;
}

.ac-notice-icon.red { background: var(--erp-gradient-red); }
.ac-notice-icon.blue { background: var(--erp-gradient-blue); }
.ac-notice-icon.green { background: var(--erp-gradient-green); }
.ac-notice-icon.orange { background: var(--erp-gradient-orange); }

.ac-notice-body { flex: 1; min-width: 0; }

.ac-notice-title {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--erp-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ac-notice-title .pinned-badge {
  font-size: 0.6rem;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--erp-primary-soft);
  color: var(--erp-primary);
  font-weight: 600;
}

.ac-notice-desc {
  font-size: 0.75rem;
  color: var(--erp-text-secondary);
  margin: 2px 0 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ac-notice-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.ac-notice-meta span {
  font-size: 0.68rem;
  color: var(--erp-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.ac-notice-meta .attachment-icon {
  color: var(--erp-primary);
  cursor: pointer;
}

/* ===== 4. TODO ===== */
.ac-todo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
  flex-wrap: wrap;
}

.ac-todo-stats {
  display: flex;
  gap: 12px;
}

.ac-todo-stat {
  text-align: center;
  padding: 6px 12px;
  background: var(--erp-surface-alt);
  border-radius: var(--erp-radius-sm);
  min-width: 60px;
}

.ac-todo-stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--erp-text);
  line-height: 1;
}

.ac-todo-stat-label {
  font-size: 0.62rem;
  color: var(--erp-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 2px;
}

.ac-todo-filters {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ac-todo-filter {
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: 14px;
  border: 1px solid var(--erp-border);
  background: transparent;
  color: var(--erp-text-secondary);
  cursor: pointer;
  transition: var(--erp-transition);
}

.ac-todo-filter:hover {
  border-color: var(--erp-primary);
  color: var(--erp-primary);
}

.ac-todo-filter.active {
  background: var(--erp-primary);
  border-color: var(--erp-primary);
  color: #fff;
}

.ac-todo-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}

.ac-todo-list::-webkit-scrollbar { width: 4px; }
.ac-todo-list::-webkit-scrollbar-thumb { background: var(--erp-border); border-radius: 2px; }

.ac-todo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--erp-surface-alt);
  border: 1px solid var(--erp-border-light);
  border-radius: var(--erp-radius-sm);
  transition: var(--erp-transition);
  cursor: grab;
}

.ac-todo-item:hover {
  background: var(--erp-surface);
  box-shadow: var(--erp-shadow-sm);
}

.ac-todo-item.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.ac-todo-check {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border-radius: 50%;
  border: 2px solid var(--erp-border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--erp-transition);
  font-size: 0.6rem;
  color: transparent;
  padding: 0;
}

.ac-todo-check:hover {
  border-color: var(--erp-success);
}

.ac-todo-check.checked {
  background: var(--erp-success);
  border-color: var(--erp-success);
  color: #fff;
}

.ac-todo-content {
  flex: 1;
  min-width: 0;
}

.ac-todo-text {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--erp-text);
  margin: 0;
}

.ac-todo-text.done {
  text-decoration: line-through;
  color: var(--erp-text-muted);
}

.ac-todo-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.ac-todo-priority {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  text-transform: uppercase;
}

.ac-todo-priority.high { background: var(--erp-danger-soft); color: var(--erp-danger); }
.ac-todo-priority.medium { background: var(--erp-warning-soft); color: var(--erp-warning); }
.ac-todo-priority.low { background: var(--erp-success-soft); color: var(--erp-success); }

.ac-todo-date {
  font-size: 0.65rem;
  color: var(--erp-text-muted);
}

.ac-todo-actions {
  display: flex;
  gap: 4px;
}

.ac-todo-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--erp-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: var(--erp-transition);
}

.ac-todo-btn:hover {
  background: var(--erp-surface-alt);
  color: var(--erp-text);
}

.ac-todo-btn.delete:hover { color: var(--erp-danger); }

.ac-todo-add {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px dashed var(--erp-border);
  border-radius: var(--erp-radius-sm);
  background: transparent;
  cursor: pointer;
  transition: var(--erp-transition);
  color: var(--erp-text-muted);
}

.ac-todo-add:hover {
  border-color: var(--erp-primary);
  color: var(--erp-primary);
  background: var(--erp-primary-softer);
}

.ac-todo-add i { font-size: 0.9rem; }
.ac-todo-add span { font-size: 0.8rem; }

/* ===== 5. EVENTS ===== */
.ac-events-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--erp-border-light);
  margin-bottom: 12px;
}

.ac-events-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ac-event-card {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  background: var(--erp-surface-alt);
  border: 1px solid var(--erp-border-light);
  border-radius: var(--erp-radius);
  transition: var(--erp-transition);
  align-items: center;
}

.ac-event-card:hover {
  background: var(--erp-surface);
  box-shadow: var(--erp-shadow);
  transform: translateY(-2px);
}

.ac-event-date-box {
  width: 48px;
  min-width: 48px;
  text-align: center;
  padding: 6px 4px;
  background: var(--erp-surface);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius-sm);
}

.ac-event-date-box .month {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--erp-primary);
  text-transform: uppercase;
  display: block;
  line-height: 1;
}

.ac-event-date-box .day {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--erp-text);
  display: block;
  line-height: 1.2;
}

.ac-event-body { flex: 1; min-width: 0; }

.ac-event-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--erp-text);
  margin: 0;
}

.ac-event-details {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.ac-event-details span {
  font-size: 0.7rem;
  color: var(--erp-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.ac-event-type {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
}

.ac-event-type.exam { background: var(--erp-danger-soft); color: var(--erp-danger); }
.ac-event-type.holiday { background: var(--erp-success-soft); color: var(--erp-success); }
.ac-event-type.sports { background: var(--erp-orange-soft, #fef3c7); color: var(--erp-warning); }
.ac-event-type.meeting { background: var(--erp-info-soft); color: var(--erp-info); }
.ac-event-type.holiday { background: var(--erp-success-soft); color: var(--erp-success); }
.ac-event-type.holidays { background: var(--erp-success-soft); color: var(--erp-success); }
.ac-event-type.celebration { background: var(--erp-pink-soft, #fce7f3); color: var(--erp-pink, #db2777); }
.ac-event-type.training { background: var(--erp-orange-soft, #fef3c7); color: var(--erp-warning, #d97706); }
.ac-event-type.ptm { background: var(--erp-purple-soft); color: var(--erp-purple); }
.ac-event-type.function { background: var(--erp-pink-soft); color: var(--erp-pink); }
.ac-event-type.competition { background: var(--erp-teal-soft); color: var(--erp-teal); }

.ac-event-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.ac-event-countdown {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--erp-primary);
  white-space: nowrap;
}

.ac-event-countdown.soon {
  color: var(--erp-danger);
  animation: ac-pulse 1.5s infinite;
}

.ac-event-actions {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}

.ac-event-actions .btn {
  padding: 2px 6px;
  font-size: 0.7rem;
  line-height: 1;
  border-radius: 4px;
}

@keyframes ac-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ===== EMPTY STATES ===== */
.ac-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--erp-text-muted);
}

.ac-empty i {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.3;
}

.ac-empty h6 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--erp-text-secondary);
  margin-bottom: 4px;
}

.ac-empty p {
  font-size: 0.78rem;
  margin: 0;
}

/* ===== SEARCH HIGHLIGHT ===== */
.ac-highlight {
  background: var(--erp-warning-soft);
  padding: 0 2px;
  border-radius: 2px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 767.98px) {
  .activity-header {
    padding: 12px 14px;
  }

  .activity-title h3 {
    font-size: 0.95rem;
  }

  .activity-tabs {
    padding: 0 12px;
  }

  .activity-tab {
    padding: 8px 12px;
    font-size: 0.75rem;
  }

  .activity-panel {
    padding: 12px 14px;
    max-height: 400px;
  }

  .activity-toolbar .ac-search-box input {
    width: 90px;
    font-size: 0.72rem;
  }

  .ac-birthday-grid {
    grid-template-columns: 1fr;
  }

  .ac-todo-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .ac-todo-stats {
    width: 100%;
    justify-content: space-around;
  }
}

@media (max-width: 575.98px) {
  .activity-toolbar .ac-search-box { display: none; }
  .ac-timeline-meta { flex-direction: column; gap: 4px; }
  .ac-event-card { flex-wrap: wrap; }
}
