/* ================================== */
/* == Dashboard Page Styles == */
/* ================================== */

.dashboard {
  max-width: 1200px; /* Max width for content */
  margin: 0 auto;
  padding-bottom: var(--space-8); /* Add some bottom padding */
}

/* Dashboard Header */
.dashboard-header {
  margin-bottom: var(--space-8);
  padding: var(--space-4) 0; /* Add vertical padding */
  border-bottom: 1px solid var(--color-border);
}
.dashboard-header h1 {
  font-size: var(--font-size-3xl); /* Slightly smaller than 4xl for balance */
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-2);
  color: var(--color-text);
}
.dashboard-header p {
  color: var(--color-text-secondary);
  font-size: var(--font-size-lg);
  margin: 0;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); /* Responsive columns */
  gap: var(--space-6);
  margin-bottom: var(--space-8); /* Was space-10 */
}
/* Stat Card styles are in components.css */

/* Dashboard Content Sections */
.dashboard-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Make sections responsive */
  gap: var(--space-6); /* Was space-8 */
}

.dashboard-section {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  border: 1px solid var(--color-card-border);
  display: flex; /* Use flex for better control */
  flex-direction: column;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4); /* Was space-6 */
  flex-shrink: 0;
}
.section-header h2 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  margin: 0; /* Remove default heading margin */
}

/* Recent Items (Books & Notes) */
.recent-books,
.recent-notes {
  display: flex;
  flex-direction: column;
  gap: var(--space-3); /* Space between items */
  flex-grow: 1; /* Allow list to fill section space */
  overflow-y: auto; /* Allow scrolling if many items */
  max-height: 300px; /* Limit height to prevent huge sections */
}

.recent-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3);
  border-radius: var(--radius-base);
  background-color: var(--color-background);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative; /* For lock icon positioning */
}
.recent-item:hover {
  background-color: var(--color-secondary);
  box-shadow: var(--shadow-sm);
  transform: translateX(2px);
}

.item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  background-color: var(--color-bg-1);
  font-size: var(--font-size-lg);
  flex-shrink: 0;
}

.item-content {
  flex-grow: 1;
  min-width: 0; /* Prevent overflow issues */
}
.item-content h4 {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  margin: 0 0 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-content p {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-1) 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.item-content small {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

.item-lock {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  opacity: 0.7;
}

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); /* Adjusted minmax */
  gap: var(--space-4);
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* Center content vertically */
  gap: var(--space-2); /* Reduced gap */
  padding: var(--space-4); /* Reduced padding */
  background-color: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
  text-align: center;
  min-height: 100px; /* Ensure buttons have some height */
}
.quick-action:hover {
  background-color: var(--color-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary); /* Add border highlight */
}
.quick-action i {
  font-size: var(--font-size-2xl); /* Slightly smaller icon */
  color: var(--color-primary);
  margin-bottom: var(--space-1);
}
.quick-action span {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  line-height: 1.3;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .dashboard-header h1 { font-size: var(--font-size-2xl); }
  .dashboard-header p { font-size: var(--font-size-base); }
  .stats-grid { gap: var(--space-4); }
  .dashboard-content { gap: var(--space-4); }
  .quick-actions { grid-template-columns: repeat(2, 1fr); } /* Ensure 2 columns on tablet */
}

@media (max-width: 480px) {
  .quick-actions { grid-template-columns: repeat(2, 1fr); } /* Keep 2 columns even on mobile */
  .quick-action { padding: var(--space-3); min-height: 80px; }
  .quick-action i { font-size: var(--font-size-xl); }
  .quick-action span { font-size: var(--font-size-xs); }
}
