/* ------------------------------------------------------
   Root Dashboard Layout
------------------------------------------------------ */
.dashboard-container {
  padding-top: 20px;
  min-height: 100vh;
}

.main-content {
  padding: 0 0 2rem 0;
}

.container {
  max-width: 100rem;
}

.navbar.sticky-top {
  position: static !important;
}

/* ------------------------------------------------------
   Sidebar
------------------------------------------------------ */
.sidebar {
  position: sticky;
  top: 10px;
  height: calc(100vh - 20px);
  padding: 1rem;
  border-radius: 16px;
  overflow-y: auto;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  margin-bottom: 1rem;
}

.sidebar-user {
  text-align: center;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid #e9ecef;
}

.user-avatar {
  width: 80px;
  height: 80px;
  margin-bottom: 0.5rem;
  border-radius: 50%;
  border: 4px solid white;
  object-fit: cover;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.user-name {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.user-plan {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
}

/* Sidebar Navigation */
.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  height: calc(100vh - 210px);
}

.sidebar-nav li {
  margin-bottom: 0.25rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 5px;
  text-decoration: none;
  transition: all 0.3s ease;
  color: var(--bs-secondary-text-emphasis);
}

.sidebar-nav a:hover {
  background-color: rgba(78, 84, 200, 0.05);
  color: var(--primary);
}

.sidebar-nav a.active {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.sidebar-nav i {
  width: 20px;
  margin-right: 0.75rem;
  font-size: 1.1rem;
  text-align: center;
}

/* Forum Sidebar */
.forum-sidebar {
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
}

.sidebar-section {
  margin-bottom: 2rem;
}

.sidebar-section:last-child {
  margin-bottom: 0;
}

.sidebar-title {
  font-weight: 600;
  margin-bottom: 1rem;

  font-size: 1.1rem;
}

.trending-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.trending-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #e9ecef;
}

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

.trending-number {
  font-weight: 700;
  color: var(--primary);
  margin-right: 0.75rem;
  min-width: 20px;
}

.trending-title {
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--bs-secondary-color) !important;
}

.trending-title:hover {
  color: var(--primary);
}

@media (max-width: 992px) {
  .forum-categories {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .topic-stats {
    min-width: 120px;
  }
}

@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .forum-stats {
    flex-wrap: wrap;
    justify-content: center;
  }

  .topic-item {
    flex-direction: column;
  }

  .topic-stats {
    justify-content: flex-start;
    margin-top: 1rem;
  }

  .question-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* ------------------------------------------------------
   Welcome Banner
------------------------------------------------------ */
.welcome-banner {
  padding: 2rem;
  margin-bottom: 2rem;
  color: white;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 10px 25px rgba(78, 84, 200, 0.3);
}

.welcome-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.welcome-subtitle {
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

/* ------------------------------------------------------
   Cards
------------------------------------------------------ */
.card-dashboard,
.card-progress {
  margin-bottom: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.card-progress {
  border: none;
}

.card-header {
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  background: transparent;
  border-bottom: 1px solid #e9ecef;
}

.card-body {
  padding: 1.5rem;
}

/* Original Results Grid (Preserved) */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Original Result Card Styles (Preserved) */
.result-card {
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: block;
  position: relative;
}

.result-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.result-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.result-content {
  padding: 1.25rem;
}

.result-type {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  position: absolute;
  top: 15px;
  right: 15px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 2;
}

.result-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.result-description {
  font-size: 0.875rem;
  color: #6c757d;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.result-meta {
  font-size: 0.875rem;
}

.result-stats {
  display: flex;
  gap: 1rem;
}

.stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ------------------------------------------------------
   Exam Items
------------------------------------------------------ */
.exam-item,
.progress-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
}

.exam-item:hover,
.progress-item:hover {
  border-color: var(--primary);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.exam-icon,
.progress-icon {
  width: 50px;
  height: 50px;
  margin-right: 1rem;
  flex-shrink: 0;
  font-size: 1.25rem;
  color: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.exam-content,
.progress-content {
  flex-grow: 1;
}

.exam-title,
.progress-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.exam-subtitle,
.progress-subtitle {
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  color: #6c757d;
}

/* Progress Bars */
.exam-progress,
.progress-bar-container {
  height: 6px;
  border-radius: 3px;
  background-color: #e9ecef;
  overflow: hidden;
}

.progress-bar-container {
  height: 8px;
  border-radius: 4px;
}

.exam-progress-bar,
.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  transition: width 0.5s ease;
}

.progress-percentage {
  margin-left: 1rem;
  font-weight: 600;
  color: var(--primary);
}

/* ------------------------------------------------------
   Activity List
------------------------------------------------------ */
.recent-activity {
  list-style: none;
  padding: 0;
  margin: 0;
}

.activity-item {
  display: flex;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e9ecef;
}

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

.activity-icon {
  width: 40px;
  height: 40px;
  margin-right: 1rem;
  flex-shrink: 0;
  font-size: 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.activity-icon.success {
  background: rgba(32, 201, 151, 0.1);
  color: var(--success);
}

.activity-icon.primary {
  background: rgba(78, 84, 200, 0.1);
  color: var(--primary);
}

.activity-icon.warning {
  background: rgba(255, 193, 7, 0.1);
  color: var(--warning);
}

.activity-content {
  flex-grow: 1;
}

.activity-text {
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
}

.activity-time {
  font-size: 0.75rem;
  color: var(--bs-secondary-color) !important;
}

/* ------------------------------------------------------
   Search Hero
------------------------------------------------------ */
.search-hero {
  padding: 2rem;
  margin-bottom: 1rem;
  text-align: center;
  border-radius: 16px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.search-box-large {
  position: relative;
  max-width: 700px;
  margin: 0 auto 1.5rem;
}

.search-input-large {
  height: 60px;
  padding-left: 3.5rem;
  padding-right: 3rem;
  font-size: 1.1rem;
  border-radius: 50px;
  border: 2px solid #e9ecef;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.search-input-large:focus {
  border-color: var(--primary);
  box-shadow: 0 5px 15px rgba(78, 84, 200, 0.2);
}

.search-icon-large {
  position: absolute;
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: #6c757d;
}

.search-categories {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.search-category {
  padding: 0.3rem 1rem;
  font-weight: 500;
  border-radius: 25px;
  border: 1px solid #e9ecef;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-category:hover,
.search-category.active {
  color: white;
  background: var(--primary);
  border-color: var(--primary);
}

/* ------------------------------------------------------
   Results Section
------------------------------------------------------ */
.results-section {
  margin-bottom: 2rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.view-all {
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
}

.view-all:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------
   Loading State
------------------------------------------------------ */
.loading-state {
  text-align: center;
  padding: 2rem;
  grid-column: 1 / -1;
}

.spinner {
  width: 2rem;
  height: 2rem;
  margin: 0 auto 1rem;
  border: 3px solid #e9ecef;
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------
   Page Header & Stats
------------------------------------------------------ */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  font-size: 1.1rem;
  color: var(--bs-secondary-color) !important;
}

.stats-grid {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.stat-card {
  padding: 1.5rem;
  text-align: center;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.stat-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 1rem;
  font-size: 1.5rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon.primary {
  background: rgba(78, 84, 200, 0.1);
  color: var(--primary);
}

.stat-icon.success {
  background: rgba(32, 201, 151, 0.1);
  color: var(--success);
}

.stat-icon.warning {
  background: rgba(255, 193, 7, 0.1);
  color: var(--warning);
}

.stat-icon.accent {
  background: rgba(255, 107, 107, 0.1);
  color: var(--accent);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--bs-secondary-color) !important;
}

/* ------------------------------------------------------
   Streaks & Badges
------------------------------------------------------ */
.streak-card {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  color: white;
  text-align: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.streak-number {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.streak-label {
  font-size: 1rem;
  opacity: 0.9;
  margin-bottom: 1rem;
}

.badge-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}

.badge-item {
  padding: 1rem;
  text-align: center;
  border-radius: 12px;
  background: #f8f9fa;
  transition: all 0.3s ease;
}

.badge-item.earned {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.badge-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.badge-name {
  font-size: 0.875rem;
  font-weight: 600;
}

/* ------------------------------------------------------
   Notifications
------------------------------------------------------ */
.notification-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-btn {
  padding: 0.3rem 1rem;
  border-radius: 25px;
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
  color: white;
  background: var(--primary);
  border-color: var(--primary);
}

.notification-card {
  margin-bottom: 1rem;
  border-radius: 12px;
  border: none;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.notification-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.notification-card.unread {
  border-left: 4px solid var(--primary);
}

.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e9ecef;
}

.notification-content {
  padding: 1.5rem;
}

.notification-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.notification-message {
  margin-bottom: 1rem;
  line-height: 1.5;
  color: var(--bs-secondary-color) !important;
}

.notification-time {
  font-size: 0.875rem;
  color: var(--bs-secondary-color) !important;
}

.notification-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.notification-icon {
  width: 40px;
  height: 40px;
  margin-right: 1rem;
  flex-shrink: 0;
  font-size: 1.1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-icon.primary {
  background: rgba(78, 84, 200, 0.1);
  color: var(--primary);
}

.notification-icon.success {
  background: rgba(32, 201, 151, 0.1);
  color: var(--success);
}

.notification-icon.warning {
  background: rgba(255, 193, 7, 0.1);
  color: var(--warning);
}

.notification-icon.accent {
  background: rgba(255, 107, 107, 0.1);
  color: var(--accent);
}

.notification-icon.info {
  background: rgba(13, 202, 240, 0.1);
  color: #0dcaf0;
}

.notification-badge {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  border-radius: 12px;
  background: var(--accent);
}

.mark-all-read {
  background: transparent;
  border: none;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}

/* ------------------------------------------------------
   Empty State
------------------------------------------------------ */
.empty-state {
  padding: 3rem;
  text-align: center;
  color: #6c757d;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #dee2e6;
}

/* ------------------------------------------------------
   Responsive
------------------------------------------------------ */
@media (max-width: 992px) {
  .sidebar {
    height: auto;
    position: static;
    margin-bottom: 2rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .results-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .exam-item,
  .progress-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .exam-actions {
    width: 100%;
    margin-top: 1rem;
    justify-content: flex-end;
  }

  .search-categories {
    flex-direction: column;
    align-items: center;
  }

  .search-category {
    width: 200px;
    text-align: center;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

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

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .progress-percentage {
    margin-left: 0;
    margin-top: 0.5rem;
  }
}

.progress-bar-v2 {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  height: 6px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.progress-fill-v2 {
  background: #4caf50;
  height: 100%;
  border-radius: 10px;
  transition: width 0.3s ease;
}

@media (max-width: 1240px) and (min-width: 500px) {
  .truncate-sm {
    overflow: hidden;
    display: -webkit-box;
    text-overflow: ellipsis;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
  }
}
