// ============================================================================
// Global Action Modal — Tactical Dark Mode Styling
// Uses Control Center design tokens from styles.scss
// ============================================================================

// ---------------------------------------------------------------------------
// Backdrop
// ---------------------------------------------------------------------------
:host {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.global-action-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

// ---------------------------------------------------------------------------
// Modal Panel
// ---------------------------------------------------------------------------
.global-action-modal__panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 48px));
  background: var(--cc-surface-container);
  border: 1px solid var(--cc-outline);
  border-radius: var(--cc-card-border-radius);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

// ---------------------------------------------------------------------------
// Header
// ---------------------------------------------------------------------------
.global-action-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 12px;
}

.global-action-modal__title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--cc-on-surface);
  letter-spacing: 0.01em;
}

.global-action-modal__close {
  --mat-icon-button-state-layer-color: transparent;
  color: var(--cc-on-surface-variant);

  &:hover {
    color: var(--cc-on-surface);
  }
}

// ---------------------------------------------------------------------------
// Action Grid
// ---------------------------------------------------------------------------
.global-action-modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px 24px 24px;
}

// ---------------------------------------------------------------------------
// Action Button
// ---------------------------------------------------------------------------
.global-action-modal__action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  border: 1px solid var(--cc-outline);
  border-radius: 12px;
  background: var(--cc-surface);
  color: var(--cc-on-surface);
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 100ms ease;
  font-family: inherit;
  text-align: center;

  &:hover {
    background: var(--cc-surface-container-high);
    border-color: var(--cc-on-surface-variant);
    transform: translateY(-1px);
  }

  &:active {
    transform: translateY(0);
  }

  &:focus-visible {
    outline: 2px solid var(--mat-sys-primary, #38BDF8);
    outline-offset: 2px;
  }
}

// Action icon wrapper
.global-action-modal__action-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;

  .mat-icon {
    width: 28px;
    height: 28px;
    font-size: 28px;
  }
}

// Action label
.global-action-modal__action-label {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

// Action description
.global-action-modal__action-desc {
  font-size: 12px;
  color: var(--cc-on-surface-variant);
  line-height: 1.4;
}

// ---------------------------------------------------------------------------
// Color Variants — per-action accent colors
// ---------------------------------------------------------------------------
.global-action-modal__action-btn--deploy {
  .global-action-modal__action-icon {
    background: var(--status-active-bg);
    color: var(--status-active);
  }

  &:hover {
    border-color: var(--status-active);
  }
}

.global-action-modal__action-btn--pause {
  .global-action-modal__action-icon {
    background: var(--status-idle-bg);
    color: var(--status-idle);
  }

  &:hover {
    border-color: var(--status-idle);
  }
}

.global-action-modal__action-btn--emergency {
  .global-action-modal__action-icon {
    background: var(--status-error-bg);
    color: var(--status-error);
  }

  &:hover {
    border-color: var(--status-error);
  }

  .global-action-modal__action-label {
    color: var(--status-error);
  }
}

.global-action-modal__action-btn--add {
  .global-action-modal__action-icon {
    background: var(--status-thinking-bg);
    color: var(--status-thinking);
  }

  &:hover {
    border-color: var(--status-thinking);
  }
}

// ---------------------------------------------------------------------------
// Responsive — stack single column on narrow viewports
// ---------------------------------------------------------------------------
@media (max-width: 400px) {
  .global-action-modal__actions {
    grid-template-columns: 1fr;
  }
}