/* =============================================
   OmicsHub — Premium Design System v2
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Custom Properties ───────────────── */
:root {
    --blue-50:  #EFF6FF;
    --blue-100: #DBEAFE;
    --blue-600: #2563EB;
    --blue-700: #1D4ED8;
    --blue-800: #1E40AF;
    --gray-50:  #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-blue: 0 4px 14px rgba(37,99,235,0.3);
}

/* ── Base Reset ──────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-900);
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Header ──────────────────────────────── */
header {
    border-bottom: 1px solid var(--gray-200);
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ── Nav active link ─────────────────────── */
.nav-active {
    color: var(--blue-600) !important;
    font-weight: 700;
    border-bottom: 2px solid var(--blue-600);
    padding-bottom: 2px;
}

/* ── Hero Section (Home) ─────────────────── */
.hero-section {
    background: linear-gradient(to right, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.85) 30%, rgba(255, 255, 255, 0.85) 70%, rgba(255, 255, 255, 0.1) 100%), url('images/hero-bg.png') center/cover no-repeat;
    padding: 160px 0 170px;
    min-height: 500px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-section h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: #111827; /* Dark Gray / Near Black */
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 1.1rem;
    position: relative;
}

.hero-section p {
    font-size: 1.15rem;
    color: #374151; /* Gray 700 */
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
    position: relative;
}

.hero-btn {
    display: inline-block;
    background: var(--blue-600);
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.85rem 2.2rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 16px rgba(37,99,235,0.45);
    position: relative;
}

.hero-btn:hover {
    background: var(--blue-700);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37,99,235,0.5);
}

/* ── Hero Section (Sub-pages: About, Contact) */
.page-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #1d4ed8 100%);
    padding: 56px 0 64px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.page-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 0.85rem;
    position: relative;
}

.page-hero p {
    font-size: 1.05rem;
    color: #BAC8FF;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
    position: relative;
}

/* ── Category Badges ─────────────────────── */
.badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 99px;
    margin-bottom: 8px;
}

.badge-hpc   { background: #EDE9FE; color: #6D28D9; }
.badge-shell { background: #DCFCE7; color: #15803D; }
.badge-conda { background: #FEF9C3; color: #A16207; }
.badge-scrna { background: #FFE4E6; color: #BE123C; }
.badge-bio   { background: #DBEAFE; color: #1D4ED8; }

/* ── Tutorial Cards (home page list) ─────── */
.tutorial-card {
    background: #ffffff;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.6rem;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.tutorial-card:hover {
    border-color: #93C5FD;
    box-shadow: 0 8px 32px rgba(37,99,235,0.1);
    transform: translateY(-3px);
}

.tutorial-card h3 {
    font-size: 1.07rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.45;
    margin-bottom: 0.5rem;
    flex-grow: 1;
}

.tutorial-card .meta {
    font-size: 0.8rem;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tutorial-card .excerpt {
    font-size: 0.9rem;
    color: var(--gray-500);
    line-height: 1.7;
    margin-bottom: 1.2rem;
    margin-top: 0.5rem;
}

.tutorial-card .read-more {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--blue-600);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.15s;
    margin-top: auto;
}

.tutorial-card .read-more:hover { gap: 8px; }

/* ── Category Filter Buttons ─────────────── */
.category-btn {
    font-size: 0.82rem;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: 99px;
    border: 1.5px solid var(--gray-200);
    background: #ffffff;
    color: var(--gray-700);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.category-btn:hover {
    border-color: #93C5FD;
    color: var(--blue-700);
}

.category-btn.active,
.category-btn[style*="background: rgb(37"] {
    background: var(--blue-600) !important;
    border-color: var(--blue-600) !important;
    color: #ffffff !important;
}

/* ── Sidebar ─────────────────────────────── */
.sidebar-card {
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.sidebar-link {
    display: block;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
}

.sidebar-link:hover { background: var(--blue-50); color: var(--blue-600); }

/* ── Search Input ────────────────────────── */
#search-input {
    border-radius: var(--radius-md);
    border: 1.5px solid var(--gray-200);
    font-size: 0.95rem;
    font-family: inherit;
    padding: 0.75rem 1rem 0.75rem 3rem;
    width: 100%;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: var(--gray-50);
    color: var(--gray-900);
}

#search-input:focus {
    outline: none;
    border-color: var(--blue-600);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

/* ── Tutorial Detail Content ─────────────── */
.tutorial-content {
    max-width: 760px;
    margin: 0 auto;
}

.tutorial-content h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.tutorial-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 2.5rem 0 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray-100);
}

.tutorial-content h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 1.75rem 0 0.6rem;
}

.tutorial-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-700);
    margin: 1.25rem 0 0.4rem;
}

.tutorial-content p {
    line-height: 1.85;
    color: var(--gray-700);
    margin-bottom: 1.1rem;
}

.tutorial-content ul,
.tutorial-content ol {
    padding-left: 1.6rem;
    margin: 0.8rem 0 1.2rem;
}

.tutorial-content li {
    line-height: 1.8;
    color: var(--gray-700);
    margin-bottom: 0.45rem;
}

.tutorial-content strong {
    color: var(--gray-900);
    font-weight: 600;
}

.tutorial-content blockquote {
    border-left: 4px solid var(--blue-600);
    background: var(--blue-50);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--blue-800);
    font-style: normal;
}

.tutorial-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.tutorial-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.tutorial-content th {
    background: var(--gray-100);
    font-weight: 600;
    color: var(--gray-900);
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--gray-200);
}

.tutorial-content td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.tutorial-content tr:last-child td { border-bottom: none; }

/* ── Code Blocks ─────────────────────────── */
pre {
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
    overflow-x: auto;
    background: #0f172a !important;
    border: 1px solid #1e293b;
    padding: 1.25rem 1.5rem !important;
}

pre code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.855rem;
    line-height: 1.7;
    color: #e2e8f0 !important; /* ensure visible text on dark bg */
    background: transparent !important;
}

/* Inline code */
:not(pre) > code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: #F1F5F9;
    color: #0F4C81;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 0.84em;
    font-weight: 500;
}

/* ── About / Contact Content Sections ──── */
.content-section {
    max-width: 860px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.content-card {
    background: #ffffff;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 2rem 2.25rem;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.2s;
}

.content-card:hover {
    box-shadow: var(--shadow-md);
}

.content-card h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.content-card h2 .icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.content-card p {
    color: var(--gray-600);
    line-height: 1.8;
    font-size: 0.97rem;
}

.content-card ul {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

.content-card li {
    color: var(--gray-600);
    line-height: 1.8;
    margin-bottom: 0.3rem;
    font-size: 0.97rem;
}

/* ── Contact Cards ───────────────────────── */
.contact-card {
    background: #ffffff;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.75rem 2rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.contact-card:hover {
    border-color: #93C5FD;
    box-shadow: 0 4px 20px rgba(37,99,235,0.08);
}

.contact-card .contact-icon {
    width: 44px;
    height: 44px;
    background: var(--blue-50);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.contact-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.4rem;
}

.contact-card p {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-bottom: 0.75rem;
}

.contact-card a {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--blue-600);
    text-decoration: none;
}

.contact-card a:hover { text-decoration: underline; }

/* ── Page Transition ─────────────────────── */
.page-content {
    animation: fadeUp 0.3s ease-out;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Back to Top ─────────────────────────── */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--blue-600);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(37,99,235,0.35);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s, transform 0.2s, background 0.2s;
    border: none;
}

.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover   { background: var(--blue-700); transform: translateY(-2px); }

/* ── Section Titles ──────────────────────── */
.section-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.02em;
    margin-bottom: 0.3rem;
}

.section-subtitle {
    font-size: 0.95rem;
    color: var(--gray-500);
    margin-bottom: 2rem;
}

/* ── Loading Spinner ─────────────────────── */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--blue-600);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ──────────────────────────── */
@media (max-width: 768px) {
    .hero-section { padding: 52px 0 60px; }
    .page-hero    { padding: 40px 0 48px; }
    .tutorial-content h1 { font-size: 1.7rem; }
    .tutorial-content h2 { font-size: 1.25rem; }
    pre code { font-size: 0.78rem; }
    .content-card { padding: 1.5rem; }
    .contact-card { padding: 1.25rem 1.5rem; }
}

/* ── Accessibility ───────────────────────── */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--blue-600);
    outline-offset: 3px;
}

/* ── Print ───────────────────────────────── */
@media print {
    header, footer, .back-to-top { display: none !important; }
    body { font-size: 12pt; color: black; }
    pre { border: 1px solid #ccc; }
}

/* ── Code Tabs ────────────────────────────── */
.code-tab-container {
    margin-bottom: 1.5rem;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}
.code-tab-header {
    display: flex;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}
.code-tab-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-500);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}
.code-tab-btn:hover {
    color: var(--gray-800);
}
.code-tab-btn.active {
    color: var(--blue-600);
    border-bottom-color: var(--blue-600);
    background: #ffffff;
}
.code-tab-content {
    display: none;
}
.code-tab-content.active {
    display: block;
}
.code-tab-content pre {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    border: none !important;
}
