/* ============================================================
   ArcherCloud – Global Design Tokens
   See: docs/design/design-rules.md & docs/design/colors.md

   RULE: Every color on the site must reference a token.
   No hardcoded hex values outside this file.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* ── Brand (constant across themes) ── */
    --grape-soda: #924E8C;
    --charcoal: #373A36;
    --alabaster: #E4E3E0;

    /* ── Icon / Status Palette (constant across themes) ── */
    --indigo: #5E6AD2;
    --horizon: #4EA7FC;
    --aqua: #00C3F0;
    --jungle: #26A644;
    --saffron: #F0BF00;
    --tangerine: #FF7235;
    --lobster: #EB5757;
    --royal: #475BA1;
    --rosé: #A84376;
    --amethyst: #7D57C1;

    /* ── Border-radius scale ── */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* ── Timing ── */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
    --duration-fast: 0.12s;
    --duration-normal: 0.2s;
    --duration-slow: 0.35s;

    /* ── Accent tints (Grape Soda #924E8C at various opacities) ──
       Constant across themes because the accent itself is constant.
       Use these instead of hand-rolling rgba(146, 78, 140, X). */
    --pg-accent-tint-whisper:      rgba(146, 78, 140, 0.04);
    --pg-accent-tint-subtle:       rgba(146, 78, 140, 0.05);
    --pg-accent-tint-soft:         rgba(146, 78, 140, 0.06);
    --pg-accent-tint-medium:       rgba(146, 78, 140, 0.08);
    --pg-accent-focus-ring:        rgba(146, 78, 140, 0.12);
    --pg-accent-focus-ring-strong: rgba(146, 78, 140, 0.25);
    --pg-accent-border:            rgba(146, 78, 140, 0.18);

    /* ── Danger (destructive UI) ──
       #e74c3c drifts from the design system's Lobster Pink
       (--lobster, #EB5757); preserved for now to avoid a visual shift. */
    --pg-danger:    #e74c3c;
    --pg-danger-bg: rgba(231, 76, 60, 0.08);
}

/* ── Default theme: Noon (light, Grape Soda accent) ── */
:root,
[data-theme="Noon"] {
    --pg-bg: #FFFFFF;
    --pg-text: #44494D;
    --pg-surface: #EDEEF3;
    --pg-surface-raised: #E3E4EA;
    --pg-surface-overlay: #D9DAE2;
    --pg-accent: #924E8C;
    --pg-accent-text: #FFFFFF;
    --pg-border: rgba(68,73,77,0.10);
    --pg-border-hover: rgba(68,73,77,0.20);
    --pg-text-secondary: rgba(68,73,77,0.6);
    --pg-text-tertiary: rgba(68,73,77,0.38);
    --pg-shimmer-base: rgba(68,73,77,0.06);
    --pg-shimmer-highlight: rgba(68,73,77,0.12);
    --pg-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --pg-shadow-hover: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
}

/* ── Theme: Midnight ── */
[data-theme="Midnight"] {
    --pg-bg: #0F0F10;
    --pg-text: #EEEFF1;
    --pg-surface: #151516;
    --pg-surface-raised: #1C1C1E;
    --pg-surface-overlay: #222224;
    --pg-accent: #924E8C;
    --pg-accent-text: #FFFFFF;
    --pg-border: rgba(238,239,241,0.07);
    --pg-border-hover: rgba(238,239,241,0.14);
    --pg-text-secondary: rgba(238,239,241,0.5);
    --pg-text-tertiary: rgba(238,239,241,0.28);
    --pg-shimmer-base: rgba(238,239,241,0.04);
    --pg-shimmer-highlight: rgba(238,239,241,0.09);
    --pg-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --pg-shadow-hover: 0 4px 16px rgba(0,0,0,0.4), 0 2px 6px rgba(0,0,0,0.2);
}

/* ── Theme: Dawn ── */
[data-theme="Dawn"] {
    --pg-bg: #2A222E;
    --pg-text: #EEEFF1;
    --pg-surface: #382A3C;
    --pg-surface-raised: #423246;
    --pg-surface-overlay: #4A3A4E;
    --pg-accent: #924E8C;
    --pg-accent-text: #FFFFFF;
    --pg-border: rgba(238,239,241,0.07);
    --pg-border-hover: rgba(238,239,241,0.14);
    --pg-text-secondary: rgba(238,239,241,0.5);
    --pg-text-tertiary: rgba(238,239,241,0.28);
    --pg-shimmer-base: rgba(238,239,241,0.04);
    --pg-shimmer-highlight: rgba(238,239,241,0.09);
    --pg-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --pg-shadow-hover: 0 4px 16px rgba(0,0,0,0.4), 0 2px 6px rgba(0,0,0,0.2);
}

/* ── Theme: Dusk ── */
[data-theme="Dusk"] {
    --pg-bg: #292D3E;
    --pg-text: #EEEFF1;
    --pg-surface: #313548;
    --pg-surface-raised: #393D52;
    --pg-surface-overlay: #41455C;
    --pg-accent: #924E8C;
    --pg-accent-text: #FFFFFF;
    --pg-border: rgba(238,239,241,0.07);
    --pg-border-hover: rgba(238,239,241,0.14);
    --pg-text-secondary: rgba(238,239,241,0.5);
    --pg-text-tertiary: rgba(238,239,241,0.28);
    --pg-shimmer-base: rgba(238,239,241,0.04);
    --pg-shimmer-highlight: rgba(238,239,241,0.09);
    --pg-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --pg-shadow-hover: 0 4px 16px rgba(0,0,0,0.4), 0 2px 6px rgba(0,0,0,0.2);
}


/* ================================================================
   GLOBAL ANIMATIONS
   ================================================================ */

@keyframes pg-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

@keyframes pg-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pg-slide-in {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes pg-dialog-in {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes pg-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

@keyframes pg-spin {
    to { transform: rotate(360deg); }
}

@keyframes pg-progress-slide {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}


/* ================================================================
   GLOBAL BASE STYLES
   ================================================================ */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--pg-bg);
    color: var(--pg-text);
    transition: background var(--duration-slow) var(--ease-out),
                color var(--duration-slow) var(--ease-out);
}


/* ================================================================
   SKELETON LOADER (global)
   ================================================================ */

.pg-skeleton {
    background: linear-gradient(
        90deg,
        var(--pg-shimmer-base) 0%,
        var(--pg-shimmer-highlight) 40%,
        var(--pg-shimmer-base) 80%
    );
    background-size: 800px 100%;
    animation: pg-shimmer 1.8s var(--ease-in-out) infinite;
    border-radius: var(--radius-md);
}

.pg-skeleton-text {
    height: 14px;
    margin-bottom: 10px;
    border-radius: var(--radius-sm);
}

.pg-skeleton-text.short { width: 60%; }
.pg-skeleton-text.medium { width: 80%; }
.pg-skeleton-text.full { width: 100%; }

.pg-skeleton-circle {
    border-radius: 50%;
    flex-shrink: 0;
}

.pg-skeleton-btn {
    height: 36px;
    width: 120px;
    border-radius: var(--radius-md);
}
