/* app.css - HFlows custom styles (Pico CSS extensions) */

:root {
    /* Brand / Primary (Azure) */
    --hf-primary:        #0284C7;
    --hf-primary-hover:  #0EA5E9;
    --hf-primary-active: #0369A1;
    --hf-primary-bg:     #E0F2FE;
    --hf-primary-subtle: #F0F9FF;

    /* CTA / Accent (Warm Coral) */
    --hf-accent:         #E97451;
    --hf-accent-hover:   #F08B6E;

    /* Sidebar */
    --hf-sidebar-bg:     #0C2D48;
    --hf-sidebar-text:   #BAE6FD;
    --hf-sidebar-hover:  rgba(255,255,255,0.08);
    --hf-sidebar-active: rgba(255,255,255,0.12);
    --hf-sidebar-border: rgba(255,255,255,0.08);

    /* Surfaces */
    --hf-bg:             #F8FAFC;
    --hf-card-bg:        #FFFFFF;
    --hf-border:         #E2E8F0;

    /* Semantic */
    --hf-success-bg:     #D1FAE5;
    --hf-success-text:   #065F46;
    --hf-danger:         #DC2626;
    --hf-danger-hover:   #B91C1C;
    --hf-danger-bg:      #FEE2E2;
    --hf-danger-text:    #991B1B;
    --hf-danger-border:  #FECACA;

    /* Code blocks */
    --hf-code-bg:        #0F172A;
    --hf-code-text:      #E2E8F0;

    /* Keep Pico spacing overrides */
    --pico-font-size: 100%;
    --pico-line-height: 1.5;
    --pico-block-spacing-vertical: 0.75rem;
    --pico-block-spacing-horizontal: 0.75rem;
    --pico-typography-spacing-vertical: 0.75rem;
    --pico-form-element-spacing-vertical: 0.5rem;
    --pico-form-element-spacing-horizontal: 0.75rem;
    --pico-nav-element-spacing-vertical: 0.5rem;
    --pico-nav-element-spacing-horizontal: 0.5rem;
}

/* Pico CSS overrides — must match Pico's compound selector for specificity */
:root:not([data-theme=dark]),
[data-theme=light] {
    --pico-primary:              #0284C7;
    --pico-primary-background:   #0284C7;
    --pico-primary-border:       #0284C7;
    --pico-primary-underline:    rgba(2,132,199,0.5);
    --pico-primary-hover:        #0369A1;
    --pico-primary-hover-background: #0369A1;
    --pico-primary-hover-border: #0369A1;
    --pico-primary-hover-underline: rgba(2,132,199,0.7);
    --pico-primary-focus:        rgba(2,132,199,0.25);
    --pico-primary-inverse:      #FFFFFF;
}

@media only screen and (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --pico-primary:              #38BDF8;
        --pico-primary-background:   #0284C7;
        --pico-primary-border:       #0284C7;
        --pico-primary-underline:    rgba(56,189,248,0.5);
        --pico-primary-hover:        #7DD3FC;
        --pico-primary-hover-background: #0369A1;
        --pico-primary-hover-border: #0369A1;
        --pico-primary-hover-underline: rgba(56,189,248,0.7);
        --pico-primary-focus:        rgba(56,189,248,0.375);
        --pico-primary-inverse:      #FFFFFF;
    }
}

[data-theme=dark] {
    --pico-primary:              #38BDF8;
    --pico-primary-background:   #0284C7;
    --pico-primary-border:       #0284C7;
    --pico-primary-underline:    rgba(56,189,248,0.5);
    --pico-primary-hover:        #7DD3FC;
    --pico-primary-hover-background: #0369A1;
    --pico-primary-hover-border: #0369A1;
    --pico-primary-hover-underline: rgba(56,189,248,0.7);
    --pico-primary-focus:        rgba(56,189,248,0.375);
    --pico-primary-inverse:      #FFFFFF;
}

html {
    font-size: 16px;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }
h5 { font-size: 0.875rem; }
h6 { font-size: 0.75rem; }

/* Header styling */
header.container {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--pico-muted-border-color);
}

header.container nav ul {
    align-items: center;
}

/* Header Sign Up pill */
.nav-cta {
    background-color: var(--hf-primary);
    color: #fff;
    padding: 0.35rem 0.9rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.nav-cta:hover {
    background-color: var(--hf-primary-hover);
    color: #fff;
}

/* Footer styling */
footer.container {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
    margin-top: 2rem;
    border-top: 1px solid var(--pico-muted-border-color);
    text-align: center;
}

/* Main content spacing */
main.container {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

/* HTMX loading indicator */
.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}

.htmx-request .htmx-indicator {
    opacity: 1;
}

.htmx-request.htmx-indicator {
    opacity: 1;
}

/* ---- Layout Utilities ---- */

.text-center { text-align: center; }
.text-muted  { color: var(--pico-muted-color); }
.text-capitalize { text-transform: capitalize; }
.text-sm { font-size: 0.85em; }
.font-mono { font-family: monospace; }
.overflow-x { overflow-x: auto; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 1.5rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 1.5rem; }

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-start {
    display: flex;
    align-items: center;
}

.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }

/* ---- Hero ---- */

.hero {
    text-align: center;
    padding: 4rem 0 2rem;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* ---- CTA Button (Orange Accent) ---- */

.btn-cta {
    background-color: var(--hf-accent);
    border-color: var(--hf-accent);
    color: #fff;
}

.btn-cta:hover {
    background-color: var(--hf-accent-hover);
    border-color: var(--hf-accent-hover);
    color: #fff;
}

/* ---- Small Button ---- */

.btn-sm {
    font-size: 0.85em;
    padding: 0.25rem 0.75rem;
}

/* ---- Pricing ---- */

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 700px;
    margin: 0 auto;
}

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

.pricing-card.featured {
    border: 2px solid var(--hf-primary);
}

.pricing-price {
    font-size: 2rem;
    font-weight: bold;
    margin: 1rem 0;
}

.pricing-features {
    list-style: none;
    padding: 0;
    text-align: left;
}

.pricing-features li {
    padding: 0.25rem 0 0.25rem 1.5rem;
    position: relative;
}

.pricing-features li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--hf-primary);
    font-weight: bold;
}

.pricing-amount {
    font-size: 1.5rem;
    margin: 0.5rem 0 1rem;
}

/* ---- Section Heading ---- */

.section-heading {
    text-align: center;
    margin-bottom: 1.5rem;
}

/* ---- Danger Zone ---- */

.danger-zone {
    border-color: var(--hf-danger);
}

.danger-zone h3 {
    color: var(--hf-danger);
}

.btn-danger-outline {
    border-color: var(--hf-danger);
    color: var(--hf-danger);
}

.btn-danger-outline:hover {
    background-color: var(--hf-danger);
    border-color: var(--hf-danger);
    color: #fff;
}

/* ---- Alert ---- */

.alert-danger {
    background-color: var(--hf-danger-bg);
    color: var(--hf-danger);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 1px solid var(--hf-danger-border);
    border-left: 4px solid var(--hf-danger);
}

/* ---- Admin Stats ---- */

.stat-value {
    font-size: 2rem;
    margin: 0;
}

/* ---- Spam/Ham Buttons ---- */

.btn-flag {
    font-size: 0.85em;
    border-color: var(--pico-del-color);
    color: var(--pico-del-color);
}

.btn-ham {
    font-size: 0.85em;
    border-color: var(--pico-ins-color);
    color: var(--pico-ins-color);
}

/* ---- File Status ---- */

.file-status-ready {
    color: var(--pico-ins-color);
    font-weight: bold;
    font-size: 0.85em;
}

.file-status-error {
    color: var(--pico-del-color);
    font-weight: bold;
    font-size: 0.85em;
}

.file-status-pending {
    color: var(--pico-mark-background-color);
    font-weight: bold;
    font-size: 0.85em;
}

/* ---- Login Page ---- */

.login-container {
    max-width: 400px;
    margin: 2rem auto;
    padding: 1.5rem;
    border-top: 3px solid var(--hf-primary);
}

.login-container header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.login-container header h1 {
    margin-bottom: 0.5rem;
}

.login-container header p {
    color: var(--pico-muted-color);
    margin: 0;
}

.login-error {
    background-color: var(--hf-danger-bg);
    color: var(--hf-danger);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 1px solid var(--hf-danger-border);
}

.login-container footer {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--pico-muted-border-color);
}

/* ---- CSP-safe utility classes ---- */

.narrow-form { max-width: 480px; margin: 0 auto; }
.pt-30 { padding-top: 30px; }
.mt-10 { margin-top: 10px; }
.mb-1em { margin-bottom: 1em; }
.mb-2em { margin-bottom: 2em; }
.mt-2em { margin-top: 2em; }
.w-auto { width: auto; }
.w-6rem { width: 6rem; }
.ml-sm { margin-left: 0.5rem; }
.d-inline { display: inline; }
.d-none { display: none; }
.text-success { color: var(--pico-ins-color); }

/* Link styled as text button (verify-email logout) */
.link-button {
    display: inline;
    padding: 0;
    border: 0;
    background: none;
    font-size: inherit;
    cursor: pointer;
    text-decoration: underline;
}
