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

/* ─── Tokens ────────────────────────────────────── */
:root {
    --rb-red:      #c0392b;
    --rb-red-tab:  rgba(155, 30, 22, 0.93);
    --rb-navy:     #1a3060;
    --rb-navy-dk:  #0d1a36;
    --rb-ink:      #1f2937;
    --rb-line:     #dde3ee;
    --rb-shadow:   0 8px 28px rgba(10, 20, 48, 0.28);
    --rb-glass-bg: rgba(255, 255, 255, 0.07);
    --rb-glass-bd: rgba(255, 255, 255, 0.13);
}

/* ══════════════════════════════════════════════════
   FULL-PAGE BACKGROUND — dark navy + molecular dots
   Uses layered CSS backgrounds so no images needed
══════════════════════════════════════════════════ */
body {
    font-family: "Manrope", "Segoe UI", sans-serif;
    color: var(--rb-ink);
    margin: 0;
    padding: 0;
    min-height: 100vh;

    /* 1. Radial dot grid — molecular lattice texture */
    background-image:
        radial-gradient(circle, rgba(100,140,220,0.18) 1.5px, transparent 1.5px),
        radial-gradient(circle, rgba(100,140,220,0.08) 1px,   transparent 1px),
        /* 2. Soft highlight blobs for depth */
        radial-gradient(ellipse 70% 50% at 15% 40%, rgba(30,60,120,0.55) 0%, transparent 70%),
        radial-gradient(ellipse 60% 45% at 82% 62%, rgba(20,45,100,0.45) 0%, transparent 70%),
        /* 3. Base gradient */
        linear-gradient(160deg, #0a1428 0%, #0f1e3a 25%, #142448 50%, #1a2e5a 75%, #0e1930 100%);
    background-size:
        36px 36px,
        72px 72px,
        100% 100%,
        100% 100%,
        100% 100%;
    background-attachment: fixed;
}

/* ─── Header ──────────────────────────────────── */
.header-section {
    background: rgba(8, 14, 30, 0.96) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    box-shadow: 0 2px 20px rgba(0,0,0,0.4) !important;
    border-bottom: 1px solid rgba(255,255,255,0.07) !important;
    position: relative;
    z-index: 100;
}

/* Override header title font globally */
.header-title {
    font-family: "Rajdhani", sans-serif !important;
    font-weight: 700 !important;
    font-size: 1.9rem !important;
    letter-spacing: 0.12rem !important;
}

.main-content { position: relative; z-index: 1; }

/* ══════════════════════════════════════════════════
   PAGE SHELL — flex column, fills full viewport
══════════════════════════════════════════════════ */
.rb-page {
    min-height: calc(100vh - 54px); /* subtract header height */
    display: flex;
    flex-direction: column;
}

/* ══════════════════════════════════════════════════
   HERO — brand left, tabs right, vertically centred
══════════════════════════════════════════════════ */
.rb-hero-wrap {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 420px;
    max-height: 560px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-top: 4vh;
}

.rb-hero-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: 18%;
    bottom: 18%;
    background: #ffffff;
    border-radius: 0;
    box-shadow: 0 16px 40px rgba(7, 14, 32, 0.28);
    z-index: 1;
}

.rb-hero-content {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    display: block;
}


/* Brand block — vertically centred, left side */
.rb-brand-overlay {
    position: absolute;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 1.4rem;
    z-index: 2;
    max-width: 420px;
}

.rb-brand-logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
    filter: drop-shadow(0 4px 20px rgba(0,0,0,0.55));
    flex-shrink: 0;
}

.rb-brand-name {
    font-family: "Rajdhani", sans-serif;
    font-size: 3.4rem;
    font-weight: 700;
    color: #b02a22;
    letter-spacing: 0.22rem;
    line-height: 1;
    text-shadow: 0 1px 6px rgba(0,0,0,0.35);
    margin: 0 0 0.3rem 0;
}

.rb-brand-sub {
    font-size: 0.85rem;
    font-weight: 500;
    color: #b02a22;
    letter-spacing: 0.08rem;
    text-transform: uppercase;
    text-shadow: 0 1px 6px rgba(0,0,0,0.5);
    margin: 0;
}

/* Staggered tabs — vertically centred, right side */
.rb-stagger-tabs {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
    pointer-events: none;
    z-index: 2;
}


.rb-stab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    padding: 0 2.6rem 0 2.2rem;
    color: #ffffff;
    text-decoration: none;
    font-family: "Rajdhani", sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.1rem;
    text-transform: uppercase;
    pointer-events: all;
    background: var(--rb-red-tab);
    border-left: 4px solid rgba(255,255,255,0.15);
    transition: filter 0.18s ease, padding-right 0.15s ease, border-left-color 0.18s;
    cursor: pointer;
}

.rb-stab:hover {
    filter: brightness(1.22);
    padding-right: 2.2rem;
    border-left-color: rgba(255,255,255,0.4);
    color: #fff;
    text-decoration: none;
}

.rb-stab-1 { margin-left: 36%; }
.rb-stab-2 { margin-left: 48%; }

.rb-stab-arrow {
    font-size: 1.15rem;
    opacity: 0.8;
    flex-shrink: 0;
    margin-left: 1rem;
    transition: transform 0.15s ease;
    letter-spacing: 0;
}
.rb-stab:hover .rb-stab-arrow { transform: translateX(6px); }

/* Thin red accent below hero */
.rb-hero-divider {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(192, 57, 43, 0.5) 25%,
        rgba(192, 57, 43, 0.8) 50%,
        rgba(192, 57, 43, 0.5) 75%,
        transparent 100%);
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════
   MAIN AREA — flex: 1 so it fills remaining height
   Welcome section pushed to bottom via mt-auto
══════════════════════════════════════════════════ */
.rb-main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Welcome + features: pushed to bottom */
.rb-below {
    margin-top: auto;
    padding: 2.5rem 3rem 3.5rem;
    max-width: 100%;
    width: 100%;
    align-self: stretch;
    box-sizing: border-box;
    background: #ffffff;
}

/* Section heading */
.rb-welcome-title {
    text-align: center;
    font-family: "Rajdhani", sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #9b2c2c;
    letter-spacing: 0.12rem;
    text-transform: uppercase;
    margin: 0 0 0.6rem 0;
}

/* Red underline accent */
.rb-welcome-title::after {
    content: "";
    display: block;
    width: 56px;
    height: 3px;
    background: var(--rb-red);
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

.rb-welcome-text {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 2.4rem;
    color: #2c3a52;
    font-size: 0.95rem;
    line-height: 1.8;
}

/* Feature cards — glass-morphism on dark bg */
.rb-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
}

.rb-feat-card {
    background: var(--rb-glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 0.65rem;
    border: 1px solid var(--rb-glass-bd);
    padding: 1.4rem 1.5rem;
    box-shadow: var(--rb-shadow);
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s;
}

.rb-feat-card:hover {
    transform: translateY(-3px);
    background: rgba(255,255,255,0.11);
    border-color: rgba(192, 57, 43, 0.4);
}

.rb-feat-icon {
    font-size: 1.3rem;
    margin-bottom: 0.6rem;
    display: block;
    color: #e57171;
}

.rb-feat-card h4 {
    margin: 0 0 0.4rem 0;
    font-family: "Rajdhani", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.04rem;
    text-transform: uppercase;
}

.rb-feat-card p {
    margin: 0;
    font-size: 0.83rem;
    color: rgba(190, 210, 240, 0.82);
    line-height: 1.65;
}

/* ─── Analysis Page (Run Prediction) ───────────── */
.rb-analysis-section {
    max-width: 980px;
    margin: 2.5rem auto 0;
    width: 100%;
    padding: 0 2rem 3rem;
    box-sizing: border-box;
}

.rb-input-card {
    background: #ffffff;
    border-radius: 1rem;
    padding: 1.6rem;
    box-shadow: 0 16px 40px rgba(7, 14, 32, 0.18);
    border: 1px solid rgba(11, 27, 60, 0.1);
}

.rb-input-title {
    font-family: "Rajdhani", sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.08rem;
    text-transform: uppercase;
    color: var(--rb-red);
    margin-bottom: 1rem;
}

.input-section-vertical {
    background: transparent;
    border: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sequence-input-vertical {
    width: 100%;
    padding: 0.85rem 0.9rem;
    border: 1px solid rgba(15, 30, 58, 0.18);
    border-radius: 0.6rem;
    font-family: "Space Mono", monospace;
    font-size: 0.95rem;
    min-height: 10rem;
    resize: vertical;
    background: #f9fbff;
}

.sequence-input-vertical:focus {
    outline: none;
    border-color: rgba(29, 52, 97, 0.6);
    box-shadow: 0 0 0 3px rgba(29, 52, 97, 0.15);
}

.upload-section-vertical {
    border: 1px dashed rgba(29, 52, 97, 0.45);
    background: rgba(29, 52, 97, 0.06);
    color: #2c3a52;
    padding: 0.85rem 0.9rem;
    border-radius: 0.6rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.upload-section-vertical:hover {
    border-color: var(--rb-red);
    background: rgba(176, 42, 34, 0.08);
}

.upload-section-vertical.file-selected {
    border-color: #1d4ed8;
    background: rgba(29, 78, 216, 0.1);
    color: #1e3a8a;
}

.upload-section-vertical.file-error {
    border-color: #b91c1c;
    background: rgba(185, 28, 28, 0.12);
    color: #7f1d1d;
}

.file-info {
    font-size: 0.85rem;
    margin-top: 0.35rem;
    color: #374151;
}

.button-row-vertical {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.analyze-btn,
.clear-btn,
.example-btn {
    border: none;
    border-radius: 999px;
    padding: 0.65rem 1.4rem;
    font-weight: 700;
    letter-spacing: 0.03rem;
    height: 2.8rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.analyze-btn {
    background: #1d4ed8;
    color: #ffffff;
}

.clear-btn {
    background: #ffffff;
    color: var(--rb-red);
    border: 1px solid rgba(176, 42, 34, 0.5);
}

.example-btn {
    background: var(--rb-red);
    color: #ffffff;
}

.analyze-btn:hover,
.clear-btn:hover,
.example-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(7, 14, 32, 0.12);
}

/* ─── Footer ──────────────────────────────────── */
.footer {
    background: rgba(6, 11, 25, 0.9) !important;
    border-top: 1px solid rgba(255,255,255,0.08) !important;
    position: relative;
    z-index: 1;
}
.footer .text-muted { color: rgba(255,255,255,0.42) !important; }
.footer a { color: #e57171 !important; }

/* ─── Results Page Theme ───────────────────────── */
.results-page {
    background: #0f1e3a;
    color: #e2e8f0;
}

.results-page .main-content {
    padding-top: 2rem;
}

.results-page .result-card,
.results-page .loading-container,
.results-page .modal-content {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid rgba(15, 30, 58, 0.12);
    box-shadow: 0 14px 30px rgba(7, 14, 32, 0.18);
}

.results-page .loading-container {
    border-radius: 1rem;
}

.results-page .analyze-btn {
    background: #1d4ed8;
    color: #ffffff;
}

.results-page .clear-btn {
    background: #ffffff;
    color: var(--rb-red);
    border: 1px solid rgba(176, 42, 34, 0.5);
}

.results-page .viewer-card h3,
.results-page .result-card h3 {
    color: var(--rb-red);
    font-family: "Rajdhani", sans-serif;
    letter-spacing: 0.06rem;
}

.results-page .legend div {
    color: #1f2937;
}

.results-page .alphafold-meta {
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: #475569;
}

/* ─── Documentation Page Theme ─────────────────── */
.rb-docs .card {
    border-radius: 0.9rem;
    border: 1px solid rgba(15, 30, 58, 0.12);
    box-shadow: 0 12px 24px rgba(7, 14, 32, 0.12);
}

.rb-docs .card-header {
    background: #ffffff !important;
    color: #1f2937 !important;
    border-bottom: 1px solid rgba(15, 30, 58, 0.12);
}

.rb-docs .card-header h3 {
    font-family: "Rajdhani", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.06rem;
    color: var(--rb-red);
}

.rb-docs .card-header.bg-primary,
.rb-docs .card-header.bg-success,
.rb-docs .card-header.bg-info,
.rb-docs .card-header.bg-warning {
    background: #ffffff !important;
    color: #1f2937 !important;
}

.rb-docs .text-primary,
.rb-docs .badge.bg-danger,
.rb-docs .badge.bg-warning {
    color: #ffffff !important;
    background-color: var(--rb-red) !important;
}

.rb-docs .badge.bg-primary,
.rb-docs .badge.bg-success,
.rb-docs .badge.bg-info {
    background-color: #1d4ed8 !important;
    color: #ffffff !important;
}

.rb-docs .bg-light {
    background: #f8fafc !important;
}

/* ─── Responsive ──────────────────────────────── */
@media (max-width: 1100px) {
    .rb-stab-1 { margin-left: 26%; }
    .rb-stab-2 { margin-left: 38%; }
    .rb-below  { padding: 2rem 2rem 3rem; }
}

@media (max-width: 900px) {
    .rb-features { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .rb-hero-wrap   { height: 52vh; min-height: 320px; }
    .rb-brand-logo  { width: 60px; height: 60px; }
    .rb-brand-name  { font-size: 2.6rem; }
    .rb-brand-overlay { left: 1.5rem; gap: 1rem; }
    .rb-stab-1      { margin-left: 14%; }
    .rb-stab-2      { margin-left: 24%; }
    .rb-stab        { font-size: 1.05rem; height: 60px; }
    .rb-below       { padding: 1.5rem 1.2rem 2.5rem; }
}

@media (max-width: 560px) {
    .rb-hero-wrap   { height: 48vh; min-height: 300px; }
    .rb-brand-overlay {
        left: 1rem; flex-direction: column;
        align-items: flex-start; gap: 0.25rem;
    }
    .rb-brand-logo  { width: 46px; height: 46px; }
    .rb-brand-name  { font-size: 2rem; }
    .rb-stab-1      { margin-left: 0; }
    .rb-stab-2      { margin-left: 6%; }
    .rb-stab        { height: 54px; font-size: 0.92rem; }
    .rb-features    { grid-template-columns: 1fr; }
    .rb-below       { padding: 1.2rem 0.9rem 2rem; }
}
