/* =====================================================================
   PromptShop AI — app.css
   Tokens de design, reset básico, layout do shell e sidebar.
   ===================================================================== */

:root {
    /* Cor — base azul-marinho bem escuro, acento roxo/azul vibrante
       (tecnologia/IA) + dourado reservado como assinatura da marca. */
    --ink: #0a0a14;
    --surface: #131320;
    --surface-raised: #1b1b2d;
    --border: #26263c;
    --border-strong: #35355a;
    --text: #f3f2f8;
    --text-muted: #9795b3;

    --primary: #7c5cff;
    --primary-2: #b855f7;
    --primary-bright: #9b7dff;
    --primary-ink: #ffffff;
    --primary-glow: rgba(124, 92, 255, .38);
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);

    --gold: #c9a24b;
    --gold-bright: #e4c173;
    --gold-ink: #201a0d;

    /* Tipografia */
    --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
    --font-body: 'Manrope', 'Segoe UI', sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

    /* Layout */
    --sidebar-width: 248px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    background: var(--ink);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: var(--font-display);
    margin: 0;
    color: var(--text);
}

p {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

button {
    font-family: inherit;
}

:focus-visible {
    outline: 2px solid var(--primary-bright);
    outline-offset: 2px;
}

/* ---------------------------------------------------------------------
   Shell — inclui um brilho ambiente fixo no fundo, para dar profundidade
   sem depender de imagens externas.
   --------------------------------------------------------------------- */

.shell {
    position: relative;
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
    z-index: 1;
}

body::before {
    content: '';
    position: fixed;
    top: -20%;
    right: -10%;
    width: 640px;
    height: 640px;
    background: radial-gradient(circle, rgba(124, 92, 255, .16) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -25%;
    left: 10%;
    width: 560px;
    height: 560px;
    background: radial-gradient(circle, rgba(184, 85, 247, .10) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ---------------------------------------------------------------------
   Sidebar
   --------------------------------------------------------------------- */

.sidebar {
    background: rgba(19, 19, 32, .78);
    backdrop-filter: blur(16px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 1;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 28px;
}

.sidebar__brand-mark {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: var(--gradient-primary);
    color: var(--primary-ink);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 16px -4px var(--primary-glow);
}

.sidebar__brand-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 16px;
    letter-spacing: -0.01em;
}

.sidebar__brand-name em {
    font-style: normal;
    color: var(--gold-bright);
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    position: relative;
    transition: background-color .18s ease, color .18s ease;
}

.sidebar__link:hover {
    background: var(--surface-raised);
    color: var(--text);
}

.sidebar__link-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: currentColor;
    opacity: .75;
    transition: opacity .18s ease;
}

.sidebar__link:hover .sidebar__link-icon,
.sidebar__link.is-active .sidebar__link-icon {
    opacity: 1;
}

.sidebar__link-indicator {
    display: none;
}

.sidebar__link.is-active {
    background: linear-gradient(90deg, var(--primary-glow) 0%, transparent 100%);
    color: var(--text);
}

.sidebar__link.is-active::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: var(--gradient-primary);
}

.sidebar__footer {
    border-top: 1px solid var(--border);
    padding: 16px 12px 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar__footer-label {
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar__footer-value {
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--gold-bright);
    font-weight: 600;
}

/* ---------------------------------------------------------------------
   Content area
   --------------------------------------------------------------------- */

.content {
    padding: 32px 40px 48px;
    max-width: 1180px;
}

.view__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
}

.view__title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.view__subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

/* ---------------------------------------------------------------------
   Transição de entrada das views
   Como cada troca de módulo substitui o innerHTML de #app-content por
   um HTML novo, o elemento .view é sempre um nó recém-inserido no DOM —
   a animação dispara sozinha em toda navegação, sem precisar de JS.
   --------------------------------------------------------------------- */

@keyframes ps-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.view {
    animation: ps-fade-in .32s cubic-bezier(.16, 1, .3, 1);
}

@media (prefers-reduced-motion: reduce) {
    .view {
        animation: none;
    }
}
