/* Custom Styles for BIOGENCH Website */

/* Base Styles */
:root {
    --primary: #0A3D6F;
    --secondary: #E8F1F8;
    --accent: #1E88E5;
    --dark: #333333;
    --medium: #666666;
    --light: #f8f9fa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Reduce awkward CJK line-break orphans (graceful in older browsers) */
p, li, blockquote {
    text-wrap: pretty;
}
h1, h2, h3, h4, .section-title {
    text-wrap: balance;
}

/* Refined scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: #eef3f8;
}
::-webkit-scrollbar-thumb {
    background: #b9cbdd;
    border-radius: 10px;
    border: 2px solid #eef3f8;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}
::selection {
    background: rgba(30, 136, 229, 0.18);
}

/* Navigation Styles */
.nav-link {
    color: var(--dark);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.mobile-nav-link {
    color: var(--dark);
    font-weight: 500;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
    transition: color 0.3s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--primary);
}

/* Button Styles */
.btn-primary {
    display: inline-block;
    background-color: var(--accent);
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid var(--accent);
}

.btn-primary:hover {
    background-color: #1565C0;
    border-color: #1565C0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.3);
}

.btn-secondary {
    display: inline-block;
    background-color: transparent;
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid white;
}

.btn-secondary:hover {
    background-color: white;
    color: var(--primary);
    transform: translateY(-2px);
}

.btn-accent {
    display: inline-block;
    background-color: white;
    color: var(--primary);
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-accent:hover {
    background-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Card Styles */
.advantage-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.advantage-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.product-image {
    position: relative;
    overflow: hidden;
}

.cert-card {
    transition: all 0.3s ease;
}

.cert-card:hover {
    transform: translateY(-4px);
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
}

/* Header Scroll Effect */
.header-scrolled {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-scrolled .nav-link {
    color: var(--dark);
}

.header-scrolled .nav-link:hover,
.header-scrolled .nav-link.active {
    color: var(--primary);
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Back to Top Button */
#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Mobile Menu */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

#mobile-menu.active {
    max-height: 500px;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background-color: var(--secondary);
    font-weight: 600;
    color: var(--primary);
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary {
    background-color: var(--primary);
    color: white;
}

.badge-accent {
    background-color: var(--accent);
    color: white;
}

.badge-success {
    background-color: #28a745;
    color: white;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Toast Notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    font-weight: 500;
    z-index: 9999;
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.toast.visible {
    transform: translateX(0);
}

.toast-success {
    background-color: #28a745;
}

.toast-error {
    background-color: #dc3545;
}

.toast-info {
    background-color: var(--accent);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

/* Timeline Styles */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--accent);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -35px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--accent);
    border: 3px solid white;
    box-shadow: 0 0 0 3px var(--accent);
}

.timeline-year {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

/* Accordion Styles */
.accordion-item {
    border: 1px solid #eee;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.accordion-header {
    padding: 1rem 1.5rem;
    background-color: var(--light);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--primary);
    transition: background-color 0.3s ease;
}

.accordion-header:hover {
    background-color: var(--secondary);
}

.accordion-icon {
    transition: transform 0.3s ease;
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-item.active .accordion-content {
    max-height: 500px;
}

.accordion-body {
    padding: 1rem 1.5rem;
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    color: var(--dark);
    text-decoration: none;
    transition: all 0.3s ease;
}

.page-btn:hover {
    background-color: var(--secondary);
    border-color: var(--accent);
}

.page-btn.active {
    background-color: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Filter Styles */
.filter-group {
    margin-bottom: 1.5rem;
}

.filter-title {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 2rem;
    background: white;
    color: var(--dark);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.filter-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-btn.active {
    background-color: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Search Box Styles */
.search-box {
    position: relative;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid #ddd;
    border-radius: 2rem;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    .btn-primary,
    .btn-secondary,
    .btn-accent {
        display: block;
        width: 100%;
        text-align: center;
    }

    .advantage-card {
        padding: 1.5rem;
    }

    .data-table {
        font-size: 0.875rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: black;
    }

    a {
        color: black;
        text-decoration: underline;
    }
}

/* =====================================================================
   VISUAL REFRESH — 2026 redesign layer (overrides earlier base rules)
   ===================================================================== */

/* ---------- Brand logo (wordmark only) ---------- */
.logo-text {
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 0.5px;
    line-height: 1;
    color: var(--primary);
    transition: color 0.3s ease;
}
a:hover .logo-text {
    color: var(--accent);
}
@media (min-width: 768px) {
    .logo-text { font-size: 1.65rem; }
}

/* ---------- Header: glass effect ---------- */
#header {
    background-color: rgba(255, 255, 255, 0.82);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    box-shadow: 0 1px 0 rgba(10, 61, 111, 0.06);
}

.header-scrolled {
    background-color: rgba(255, 255, 255, 0.92) !important;
    box-shadow: 0 6px 24px -8px rgba(10, 61, 111, 0.22) !important;
}

/* ---------- Section heading system ---------- */
.section-eyebrow {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.section-title {
    font-size: clamp(1.9rem, 4vw, 2.75rem);
    font-weight: 800;
    color: var(--primary);
    position: relative;
    display: inline-block;
    padding-bottom: 0.85rem;
    line-height: 1.2;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 56px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), #00A0E4);
}

/* ---------- Buttons: gradient + shine ---------- */
.btn-primary {
    background: linear-gradient(135deg, var(--accent), #00A0E4);
    border: none;
    box-shadow: 0 8px 20px -6px rgba(30, 136, 229, 0.55);
    position: relative;
    overflow: hidden;
}
.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s ease;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #1565C0, #008fcc);
    transform: translateY(-3px);
    box-shadow: 0 14px 28px -8px rgba(30, 136, 229, 0.6);
}
.btn-primary:hover::after {
    left: 140%;
}

.btn-secondary {
    backdrop-filter: blur(4px);
    background-color: rgba(255, 255, 255, 0.08);
}
.btn-secondary:hover {
    box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.35);
}

/* ---------- HERO ---------- */
.hero-section {
    background:
        radial-gradient(1200px 600px at 15% 20%, #13599E 0%, transparent 55%),
        radial-gradient(1000px 700px at 85% 80%, #1E88E5 0%, transparent 50%),
        linear-gradient(135deg, #062A4E 0%, #0A3D6F 55%, #0d2b50 100%);
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 35%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 35%, transparent 100%);
}

.hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    pointer-events: none;
}
.hero-blob-1 {
    width: 460px;
    height: 460px;
    top: -120px;
    left: -100px;
    background: radial-gradient(circle, #1E88E5, transparent 70%);
    animation: blobFloat 14s ease-in-out infinite;
}
.hero-blob-2 {
    width: 520px;
    height: 520px;
    bottom: -160px;
    right: -120px;
    background: radial-gradient(circle, #00A0E4, transparent 70%);
    animation: blobFloat 18s ease-in-out infinite reverse;
}
@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -30px) scale(1.12); }
}

/* DNA double-helix dotted motif on the right */
.hero-dna {
    position: absolute;
    top: 50%;
    right: 6%;
    width: 120px;
    height: 70%;
    transform: translateY(-50%);
    opacity: 0.25;
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.9) 2.5px, transparent 3px),
        radial-gradient(circle, rgba(0,160,228,0.9) 2.5px, transparent 3px);
    background-size: 60px 28px, 60px 28px;
    background-position: 0 0, 30px 14px;
    mask-image: linear-gradient(transparent, #000 20%, #000 80%, transparent);
    -webkit-mask-image: linear-gradient(transparent, #000 20%, #000 80%, transparent);
    animation: dnaScroll 6s linear infinite;
}
@keyframes dnaScroll {
    to { background-position: 0 28px, 30px 42px; }
}
@media (max-width: 1024px) {
    .hero-dna { display: none; }
}

.hero-eyebrow {
    display: inline-block;
    padding: 0.45rem 1.1rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #d6e8fb;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
}

.hero-gradient-text {
    background: linear-gradient(120deg, #7cc6ff, #ffffff 55%, #aee2ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hero-stat-border {
    border-left: 1px solid rgba(255, 255, 255, 0.18);
    border-right: 1px solid rgba(255, 255, 255, 0.18);
}

/* Hero entrance animations */
.hero-fade {
    opacity: 0;
    transform: translateY(24px);
    animation: heroFadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero-fade-delay-1 { animation-delay: 0.15s; }
.hero-fade-delay-2 { animation-delay: 0.3s; }
.hero-fade-delay-3 { animation-delay: 0.45s; }
@keyframes heroFadeUp {
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Gene product cards (homepage) ---------- */
.gene-card {
    display: flex;
    flex-direction: column;
    position: relative;
    text-align: left;
    padding: 2rem 1.75rem;
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 1.25rem;
    text-decoration: none;
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
    box-shadow: 0 4px 18px rgba(10, 61, 111, 0.05);
}
.gene-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), #00A0E4);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
    z-index: 2;
}
.gene-card:hover {
    transform: translateY(-10px);
    border-color: transparent;
    box-shadow: 0 22px 40px -16px rgba(10, 61, 111, 0.28);
}
.gene-card:hover::before { transform: scaleX(1); }
.gene-card-ghost {
    position: absolute;
    right: -4px;
    bottom: -12px;
    font-size: 3.2rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: rgba(10, 61, 111, 0.045);
    z-index: 0;
    user-select: none;
    pointer-events: none;
}
.gene-card-no {
    position: relative;
    z-index: 1;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: var(--accent);
    margin-bottom: 0.8rem;
}
.gene-card-name {
    position: relative;
    z-index: 1;
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
    letter-spacing: -0.5px;
}
.gene-card-divider {
    display: block;
    position: relative;
    z-index: 1;
    width: 36px;
    height: 3px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--accent), #00A0E4);
    margin: 0.95rem 0 1rem;
    transition: width 0.35s ease;
}
.gene-card:hover .gene-card-divider { width: 56px; }
.gene-card-desc {
    position: relative;
    z-index: 1;
    color: var(--medium);
    font-size: 0.95rem;
    line-height: 1.55;
}
.gene-card-link {
    position: relative;
    z-index: 1;
    display: inline-block;
    margin-top: auto;
    padding-top: 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.gene-card:hover .gene-card-link {
    opacity: 1;
    transform: translateY(0);
}
@media (hover: none) {
    .gene-card-link { opacity: 1; transform: none; }
}

/* ---------- Advantage cards (enhanced) ---------- */
.advantage-card {
    border: 1px solid #eef2f7;
}
.advantage-card p {
    font-size: 0.875rem;
    line-height: 1.7;
}
.icon-gradient {
    background: linear-gradient(135deg, var(--secondary), #d4e7fa);
    box-shadow: inset 0 0 0 1px rgba(30, 136, 229, 0.12);
    transition: transform 0.35s ease;
}
.advantage-card:hover .icon-gradient {
    transform: scale(1.08) rotate(-4deg);
}

/* ---------- Certification cards ---------- */
.cert-card {
    text-align: center;
}
.cert-img-box {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 7rem;
    background: #fff;
    border: 1px solid #e3ebf3;
    border-radius: 0.9rem;
    overflow: hidden;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.cert-card:hover .cert-img-box {
    transform: translateY(-4px);
    box-shadow: 0 16px 30px -16px rgba(10, 61, 111, 0.3);
}

/* ---------- Back to top ---------- */
#back-to-top {
    background: linear-gradient(135deg, var(--accent), #00A0E4);
    box-shadow: 0 10px 24px -8px rgba(30, 136, 229, 0.6);
}
#back-to-top:hover {
    transform: translateY(-3px);
}

/* ---------- Generic Tailwind card hover polish for inner pages ---------- */
.fade-in {
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-reduced-motion: reduce) {
    .hero-blob, .hero-dna { animation: none; }
    .hero-fade { animation: none; opacity: 1; transform: none; }
}
