/* VIPER — Aithyra-branded Tailwind CSS theme
 *
 * Uses Tailwind CDN for utility classes + custom CSS variables
 * for Aithyra brand colors and typography.
 */

/* ------------------------------------------------------------------ */
/* Font faces                                                          */
/* ------------------------------------------------------------------ */

@font-face {
    font-family: 'Denim INK';
    src: url('/static/fonts/DenimINK-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Denim INK';
    src: url('/static/fonts/DenimINK-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'MD Thermochrome';
    src: url('/static/fonts/MDThermochrome-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ------------------------------------------------------------------ */
/* CSS custom properties (Aithyra brand tokens)                        */
/* ------------------------------------------------------------------ */

:root {
    --aithyra-teal: #0a6478;
    --aithyra-dark-green: #052323;
    --aithyra-grey: #c8c8c8;
    --aithyra-light-grey: #f6f6f6;
    --aithyra-dark-grey: #505050;
    --aithyra-black: #1e1e1e;

    --color-primary: var(--aithyra-teal);
    --color-primary-dark: var(--aithyra-dark-green);
    --color-surface: #ffffff;
    --color-surface-alt: var(--aithyra-light-grey);
    --color-text: var(--aithyra-black);
    --color-text-muted: var(--aithyra-dark-grey);
    --color-border: var(--aithyra-grey);

    --font-body: 'Denim INK', system-ui, sans-serif;
    --font-display: 'MD Thermochrome', 'Denim INK', system-ui, sans-serif;
}

/* ------------------------------------------------------------------ */
/* Base styles                                                         */
/* ------------------------------------------------------------------ */

html {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-surface);
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* H1 uses MD Thermochrome (per brand rule: only for large headers) */
h1 {
    font-family: var(--font-display);
    font-weight: 400;
}

/* H2–H6 and all other text use Denim INK */
h2, h3, h4, h5, h6, p, a, button, input, select, table, nav,
span, div, label, li, td, th, small, strong, em {
    font-family: var(--font-body);
}

/* ------------------------------------------------------------------ */
/* Aithyra-themed component overrides                                  */
/* ------------------------------------------------------------------ */

/* Teal accent for links and active items */
a { color: var(--aithyra-teal); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--aithyra-dark-green); }

/* Buttons */
.btn-primary {
    background-color: var(--aithyra-teal);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: background-color 0.15s;
}
.btn-primary:hover { background-color: var(--aithyra-dark-green); text-decoration: none; color: white; }

.btn-outline {
    border: 1px solid var(--aithyra-teal);
    color: var(--aithyra-teal);
    padding: 0.5rem 1.25rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.15s;
}
.btn-outline:hover { background-color: var(--aithyra-teal); color: white; text-decoration: none; }

/* Kingdom/Virus-type badges */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.025em;
}
.badge-arc-vir  { background: #774BE5; color: white; }
.badge-bact-vir { background: #EA5F94; color: white; }
.badge-euk-vir  { background: #FFB14E; color: var(--aithyra-black); }

.badge-tier-high   { background: #e8f5e9; color: #2e7d32; }
.badge-tier-medium { background: #fff8e1; color: #f57f17; }
.badge-tier-low    { background: #fce4ec; color: #c62828; }

/* Navigation */
.nav-link {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    color: var(--aithyra-dark-grey);
    transition: all 0.15s;
}
.nav-link:hover { color: var(--aithyra-teal); background: var(--aithyra-light-grey); text-decoration: none; }
.nav-link.active { color: var(--aithyra-teal); font-weight: 500; }

/* Search input */
.search-input {
    border: 1px solid var(--aithyra-grey);
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-family: var(--font-body);
    transition: border-color 0.15s;
}
.search-input:focus {
    outline: none;
    border-color: var(--aithyra-teal);
    box-shadow: 0 0 0 3px rgba(10, 100, 120, 0.15);
}

/* Table styling */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--aithyra-teal);
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--aithyra-dark-grey);
}
.data-table td {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--aithyra-light-grey);
    font-size: 0.875rem;
}
.data-table tbody tr:hover { background: var(--aithyra-light-grey); }

/* Pagination */
.pagination a, .pagination span {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    margin: 0 0.125rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}
.pagination a { color: var(--aithyra-teal); }
.pagination a:hover { background: var(--aithyra-light-grey); text-decoration: none; }
.pagination .current { background: var(--aithyra-teal); color: white; font-weight: 500; }

/* Page header gradient */
.page-header {
    background: linear-gradient(135deg, var(--aithyra-dark-green) 0%, var(--aithyra-teal) 100%);
    color: white;
    padding: 2.5rem 0;
    margin-bottom: 2rem;
}

/* Mol* viewer container */
.molstar-container {
    width: 100%;
    height: 500px;
    border: 1px solid var(--aithyra-grey);
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
    background: #1a1a2e;
}

/* Stat cards on home page */
.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--aithyra-grey);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
}
.stat-card .stat-number {
    font-family: var(--font-display);
    font-size: 2.25rem;
    color: var(--aithyra-teal);
    line-height: 1.2;
}
.stat-card .stat-label {
    font-size: 0.875rem;
    color: var(--aithyra-dark-grey);
    margin-top: 0.25rem;
}

/* Lineage breadcrumbs */
.lineage { display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; font-size: 0.8rem; }
.lineage span { color: var(--aithyra-dark-grey); }
.lineage a { color: var(--aithyra-teal); }

/* Domain rows */
.domain-row { padding: 0.25rem 0; border-bottom: 1px solid var(--aithyra-light-grey); }
.domain-row:last-child { border-bottom: none; }

/* Domain palette swatch (small colored square next to domain label) */
.domain-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    vertical-align: middle;
    transition: opacity 0.15s;
}

/* Domain checkbox (small, inline) */
.domain-checkbox {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    cursor: pointer;
    accent-color: var(--aithyra-teal);
}

/* Isolate button (small action button on domain rows) */
.isolate-btn {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border: 1px solid var(--aithyra-teal);
    border-radius: 0.25rem;
    color: var(--aithyra-teal);
    background: transparent;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-body);
}
.isolate-btn:hover {
    background: var(--aithyra-teal);
    color: white;
}

/* Coloring mode toggle buttons */
.color-mode-btn {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--aithyra-grey);
    border-radius: 0.375rem;
    background: transparent;
    color: var(--aithyra-dark-grey);
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-body);
}
.color-mode-btn:hover {
    border-color: var(--aithyra-teal);
    color: var(--aithyra-teal);
}
.color-mode-btn.active {
    background: var(--aithyra-teal);
    color: white;
    border-color: var(--aithyra-teal);
}

/* Restore pill (shown when a domain is isolated) */
.restore-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 0.375rem;
    background: var(--aithyra-teal);
    color: white;
    font-size: 0.75rem;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background 0.15s;
}
.restore-pill:hover {
    background: var(--aithyra-dark-green);
}

/* Custom hover tooltip (replaces verbose Molstar default) */
.viper-tooltip {
    display: none;
    position: fixed;
    z-index: 9999;
    padding: 0.3rem 0.6rem;
    border-radius: 0.25rem;
    background: rgba(30, 30, 30, 0.9);
    color: #f0f0f0;
    font-size: 0.75rem;
    font-family: var(--font-body);
    pointer-events: none;
    white-space: nowrap;
}

/* Hide Molstar's verbose default tooltip */
.msp-tooltip {
    display: none !important;
}

/* Search suggestion dropdown */
.suggest-dropdown { max-height: 320px; overflow-y: auto; }
.suggest-dropdown a { text-decoration: none; }
.suggest-dropdown a:hover { background-color: var(--aithyra-light-grey); }

/* AI answer area — markdown-rendered */
#ask-answer a { color: var(--aithyra-teal); text-decoration: underline; }
#ask-answer a:hover { color: var(--aithyra-dark-green); }
#ask-answer ul { list-style: disc; padding-left: 1.25rem; margin: 0.5rem 0; }
#ask-answer ol { list-style: decimal; padding-left: 1.25rem; margin: 0.5rem 0; }
#ask-answer p { margin: 0.4rem 0; }
#ask-answer strong { font-weight: 600; }
#ask-answer code { background: var(--aithyra-light-grey); padding: 0.1rem 0.3rem; border-radius: 0.2rem; font-size: 0.85em; }
