/* =============================================================================
   BRAND CSS — Axpo IT Hub Design System
   Reusable stylesheet for Django templates. Include with:
   {% load static %}<link rel="stylesheet" href="{% static 'app/brand.css' %}">
   ============================================================================= */

/* ---------------------------------------------------------------------------
   1. CSS VARIABLES (Design tokens)
   --------------------------------------------------------------------------- */
:root {
  /* Brand */
  --color-brand:          #313193;
  --color-primary:        #ff5d64;
  --color-secondary:      #4545cf;
  --color-tertiary:       #00ecd1;
  --color-success:        #00a486;
  --color-danger:         #b00020;

  /* Axpo blue */
  --color-axpo-blue:      #313193;
  --color-axpo-blue-light:#6a6ad9;

  /* Text */
  --color-text-highlight: #1f1f1f;
  --color-text-highlight-brand: #1d1d57;
  --color-text-primary:   #3d3d3d;
  --color-text-secondary: #8d8d8d;
  --color-text-link:      #ff5d64;
  --color-text-brand:     #313193;

  /* Surfaces & backgrounds */
  --color-background:     #ffffff;
  --color-background-1:   #f5f4f5;
  --color-background-2:   #efeff0;
  --color-background-brand: #ececfa;
  --color-surface:        #f8f8f8;

  /* Accent */
  --color-accent-surface: #313193;
  --color-accent-surface-hover: #1d1d57;
  --color-accent-surface-disabled: #ececfa;
  --color-accent-border:  #3f3fbc;
  --color-accent-foreground: #ffffff;

  /* Borders */
  --color-border:         #bebebe;
  --color-border-soft:    #d8d8d8;
  --color-border-brand:   #313193;

  /* Disabled */
  --color-disabled:       #ecdcdd;
  --color-disabled-brand: #8282df;

  /* Gradients */
  --gradient-brand: linear-gradient(135deg, #ffed57 0%, #ff5d64 25%, #4545cf 100%);

  /* Shadows */
  --shadow-soft:  0px 0px 30px 0px rgba(61, 61, 61, 0.10);
  --shadow-hover: 0px 0px 30px 0px rgba(61, 61, 61, 0.15);

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Cascadia Code", monospace;
}

/* ---------------------------------------------------------------------------
   2. BASE RESET
   --------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: var(--font-sans);
  background-color: var(--color-background-1);
  color: var(--color-text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-text-link);
  text-decoration: none;
  font-weight: 500;
}
a:hover { color: var(--color-primary); }

/* ---------------------------------------------------------------------------
   3. HEADER
   --------------------------------------------------------------------------- */
.brand-header {
  position: sticky;
  top: 0;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-background);
  padding: 1rem 2rem;
  box-shadow: var(--shadow-soft);
}

.brand-header__left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-header__divider {
  width: 1px;
  height: 1.5rem;
  background: var(--color-border);
}

.brand-header__app-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text-primary);
  text-decoration: none;
}

.brand-header__right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ---------------------------------------------------------------------------
   4. LOGO
   --------------------------------------------------------------------------- */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.brand-logo__icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   5. LAYOUT
   --------------------------------------------------------------------------- */
.brand-page {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.brand-container {
  width: 100%;
  max-width: 640px;
}

/* ---------------------------------------------------------------------------
   6. CARD
   --------------------------------------------------------------------------- */
.brand-card {
  background: var(--color-background);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-border-soft);
}

.brand-card--center { text-align: center; }

.brand-card__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text-highlight-brand);
  margin-bottom: 0.5rem;
}

.brand-card__subtitle {
  font-size: 0.975rem;
  color: var(--color-text-secondary);
  margin-bottom: 1.75rem;
}

/* ---------------------------------------------------------------------------
   7. BADGE / PILL
   --------------------------------------------------------------------------- */
.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
}

.brand-badge--brand {
  background: var(--color-background-brand);
  color: var(--color-text-brand);
  border: 1px solid var(--color-accent-border);
}

.brand-badge--success {
  background: #e6f7f4;
  color: var(--color-success);
}

.brand-badge--danger {
  background: #fdecea;
  color: var(--color-danger);
}

/* ---------------------------------------------------------------------------
   8. AVATAR
   --------------------------------------------------------------------------- */
.brand-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-accent-surface);
  color: var(--color-accent-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
  user-select: none;
}

/* ---------------------------------------------------------------------------
   9. BUTTONS
   --------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.btn:active { transform: translateY(0); }

/* Primary — brand fill */
.btn-primary {
  background: var(--color-accent-surface);
  color: var(--color-accent-foreground);
  border-color: var(--color-accent-border);
}
.btn-primary:hover {
  background: var(--color-accent-surface-hover);
  color: var(--color-accent-foreground);
}

/* Outline — brand border */
.btn-outline {
  background: transparent;
  color: var(--color-text-brand);
  border-color: var(--color-accent-border);
}
.btn-outline:hover {
  background: var(--color-background-brand);
  color: var(--color-text-brand);
}

/* Danger */
.btn-danger {
  background: var(--color-danger);
  color: #fff;
  border-color: var(--color-danger);
}
.btn-danger:hover { background: #8e0019; color: #fff; }

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: var(--color-border);
}
.btn-ghost:hover {
  background: var(--color-surface);
  color: var(--color-text-primary);
}

/* Disabled state (applies to all) */
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

/* ---------------------------------------------------------------------------
   10. ACTIONS ROW
   --------------------------------------------------------------------------- */
.brand-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 1rem;
}

/* ---------------------------------------------------------------------------
   11. CODE / PRE BLOCK
   --------------------------------------------------------------------------- */
.brand-pre {
  margin-top: 1rem;
  text-align: left;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  max-height: 320px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--color-text-primary);
}

.brand-pre--empty {
  color: var(--color-text-secondary);
  font-style: italic;
  text-align: center;
  font-family: var(--font-sans);
}

/* ---------------------------------------------------------------------------
   12. SECTION DIVIDER
   --------------------------------------------------------------------------- */
.brand-divider {
  border: none;
  border-top: 1px solid var(--color-border-soft);
  margin: 1.5rem 0;
}

/* ---------------------------------------------------------------------------
   13. GRADIENT ACCENT BAR
   --------------------------------------------------------------------------- */
.brand-accent-bar {
  height: 4px;
  background: var(--gradient-brand);
  border-radius: var(--radius-full);
  margin-bottom: 1.5rem;
}

/* ---------------------------------------------------------------------------
   14. WIDE LAYOUT (for list/table pages)
   --------------------------------------------------------------------------- */
.brand-page--wide {
  align-items: flex-start;
  justify-content: center;
}

.brand-container--wide {
  width: 100%;
  max-width: 1100px;
}

.brand-page-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.brand-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-highlight-brand);
}

/* ---------------------------------------------------------------------------
   15. TABLE
   --------------------------------------------------------------------------- */
.brand-table-wrap {
  background: var(--color-background);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-border-soft);
  overflow: hidden;
}

.brand-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.brand-table thead {
  background: var(--color-axpo-blue);
  color: #fff;
}

.brand-table th {
  padding: 0.85rem 1.25rem;
  text-align: left;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-table td {
  padding: 0.85rem 1.25rem;
  color: var(--color-text-primary);
  border-bottom: 1px solid var(--color-border-soft);
}

.brand-table tbody tr:last-child td { border-bottom: none; }

.brand-table tbody tr:hover { background: var(--color-background-1); }

/* ---------------------------------------------------------------------------
   16. ALERTS
   --------------------------------------------------------------------------- */
.brand-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.5;
  border: 1px solid transparent;
}

.brand-alert--warning {
  background: #fff8e1;
  border-color: #ffe082;
  color: #7a5c00;
}

.brand-alert--danger {
  background: #fdecea;
  border-color: #f5c6cb;
  color: var(--color-danger);
}

/* ---------------------------------------------------------------------------
   17. EMPTY STATE
   --------------------------------------------------------------------------- */
.brand-empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--color-text-secondary);
  font-style: italic;
}
