/* Dashboard Layout */
.dashboard-container {
  display: flex;
  min-height: calc(100vh - 64px);
  /* Adjust based on navbar height */
  background-color: var(--bg-color);
}

/* Sidebar */
.dashboard-sidebar {
  width: 280px;
  background-color: var(--card-bg);
  border-right: 1px solid var(--border-color);
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.sidebar-nav-item:hover {
  background-color: var(--bg-color);
  color: var(--text-main);
}

.sidebar-nav-item.active {
  background-color: var(--bg-color);
  color: var(--primary-color);
  border-color: var(--border-color);
  font-weight: 600;
}

.sidebar-icon {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

.sidebar-nav-item.active .sidebar-icon {
  opacity: 1;
  color: var(--primary-color);
}

/* Main Content Area */
.dashboard-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Section Headers */
.section-header {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Cards & Grids */
.dashboard-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

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

.stat-card {
  background-color: var(--card-bg);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0.5rem 0;
}

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

/* History List */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.history-item {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  transition: transform 0.2s ease;
  cursor: pointer;
  /* Added cursor pointer */
}

.history-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.history-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.history-content {
  color: var(--text-main);
  line-height: 1.5;
}

/* Plan Styles */
.plan-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background-color: var(--primary-color);
  color: var(--bg-color);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.plans-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.plan-card {
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: 8px;
  background-color: var(--card-bg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.plan-card.active-plan {
  border-color: var(--primary-color);
  background-color: var(--bg-color);
}

.plan-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.plan-name {
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
  color: var(--text-main);
}

.plan-price {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.plan-duration {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.plan-feature-item {
  margin-bottom: 0.5rem;
}

.plan-btn {
  width: 100%;
}

.plan-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Tips Section */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.tip-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
}

.tip-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.tip-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.tip-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

.plan-validity {
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* Pagination */
.pagination-container {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
}

.pagination {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
}

.pagination a,
.pagination em {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--card-bg);
  color: var(--text-main);
  transition: all 0.2s ease;
  text-decoration: none;
  font-style: normal;
}

.pagination a:hover {
  background-color: var(--bg-color);
  border-color: var(--primary-color);
}

.pagination .current {
  background-color: var(--primary-color);
  color: var(--bg-color);
  border-color: var(--primary-color);
}

.pagination .disabled {
  cursor: not-allowed;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--card-bg);
  color: var(--text-main);
  transition: all 0.2s ease;
  text-decoration: none;
  font-style: normal;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  background-color: var(--card-bg);
  margin: 5% auto;
  padding: 2rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 80%;
  max-width: 800px;
  box-shadow: var(--shadow-md);
  position: relative;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.close-modal {
  color: var(--text-secondary);
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}

.close-modal:hover,
.close-modal:focus {
  color: var(--text-main);
  text-decoration: none;
}

.detail-group {
  margin-bottom: 1.5rem;
}

.detail-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.detail-text {
  background-color: var(--bg-color);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Analytics Dashboard Styles */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background-color: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.stat-change {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  font-weight: 500;
}

.stat-change.positive {
  color: #10b981;
}

.stat-change.negative {
  color: #ef4444;
}

.stat-change span {
  color: var(--text-secondary);
  font-weight: 400;
}

/* Chart Section */
.chart-section {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.chart-section .section-header {
  margin-bottom: 1rem;
}

.chart-section .section-title {
  font-size: 1.25rem;
  margin-bottom: 0;
}

.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

/* Badges Section */
.badges-section {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.badges-section .section-header {
  margin-bottom: 1.5rem;
}

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

.badge-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-color);
  transition: all 0.2s ease;
}

.badge-card.earned {
  background-color: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

.badge-card.locked {
  opacity: 0.6;
}

.badge-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.badge-info {
  flex: 1;
}

.badge-name {
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.badge-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.badge-earned {
  font-size: 0.75rem;
  color: #10b981;
  font-weight: 500;
}

.badge-progress {
  margin-top: 0.5rem;
}

.progress-bar {
  height: 6px;
  background-color: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.progress-fill {
  height: 100%;
  background-color: var(--primary-color);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
}