/*
 * PGDD Modern White & Green Theme
 * Clean, modern design with Bootstrap integration
 * White background with green accents for a fresh, scientific look
 */

:root {
    /* Primary Green Color Palette */
    --primary-green: #10b981;
    --primary-green-dark: #059669;
    --primary-green-light: #34d399;
    --primary-green-ultra-light: #d1fae5;

    /* Secondary Colors */
    --secondary-green: #22c55e;
    --accent-green: #16a34a;
    --success-green: #15803d;

    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Text Colors */
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-muted: var(--gray-500);

    /* Background Colors */
    --bg-primary: var(--white);
    --bg-secondary: var(--gray-50);
    --bg-light: var(--gray-100);

    /* Border Colors */
    --border-light: var(--gray-200);
    --border-medium: var(--gray-300);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-green: 0 4px 14px 0 rgba(16, 185, 129, 0.15);

    /* Transitions */
    --transition-fast: all 0.15s ease;
    --transition-normal: all 0.3s ease;
    --transition-slow: all 0.5s ease;
}

* { box-sizing: border-box; }

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
}

/* ── Academic Typography ──────────────────────────────────────────────────── */
.academic-title {
    font-family: 'Source Serif Pro', serif;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    position: relative;
}

.academic-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.6;
}

.academic-heading {
    font-family: 'Source Serif Pro', serif;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 3px solid var(--primary-green);
    padding-bottom: 0.5rem;
    display: inline-block;
}

/* ── Hero Section ────────────────────────────────────────────────────────── */
.academic-hero {
    background: linear-gradient(135deg, var(--white) 0%, var(--gray-50) 100%);
    min-height: 85vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.academic-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="modern-grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(16,185,129,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23modern-grid)"/></svg>');
    opacity: 0.6;
}

.min-vh-75 { min-height: 75vh; }

.academic-badge {
    background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    box-shadow: var(--shadow-green);
    transition: var(--transition-normal);
}

.academic-badge:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.version-tag {
    background: var(--primary-green);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    margin-left: 1rem;
    font-weight: 600;
    vertical-align: middle;
    transition: var(--transition-fast);
}

.version-tag:hover { background: var(--primary-green-dark); }

.research-highlights { margin: 2rem 0; }

.highlight-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.highlight-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-green);
    background: var(--primary-green-ultra-light);
}

.highlight-item i {
    color: var(--primary-green);
    font-size: 1.25rem;
    margin-right: 0.75rem;
    width: 24px;
    text-align: center;
    transition: var(--transition-fast);
}

.highlight-item:hover i {
    color: var(--primary-green-dark);
    transform: scale(1.1);
}

.highlight-item span {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-academic-primary {
    background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
    border: none;
    color: white;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: 8px;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-green);
}

.btn-academic-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    color: white;
    background: linear-gradient(135deg, var(--primary-green-dark), var(--accent-green));
}

.btn-academic-outline {
    border: 2px solid var(--primary-green);
    color: var(--primary-green);
    background: var(--white);
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: 8px;
    transition: var(--transition-normal);
}

.btn-academic-outline:hover {
    color: white;
    background: var(--primary-green);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-green-dark);
}

/* ── Hero Visual / Metrics ───────────────────────────────────────────────── */
.hero-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.academic-logo-container {
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition-normal);
}

.academic-logo-container:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-green);
}

.academic-logo {
    height: 120px;
    width: auto;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.research-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
    max-width: 300px;
}

.metric-card {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--primary-green), var(--secondary-green));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.metric-card:hover::before { transform: scaleX(1); }

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-green);
    background: var(--primary-green-ultra-light);
}

.metric-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-green);
    display: block;
    line-height: 1;
    margin-bottom: 0.5rem;
    transition: var(--transition-fast);
}

.metric-card:hover .metric-number {
    color: var(--primary-green-dark);
    transform: scale(1.05);
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Section label inside hero ───────────────────────────────────────────── */
.hql-section-label {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    margin-bottom: .35rem;
}

/* ── Hero Tool Chips ─────────────────────────────────────────────────────── */
.hero-tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .35rem;
}

.htool-chip {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .35rem .65rem;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: .78rem;
    font-weight: 500;
    transition: border-color .15s, background .15s, color .15s;
    white-space: nowrap;
    overflow: hidden;
}

.htool-chip:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--text-primary);
}

.htool-ic {
    font-size: .85rem;
    flex-shrink: 0;
    width: 1rem;
    text-align: center;
}

/* Citation full text */
.hc-full-text {
    font-size: .8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: .3rem 0 .6rem;
}

/* ── Hero Quick Links ────────────────────────────────────────────────────── */
.hero-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.hql-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.75rem;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.hql-chip:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
    background: var(--primary-green-ultra-light);
}

.hql-chip i { font-size: 0.72rem; }

/* ── Hero Compact Citation ───────────────────────────────────────────────── */
.hero-citation {
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--primary-green);
    border-radius: 0 8px 8px 0;
    padding: 0.65rem 1rem;
    background: var(--gray-50);
}

.hc-top {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.hc-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary-green);
    white-space: nowrap;
}

.hc-short {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.hc-doi {
    color: var(--primary-green);
    text-decoration: none;
    font-size: 0.78rem;
}
.hc-doi:hover { text-decoration: underline; }

.hc-formats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.hc-formats-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-right: 0.1rem;
}

.hcf-btn {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: 4px;
    border: 1px solid var(--border-medium);
    background: var(--white);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.12s, color 0.12s, background 0.12s;
}

.hcf-btn:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
    background: var(--primary-green-ultra-light);
}

.hcf-btn-ok {
    border-color: var(--accent-green) !important;
    color: var(--accent-green) !important;
    background: var(--primary-green-ultra-light) !important;
}

/* ── Minimalist section labels ───────────────────────────────────────────── */
.category-title-minimal {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

/* ── Tool Cards (Rich) ───────────────────────────────────────────────────── */
/*
 * Each tool card has a compact icon header and a text body.
 * Hover lifts the card slightly; no flashy fill-animations.
 */
.tool-card-rich {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    overflow: hidden;
    height: 100%;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.tool-card-rich:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-green);
}

.tc-header {
    position: relative;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    overflow: hidden;
}

/* subtle diagonal highlight — replaces the animated shine */
.tc-shine {
    position: absolute;
    top: -40%;
    right: -20%;
    width: 60%;
    height: 160%;
    background: rgba(255,255,255,0.12);
    transform: skewX(-20deg);
    pointer-events: none;
}

.tc-icon {
    font-size: 1.4rem;
    color: #fff;
    position: relative;
    z-index: 1;
}

.tc-body {
    padding: 0.85rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tc-name {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    line-height: 1.2;
}

.tc-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.45;
    flex: 1;
    margin-bottom: 0.6rem;
}

.tc-launch {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* ── Citation (Minimal) ──────────────────────────────────────────────────── */
.citation-minimal {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 1.25rem;
}

.citation-content-minimal { font-size: 0.875rem; }

.authors-minimal {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.journal-info-minimal {
    color: var(--text-secondary);
    line-height: 1.55;
}

/* ── Recently Added Genomes ──────────────────────────────────────────────── */
.recent-genomes-scroll {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 340px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-medium) transparent;
}

.recent-genomes-scroll::-webkit-scrollbar {
    width: 4px;
}
.recent-genomes-scroll::-webkit-scrollbar-track { background: transparent; }
.recent-genomes-scroll::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 4px;
}

.recent-genome-row {
    display: grid;
    grid-template-columns: 1.5rem 1fr auto;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.5rem 0.4rem;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.12s;
}

.recent-genome-row:last-child { border-bottom: none; }

.recent-genome-row:hover { background: var(--bg-secondary); }

.recent-genome-num {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.recent-genome-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.recent-genome-species {
    font-size: 0.82rem;
    color: var(--text-primary);
    font-style: italic;
}

.recent-genome-row:hover .recent-genome-species { color: var(--primary-green); }

.recent-genome-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

.rg-common {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: normal;
}

.rg-badge {
    font-size: 0.65rem;
    padding: 0.05rem 0.45rem;
    border-radius: 20px;
    font-weight: 500;
    white-space: nowrap;
}

.rg-family {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.rg-order {
    background: var(--primary-green-ultra-light);
    color: var(--accent-green);
    border: 1px solid #a7f3d0;
}

.recent-genome-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ── Updates / Release Notes ─────────────────────────────────────────────── */
/*
 * Replaces the Bootstrap list-group with a cleaner academic-journal style.
 * Each entry shows date, title, and a short preview.
 */
.updates-list {
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
}

.update-item {
    display: grid;
    grid-template-columns: 6rem 1fr;
    grid-template-rows: auto auto;
    column-gap: 1rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-light);
    text-decoration: none;
    color: inherit;
    background: var(--white);
    transition: background 0.12s;
}

.update-item:last-child { border-bottom: none; }
.update-item:hover { background: var(--bg-secondary); }

.update-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    grid-row: 1;
    grid-column: 1;
    padding-top: 0.1rem;
}

.update-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    grid-row: 1;
    grid-column: 2;
    line-height: 1.35;
}

.update-item:hover .update-title { color: var(--primary-green); }

.update-preview {
    font-size: 0.78rem;
    color: var(--text-muted);
    grid-row: 2;
    grid-column: 2;
    line-height: 1.4;
    margin-top: 0.2rem;
}

/* section head row with "View all" link */
.updates-head-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.updates-head-row h6,
.updates-head-row .category-title-minimal {
    margin: 0;
}

.updates-view-all {
    font-size: 0.78rem;
    color: var(--primary-green);
    text-decoration: none;
}

.updates-view-all:hover { text-decoration: underline; }

/* ── Bootstrap Overrides ─────────────────────────────────────────────────── */
.btn-success                { background: var(--primary-green); border-color: var(--primary-green); }
.btn-success:hover          { background: var(--primary-green-dark); border-color: var(--primary-green-dark); }
.btn-outline-success        { color: var(--primary-green); border-color: var(--primary-green); }
.btn-outline-success:hover  { background: var(--primary-green); border-color: var(--primary-green); }
.btn-outline-primary        { color: var(--primary-green); border-color: var(--primary-green); }
.btn-outline-primary:hover  { background: var(--primary-green); border-color: var(--primary-green); color: #fff; }
.text-success               { color: var(--primary-green) !important; }
.bg-success                 { background-color: var(--primary-green) !important; }
.border-success             { border-color: var(--primary-green) !important; }

.btn-light {
    background: var(--white);
    color: var(--primary-green);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: var(--transition-normal);
}

.btn-light:hover {
    background: var(--primary-green-ultra-light);
    color: var(--primary-green-dark);
    border-color: var(--primary-green);
    transform: translateY(-1px);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 992px) {
    .academic-hero .row { flex-direction: column; text-align: center; }
    .hero-content { margin-bottom: 3rem; }
    .hero-visual { margin-top: 2rem; }
    .research-metrics { grid-template-columns: 1fr 1fr; margin: 0 auto; }
}

@media (max-width: 768px) {
    .academic-hero { padding: 4rem 0; text-align: center; }
    .academic-title { font-size: 2.5rem; }
    .academic-subtitle { font-size: 1rem; }
    .cta-buttons { display: flex; flex-direction: column; align-items: center; }
    .btn-academic-primary,
    .btn-academic-outline { width: 100%; max-width: 320px; margin-bottom: 1rem; }
    .btn-academic-primary { margin-right: 0 !important; }
    .research-highlights .col-md-4 { flex: 0 0 100%; max-width: 100%; }
    .research-metrics { grid-template-columns: 1fr; max-width: 200px; }

    .update-item { grid-template-columns: 1fr; }
    .update-date { grid-column: 1; }
    .update-title { grid-column: 1; grid-row: 2; }
    .update-preview { grid-column: 1; grid-row: 3; }
}

@media (max-width: 576px) {
    .academic-title { font-size: 2rem; }
    .academic-badge { padding: 0.5rem 1rem; font-size: 0.8rem; }
    .btn-academic-primary,
    .btn-academic-outline { padding: 0.75rem 1.5rem; font-size: 0.9rem; }
    .research-metrics { grid-template-columns: 1fr; }
}
