/**
 * Page Layout - Content Area Structure
 *
 * Page container, headers, cards og grid layouts
 */

/* ===========================================
   PAGE CONTAINER
   =========================================== */
swp-page-container {
  display: block;
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: var(--spacing-6);
}

/* ===========================================
   PAGE HEADER
   =========================================== */
swp-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--spacing-6);
}

swp-page-title h1 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--spacing-1);
}

swp-page-title p {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
}

swp-page-actions {
  display: flex;
  gap: var(--spacing-2);
}

/* ===========================================
   CARDS
   =========================================== */
swp-card {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-5);
  margin-bottom: var(--spacing-5);
}

swp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: calc(-1 * var(--spacing-5)) calc(-1 * var(--spacing-5)) var(--spacing-4) calc(-1 * var(--spacing-5));
  padding: var(--spacing-4) var(--spacing-5);
  border-bottom: 1px solid var(--color-border);
}

swp-card-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

swp-card-title i {
  font-size: var(--font-size-xl);
  color: var(--color-text-secondary);
}

swp-card-action {
  font-size: var(--font-size-md);
  color: var(--color-teal);
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

swp-card-action:hover {
  opacity: 0.8;
}

swp-card-content {
  display: block;
}

/* Card content with grid lists - auto-detect via :has() */
swp-card-content:has(> swp-booking-list),
swp-card-content:has(> swp-notification-list),
swp-card-content:has(> swp-attention-list) {
  display: grid;
  gap: var(--spacing-4);
}

swp-card-content:has(> swp-booking-list) {
  grid-template-columns: 50px 4px 1fr auto auto;
}

swp-card-content:has(> swp-notification-list) {
  grid-template-columns: 50px 1fr;
}

swp-card-content:has(> swp-attention-list) {
  grid-template-columns: 50px 1fr auto;
}

/* Generic list item title & description */
swp-item-title {
  display: block;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

swp-item-desc {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

/* ===========================================
   DASHBOARD GRID
   =========================================== */
swp-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--spacing-5);
}

swp-main-column,
swp-side-column {
  display: grid;
  gap: var(--spacing-5);
  align-content: start;
}

/* ===========================================
   AI INSIGHT
   =========================================== */
swp-ai-insight {
  display: block;
  padding: var(--spacing-4) var(--spacing-5);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--color-purple) 8%, transparent),
    color-mix(in srgb, var(--color-teal) 8%, transparent)
  );
  border-radius: var(--border-radius);
}

swp-ai-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  margin-bottom: var(--spacing-2);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-purple);
}

swp-ai-header i {
  font-size: var(--font-size-base);
}

swp-ai-text {
  font-size: var(--font-size-base);
  color: var(--color-text);
  line-height: var(--line-height-relaxed);
}

/* ===========================================
   QUICK ACTIONS
   =========================================== */
swp-quick-actions {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
}

swp-quick-action-btn {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  padding: var(--spacing-3);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition-fast);
}

swp-quick-action-btn:hover {
  background: var(--color-background-hover);
  border-color: var(--color-teal);
  color: var(--color-teal);
}

swp-quick-action-btn i {
  font-size: var(--font-size-lg);
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 1200px) {
  swp-dashboard-grid {
    grid-template-columns: 1fr;
  }

  swp-side-column {
    order: -1;
  }
}

@media (max-width: 768px) {
  swp-page-container {
    padding: var(--spacing-4);
  }

  swp-page-header {
    flex-direction: column;
    gap: var(--spacing-4);
  }

  swp-page-actions {
    width: 100%;
  }
}
