/*
 * Collectathon — Design Tokens
 * ─────────────────────────────────────────────────────────────────────────────
 * Single source of truth for all visual primitives.
 * Derived from lib/core/theme/app_theme.dart (Flutter) and
 * lib/core/theme/app_responsive.dart.
 *
 * USAGE
 *   Add to any HTML page:  <link rel="stylesheet" href="/design-tokens.css">
 *   Then reference tokens: color: var(--color-navy);
 *
 * TYPOGRAPHY
 *   Primary font: Inter (loaded via Google Fonts).
 *   Fallback stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif
 *
 * ─────────────────────────────────────────────────────────────────────────────
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Color Palette ──────────────────────────────────────────────────────────
   Source: AppColors in app_theme.dart
   ──────────────────────────────────────────────────────────────────────────*/
:root {
  /* Brand primaries */
  --color-yellow:        #FFE000;   /* AppColors.turboYellow   */
  --color-navy:          #001F5B;   /* AppColors.navyBlue      */

  /* Italian flag accents */
  --color-green:         #008C45;   /* AppColors.italianGreen  */
  --color-red:           #CD212A;   /* AppColors.italianRed    */

  /* Neutrals */
  --color-white:         #FFFFFF;   /* AppColors.white         */
  --color-white-50:      rgba(255, 255, 255, 0.50); /* AppColors.white50 */
  --color-light-gray:    #F5F5F5;   /* AppColors.lightGray     */
  --color-medium-gray:   #9E9E9E;   /* AppColors.mediumGray    */
  --color-dark-gray:     #424242;   /* AppColors.darkGray      */

  /* Collection slot states */
  --color-amber:         #FFA000;   /* AppColors.amber (duplicate accent) */
  --color-slot-missing-fill:   #F1F1F1;             /* AppColors.slotMissingFillLight */
  --color-slot-missing-border: rgba(0, 31, 91, 0.20); /* AppColors.slotMissingBorderLight */

  /* Semantic aliases (matches HomePalette) */
  --color-brand-primary:   var(--color-yellow);
  --color-brand-secondary: var(--color-navy);
  --color-on-primary:      var(--color-navy);    /* text on yellow bg */
  --color-on-secondary:    var(--color-white);   /* text on navy bg  */
  --color-success:         var(--color-green);
  --color-danger:          var(--color-red);
  --color-surface:         var(--color-white);
  --color-surface-alt:     var(--color-light-gray);
  --color-muted-track:     #E8E8E8;

  /* UI surface shorthands */
  --color-ink:     var(--color-dark-gray);
  --color-muted:   var(--color-medium-gray);
  --color-border:  #E0E0E0;

  /* Gradient (AppGradients.progressYellowToGreen) */
  --gradient-progress: linear-gradient(to right, var(--color-yellow), var(--color-green));

  /* Navy deep variant used for gradient backgrounds */
  --color-navy-deep: #001040;
}


/* ── Typography ─────────────────────────────────────────────────────────────
   Source: textTheme in AppTheme.light (fontFamily: 'Inter')
   ──────────────────────────────────────────────────────────────────────────*/
:root {
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;

  /* Scale (mapped from Material TextTheme) */
  --text-display-lg:   40px;   /* displayLarge  — w700 navy */
  --text-display-md:   32px;   /* displayMedium — w700 navy */
  --text-display-sm:   28px;   /* displaySmall  — w700 navy */
  --text-headline-lg:  24px;   /* headlineLarge — w700 navy */
  --text-headline-md:  20px;   /* headlineMedium— w700 navy */
  --text-headline-sm:  18px;   /* headlineSmall — w700 navy */
  --text-title-lg:     17px;   /* titleLarge    — w600 navy */
  --text-title-md:     16px;   /* titleMedium   — w600 navy */
  --text-title-sm:     14px;   /* titleSmall    — w600 navy */
  --text-body-lg:      16px;   /* bodyLarge     — w400 dark-gray */
  --text-body-md:      15px;   /* bodyMedium    — w400 dark-gray */
  --text-body-sm:      13px;   /* bodySmall     — w400 medium-gray */
  --text-label-lg:     14px;   /* labelLarge    — w600 navy */
  --text-label-md:     12px;   /* labelMedium   — w400 medium-gray */
  --text-label-sm:     11px;   /* labelSmall    — w400 medium-gray */
}


/* ── Spacing ────────────────────────────────────────────────────────────────
   Source: AppSpacing in app_theme.dart
   ──────────────────────────────────────────────────────────────────────────*/
:root {
  --space-xxs:  4px;   /* AppSpacing.xxs */
  --space-xs:   8px;   /* AppSpacing.xs  */
  --space-sm:  12px;   /* AppSpacing.sm  */
  --space-md:  16px;   /* AppSpacing.md  */
  --space-lg:  24px;   /* AppSpacing.lg  */
  --space-xl:  32px;   /* AppSpacing.xl  */
}


/* ── Border Radius ──────────────────────────────────────────────────────────
   Source: AppRadius in app_theme.dart
   ──────────────────────────────────────────────────────────────────────────*/
:root {
  --radius-button:      14px;  /* AppRadius.button      */
  --radius-chip:        20px;  /* AppRadius.chip        */
  --radius-chat-bubble: 16px;  /* AppRadius.chatBubble  */
  --radius-card:        18px;  /* AppRadius.card        */
  --radius-input:       12px;  /* AppRadius.input       */
}


/* ── Shadows ────────────────────────────────────────────────────────────────
   Source: AppShadows in app_theme.dart
   ──────────────────────────────────────────────────────────────────────────*/
:root {
  /* AppShadows.soft — rgba(0,31,91,0.08) blurRadius 18 offset (0,8) */
  --shadow-soft: 0 8px 18px rgba(0, 31, 91, 0.08);
  /* Elevated variant for cards / modals */
  --shadow-card: 0 8px 32px rgba(0, 31, 91, 0.12);
  /* Yellow glow used on primary buttons */
  --shadow-yellow: 0 10px 22px rgba(255, 224, 0, 0.40);
}


/* ── Motion ─────────────────────────────────────────────────────────────────
   Source: AppMotion in app_theme.dart
   ──────────────────────────────────────────────────────────────────────────*/
:root {
  --duration-fast:   180ms;  /* AppMotion.fast   */
  --duration-normal: 280ms;  /* AppMotion.normal */
  --easing-standard: cubic-bezier(0.16, 1, 0.3, 1); /* spring-like */
}


/* ── Breakpoints ────────────────────────────────────────────────────────────
   Source: AppBreakpoints in app_responsive.dart
   ──────────────────────────────────────────────────────────────────────────
   compact  (mobile) :    0 – 599 px
   medium   (tablet) :  600 – 1023 px
   expanded (desktop): 1024 px +
   ──────────────────────────────────────────────────────────────────────────*/


/* ── Global Resets & Base Styles ────────────────────────────────────────────*/
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-body-md);
  color: var(--color-ink);
  background-color: var(--color-surface-alt);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}


/* ── Utility Classes ────────────────────────────────────────────────────────*/

/* Typography helpers */
.text-display    { font-size: var(--text-display-md); font-weight: 700; color: var(--color-navy); }
.text-headline   { font-size: var(--text-headline-md); font-weight: 700; color: var(--color-navy); }
.text-title      { font-size: var(--text-title-lg); font-weight: 600; color: var(--color-navy); }
.text-body       { font-size: var(--text-body-md); font-weight: 400; color: var(--color-dark-gray); }
.text-label      { font-size: var(--text-label-lg); font-weight: 600; color: var(--color-navy); }
.text-muted      { color: var(--color-muted); }
.text-navy       { color: var(--color-navy); }

/* Surface helpers */
.surface         { background: var(--color-surface); }
.surface-alt     { background: var(--color-surface-alt); }

/* Card */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-xl) var(--space-xl);
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  border: none;
  border-radius: var(--radius-button);
  padding: 15px var(--space-xl);
  font-family: var(--font-family);
  font-size: var(--text-body-lg);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--duration-fast) ease,
              box-shadow var(--duration-fast) ease,
              background var(--duration-fast) ease;
}

.btn:active {
  transform: scale(0.985);
}

.btn-primary {
  background: var(--color-yellow);
  color: var(--color-on-primary);
  box-shadow: var(--shadow-yellow);
}

.btn-primary:hover {
  filter: brightness(0.96);
}

.btn-secondary {
  background: var(--color-navy);
  color: var(--color-on-secondary);
}

/* Chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  border-radius: var(--radius-chip);
  padding: var(--space-xxs) var(--space-sm);
  font-size: var(--text-label-lg);
  font-weight: 600;
}

/* Input */
.input {
  border-radius: var(--radius-input);
  border: 1px solid var(--color-border);
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-family);
  font-size: var(--text-body-md);
  color: var(--color-ink);
  background: var(--color-surface);
  width: 100%;
}

.input:focus {
  outline: none;
  border-color: var(--color-navy);
}

/* Brand header block */
.brand-header {
  background: linear-gradient(160deg, var(--color-navy) 0%, var(--color-navy-deep) 100%);
  padding: var(--space-lg) var(--space-md);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-logo__img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-input);
  object-fit: contain;
}

.brand-logo__name {
  color: var(--color-white);
  font-weight: 700;
  font-size: var(--text-title-lg);
  letter-spacing: 0.2px;
}
