/**
 * @file
 * FlowDrop Fullscreen Layout
 *
 * Provides immersive fullscreen layout for dashboard pages while respecting
 * Drupal's admin toolbar. This creates a seamless experience similar to
 * the FlowDrop workflow editor.
 */

/* ========================================================================
 * FULLSCREEN LAYOUT CONTAINER
 * ======================================================================== */

.fd-fullscreen-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--fd-surface-page);
  font-family: var(--fd-font-family-sans);
  line-height: var(--fd-line-height-normal);
  color: var(--fd-color-gray-700);
}

/* Adjust for Drupal toolbar when present */
.toolbar-horizontal .fd-fullscreen-layout {
  min-height: calc(100vh - var(--fd-toolbar-height));
}

.toolbar-horizontal.toolbar-tray-open .fd-fullscreen-layout {
  min-height: calc(100vh - var(--fd-toolbar-height) - var(--fd-toolbar-tray-height));
}

/* Vertical toolbar adjustments */
.toolbar-vertical .fd-fullscreen-layout {
  margin-inline-start: 39px;
}

.toolbar-vertical.toolbar-tray-open .fd-fullscreen-layout {
  margin-inline-start: 240px;
}

/* ========================================================================
 * FULLSCREEN HEADER
 * ======================================================================== */

.fd-fullscreen-header {
  position: sticky;
  top: 0;
  z-index: var(--fd-z-sticky);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--fd-space-6);
  padding: var(--fd-header-padding-y) var(--fd-header-padding-x);
  background-color: var(--fd-header-bg);
  border-block-end: var(--fd-border-width) solid var(--fd-header-border);
  box-shadow: var(--fd-header-shadow);
}

/* Adjust for toolbar */
.toolbar-horizontal .fd-fullscreen-header {
  top: var(--fd-toolbar-height);
}

.toolbar-horizontal.toolbar-tray-open .fd-fullscreen-header {
  top: calc(var(--fd-toolbar-height) + var(--fd-toolbar-tray-height));
}

/* Header sections */
.fd-fullscreen-header__start {
  display: flex;
  align-items: center;
  gap: var(--fd-space-4);
}

.fd-fullscreen-header__center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.fd-fullscreen-header__end {
  display: flex;
  align-items: center;
  gap: var(--fd-space-3);
}

/* ========================================================================
 * FULLSCREEN MAIN CONTENT
 * ======================================================================== */

.fd-fullscreen-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--fd-space-6);
  max-width: 100%;
}

/* Constrained content width */
.fd-fullscreen-main--constrained {
  max-width: 1400px;
  margin-inline: auto;
  width: 100%;
}

/* Full width on smaller screens */
@media (max-width: 1024px) {
  .fd-fullscreen-main {
    padding: var(--fd-space-4);
  }

  .fd-fullscreen-main--constrained {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .fd-fullscreen-main {
    padding: var(--fd-space-3);
  }
}

/* ========================================================================
 * FULLSCREEN SECTIONS
 * ======================================================================== */

.fd-section {
  margin-block-end: var(--fd-space-8);
}

.fd-section:last-child {
  margin-block-end: 0;
}

.fd-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--fd-space-4);
  margin-block-end: var(--fd-space-4);
}

.fd-section__title {
  font-size: var(--fd-font-size-lg);
  font-weight: var(--fd-font-weight-semibold);
  color: var(--fd-color-gray-800);
  margin: 0;
}

.fd-section__description {
  font-size: var(--fd-font-size-sm);
  color: var(--fd-color-gray-500);
  margin: 0;
  margin-block-start: var(--fd-space-1);
}

/* ========================================================================
 * GRID LAYOUTS
 * Note: Primary grid layouts (stats, actions, cards) are now provided by
 * the flowdrop_ui_components:grid component. The classes below are kept
 * for backwards compatibility but new code should use the grid component.
 * ======================================================================== */

/* Legacy grid classes - use flowdrop_ui_components:grid component instead */
.fd-stats-grid,
.fd-actions-grid,
.fd-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--fd-space-4);
  align-items: start;
}

.fd-stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.fd-cards-grid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

@media (max-width: 640px) {
  .fd-stats-grid,
  .fd-actions-grid,
  .fd-cards-grid {
    grid-template-columns: 1fr;
    gap: var(--fd-space-3);
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .fd-stats-grid,
  .fd-actions-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .fd-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

/* Two-column layout */
.fd-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--fd-space-6);
}

@media (min-width: 1024px) {
  .fd-two-col {
    grid-template-columns: 2fr 1fr;
  }
}

/* ========================================================================
 * TOOLBAR AREA (search, filters, view toggles)
 * ======================================================================== */

.fd-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--fd-space-4);
  flex-wrap: wrap;
  margin-block-end: var(--fd-space-6);
}

.fd-toolbar__start {
  display: flex;
  align-items: center;
  gap: var(--fd-space-3);
  flex: 1;
  min-width: 200px;
}

.fd-toolbar__end {
  display: flex;
  align-items: center;
  gap: var(--fd-space-2);
}

/* ========================================================================
 * EMPTY STATE
 * ======================================================================== */

.fd-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--fd-space-12);
  text-align: center;
}

.fd-empty-state__icon {
  width: 4rem;
  height: 4rem;
  margin-block-end: var(--fd-space-4);
  color: var(--fd-color-gray-300);
}

.fd-empty-state__title {
  font-size: var(--fd-font-size-lg);
  font-weight: var(--fd-font-weight-semibold);
  color: var(--fd-color-gray-700);
  margin: 0 0 var(--fd-space-2);
}

.fd-empty-state__description {
  font-size: var(--fd-font-size-sm);
  color: var(--fd-color-gray-500);
  margin: 0 0 var(--fd-space-6);
  max-width: 400px;
}

/* ========================================================================
 * PAGE TRANSITIONS
 * ======================================================================== */

@keyframes fd-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fd-animate-in {
  animation: fd-fade-in var(--fd-transition-normal) ease-out;
}

/* Staggered animation for grid items */
.fd-stagger-in > * {
  animation: fd-fade-in var(--fd-transition-normal) ease-out backwards;
}

.fd-stagger-in > *:nth-child(1) { animation-delay: 0ms; }
.fd-stagger-in > *:nth-child(2) { animation-delay: 50ms; }
.fd-stagger-in > *:nth-child(3) { animation-delay: 100ms; }
.fd-stagger-in > *:nth-child(4) { animation-delay: 150ms; }
.fd-stagger-in > *:nth-child(5) { animation-delay: 200ms; }
.fd-stagger-in > *:nth-child(6) { animation-delay: 250ms; }
.fd-stagger-in > *:nth-child(n+7) { animation-delay: 300ms; }

