"""
Paletas Imperatriz pra Excalidraw.
Cada paleta tem 5 cores: dominante, secundaria, accent, neutro_escuro, neutro_claro.
"""

PALETAS = {
    "imperatriz": {
        "nome": "Imperatriz",
        "uso": "marca pessoal Tata, identidade premium feminina",
        "dourado": "#C9A961",
        "esmeralda": "#1F4E3D",
        "marfim": "#FAF8F3",
        "carvao": "#1A1A1A",
        "caramelo": "#8B5E3C",
        "background": "#FAF8F3",
        "dominante": "#1F4E3D",
        "accent": "#C9A961",
        "traco": "#1A1A1A",
        "neutro_medio": "#87837C",
        "destaque_quente": "#8B5E3C",
    },
    "mckinsey": {
        "nome": "Notebook McKinsey",
        "uso": "consultoria seria, frameworks executivos, B2B premium",
        "preto": "#000000",
        "amarelo": "#FFD700",
        "cinza_escuro": "#4A4A4A",
        "cinza_claro": "#B8B8B8",
        "offwhite": "#F5F5F0",
        "background": "#F5F5F0",
        "dominante": "#000000",
        "accent": "#FFD700",
        "traco": "#000000",
        "neutro_medio": "#4A4A4A",
        "destaque_quente": "#FFD700",
    },
    "dark_premium": {
        "nome": "Dark Premium",
        "uso": "apresentacao cinematografica, evento, hero visual",
        "fundo": "#0F0F0F",
        "neon_claro": "#E8E2D0",
        "dourado": "#D4AF37",
        "cinza": "#3A3A3A",
        "branco": "#FFFFFF",
        "background": "#0F0F0F",
        "dominante": "#E8E2D0",
        "accent": "#D4AF37",
        "traco": "#E8E2D0",
        "neutro_medio": "#3A3A3A",
        "destaque_quente": "#D4AF37",
    },
    "notion_minimal": {
        "nome": "Notion Minimal",
        "uso": "documentacao B2B clean, SaaS, produto",
        "offwhite": "#FBFAF7",
        "preto": "#191919",
        "azul": "#2F65D0",
        "cinza_claro": "#E8E6E0",
        "cinza_medio": "#87837C",
        "background": "#FBFAF7",
        "dominante": "#191919",
        "accent": "#2F65D0",
        "traco": "#191919",
        "neutro_medio": "#87837C",
        "destaque_quente": "#2F65D0",
    },
}


def get_paleta(nome="imperatriz"):
    """Retorna paleta por nome. Default: imperatriz."""
    return PALETAS.get(nome, PALETAS["imperatriz"])


def cor_sombra(hex_color, opacidade_pct=20):
    """Adiciona alpha em hex pra criar sombra/fundo suave."""
    alpha = format(int(255 * opacidade_pct / 100), "02x")
    return f"{hex_color}{alpha}"


# Fontes Excalidraw (codigo interno do app)
FONT_VIRGIL = 1       # handwritten — annotation humana
FONT_HELVETICA = 2    # formal — titulo, label
FONT_CASCADIA = 3     # mono — codigo, metrica
FONT_EXCALIFONT = 5   # padrao novo Excalidraw 2024

# Tamanhos premium por hierarquia
TAMANHOS = {
    "titulo_diagrama": 64,
    "subtitulo": 28,
    "label_bloco": 18,
    "annotation": 16,
    "metrica": 14,
}

# Roughness (sketchiness)
ROUGHNESS = {
    "architect": 0,   # mais reto, premium B2B
    "artist": 1,      # medio
    "cartoonist": 2,  # sketchy
}

# Espacamento canonico
GRID = 20
GAP_BLOCOS = 40
PADDING_INTERNO = 16
MARGEM_FRAME = 80
