/* ========================================
   G6PD Research - Shared Styles
   Mobile-First Responsive Design
   ======================================== */

:root {
    --primary: #0066CC;
    --primary-dark: #004C99;
    --primary-light: #E6F0FA;
    --secondary: #10B981;
    --secondary-dark: #059669;
    --accent: #8B5CF6;
    --text: #1F2937;
    --text-light: #6B7280;
    --text-lighter: #9CA3AF;
    --bg: #FFFFFF;
    --bg-alt: #F9FAFB;
    --bg-dark: #0F172A;
    --bg-darker: #020617;
    --border: #E5E7EB;
    --gradient-1: linear-gradient(135deg, #0066CC 0%, #8B5CF6 100%);
    --gradient-2: linear-gradient(135deg, #10B981 0%, #0066CC 100%);
    --gradient-3: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.25);
    --radius: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    line-height: 1.6;
    background: var(--bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Typography - Mobile First */
h1, h2, h3 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
p { font-size: 1rem; }

@media (min-width: 768px) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2.5rem; }
    h3 { font-size: 1.5rem; }
    p { font-size: 1.1rem; }
}

@media (min-width: 1024px) {
    h1 { font-size: 4rem; }
    h2 { font-size: 3rem; }
    h3 { font-size: 1.75rem; }
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ========================================
   Navigation - Mobile First
   ======================================== */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

nav.scrolled {
    box-shadow: var(--shadow);
}

nav.dark {
    background: rgba(15, 23, 42, 0.9);
    border-bottom-color: rgba(255,255,255,0.1);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

@media (min-width: 768px) {
    .nav-container {
        padding: 0 2rem;
        height: 70px;
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}

nav.dark .logo {
    color: white;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 0.65rem;
    letter-spacing: -0.5px;
}

.nav-links {
    display: none;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
        align-items: center;
    }
}

.nav-links > li {
    display: flex;
    align-items: center;
}

.nav-links a {
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 0;
    position: relative;
}

nav.dark .nav-links a {
    color: rgba(255,255,255,0.8);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

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

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

nav.dark .nav-links a:hover,
nav.dark .nav-links a.active {
    color: var(--secondary);
}

nav.dark .nav-links a::after {
    background: var(--secondary);
}

/* Dropdown */
.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-dropdown > a,
.nav-dropdown > .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 0;
}

nav.dark .nav-dropdown > a,
nav.dark .nav-dropdown > .dropdown-toggle {
    color: rgba(255,255,255,0.8);
}

.nav-dropdown > a:hover,
.nav-dropdown > .dropdown-toggle:hover {
    color: var(--primary);
}

nav.dark .nav-dropdown > a:hover,
nav.dark .nav-dropdown > .dropdown-toggle:hover {
    color: var(--secondary);
}

/* Remove underline from dropdown toggle - must be more specific than .nav-links a::after */
.nav-links .nav-dropdown > a::after,
.nav-links .nav-dropdown > a:hover::after,
.nav-links .nav-dropdown > a.active::after,
.nav-links .nav-dropdown > .dropdown-toggle::after,
.nav-links .nav-dropdown > .dropdown-toggle:hover::after {
    display: none !important;
    width: 0 !important;
    content: none !important;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    min-width: 220px;
    padding: 0.75rem 0;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

nav.dark .dropdown-menu {
    background: var(--bg-dark);
    border-color: rgba(255,255,255,0.1);
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--text-light);
    font-size: 0.9rem;
}

nav.dark .dropdown-menu a {
    color: rgba(255,255,255,0.7);
}

.dropdown-menu a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

nav.dark .dropdown-menu a:hover {
    background: rgba(255,255,255,0.05);
    color: var(--secondary);
}

.dropdown-menu a::after {
    display: none;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

nav.dark .dropdown-divider {
    background: rgba(255,255,255,0.1);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
}

nav.dark .mobile-menu-btn {
    color: white;
}

@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    padding: 2rem;
    z-index: 999;
}

nav.dark + .mobile-nav {
    background: var(--bg-dark);
}

.mobile-nav.active {
    display: block;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.mobile-nav a {
    display: block;
    padding: 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 14px rgba(0, 102, 204, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
    color: white;
}

.btn-secondary {
    background: var(--bg-alt);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: white;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
}

.btn-outline:hover {
    background: white;
    color: var(--primary);
    border-color: white;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.05rem;
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: var(--gradient-3);
    padding: 80px 1rem 2rem;
}

@media (min-width: 768px) {
    .hero {
        padding: 0 2rem;
    }
}

.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(0, 102, 204, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 70%, rgba(139, 92, 246, 0.15) 0%, transparent 50%);
    animation: heroFloat 20s ease-in-out infinite;
}

@keyframes heroFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(2%, 2%) rotate(1deg); }
    50% { transform: translate(0, 4%) rotate(0deg); }
    75% { transform: translate(-2%, 2%) rotate(-1deg); }
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 900px;
    color: white;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease;
}

.hero h1 {
    color: white;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease 0.1s both;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    max-width: 600px;
    margin: 0 auto 2rem;
    animation: fadeInUp 0.8s ease 0.2s both;
}

@media (min-width: 768px) {
    .hero-subtitle {
        font-size: 1.25rem;
    }
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 3rem 0;
    animation: fadeInUp 0.8s ease 0.3s both;
}

@media (min-width: 768px) {
    .hero-stats {
        gap: 2rem;
    }
}

.hero-stat {
    text-align: center;
}

.hero-stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--secondary);
    font-family: 'JetBrains Mono', monospace;
}

@media (min-width: 768px) {
    .hero-stat-value {
        font-size: 3rem;
    }
}

.hero-stat-label {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (min-width: 768px) {
    .hero-stat-label {
        font-size: 0.9rem;
    }
}

.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    animation: fadeInUp 0.8s ease 0.4s both;
}

@media (min-width: 480px) {
    .hero-buttons {
        flex-direction: row;
    }
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(10px); }
    60% { transform: translateX(-50%) translateY(5px); }
}

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

/* ========================================
   Page Sections
   ======================================== */
.section {
    padding: 4rem 1rem;
}

@media (min-width: 768px) {
    .section {
        padding: 6rem 2rem;
    }
}

@media (min-width: 1024px) {
    .section {
        padding: 8rem 2rem;
    }
}

.section-dark {
    background: var(--bg-dark);
    color: white;
}

.section-alt {
    background: var(--bg-alt);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.container-sm {
    max-width: 800px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .section-header {
        margin-bottom: 4rem;
    }
}

.section-label {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 8px 20px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.section-dark .section-label {
    background: rgba(16, 185, 129, 0.2);
    color: var(--secondary);
}

.section-title {
    margin-bottom: 1rem;
}

.section-dark .section-title {
    color: white;
}

.section-description {
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

.section-dark .section-description {
    color: rgba(255,255,255,0.7);
}

/* ========================================
   Cards
   ======================================== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
}

@media (min-width: 768px) {
    .card {
        padding: 2rem;
    }
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-dark {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
}

.card-dark:hover {
    background: rgba(255,255,255,0.08);
}

/* ========================================
   Grid Layouts
   ======================================== */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 768px) {
    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
}

/* ========================================
   Interactive Elements
   ======================================== */
.interactive-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.interactive-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-1);
    opacity: 0;
    transition: var(--transition);
}

.interactive-card:hover::before {
    opacity: 0.05;
}

/* Animated Counter */
.counter {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: var(--bg-alt);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-1);
    border-radius: 4px;
    transition: width 1s ease;
}

/* Glow Effect */
.glow {
    position: relative;
}

.glow::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--gradient-1);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    filter: blur(20px);
    transition: var(--transition);
}

.glow:hover::after {
    opacity: 0.5;
}

/* ========================================
   3D Protein Viewer
   ======================================== */
.protein-viewer {
    width: 100%;
    height: 300px;
    background: var(--bg-dark);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

@media (min-width: 768px) {
    .protein-viewer {
        height: 400px;
    }
}

@media (min-width: 1024px) {
    .protein-viewer {
        height: 500px;
    }
}

.protein-viewer-controls {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    z-index: 10;
}

.viewer-btn {
    padding: 8px 16px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.viewer-btn:hover,
.viewer-btn.active {
    background: var(--primary);
    border-color: var(--primary);
}

/* ========================================
   Simulation Visualizations
   ======================================== */
.simulation-canvas {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.simulation-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animated DNA Helix */
.dna-helix {
    position: relative;
    width: 100px;
    height: 200px;
}

.dna-strand {
    position: absolute;
    width: 4px;
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    animation: dnaRotate 3s linear infinite;
}

.dna-strand:nth-child(2) {
    animation-delay: -1.5s;
    background: var(--secondary);
}

@keyframes dnaRotate {
    0% { transform: rotateY(0deg) translateX(-30px); }
    50% { transform: rotateY(180deg) translateX(30px); }
    100% { transform: rotateY(360deg) translateX(-30px); }
}

/* ========================================
   Footer
   ======================================== */
footer {
    background: var(--bg-dark);
    color: white;
    padding: 3rem 1rem 1.5rem;
}

@media (min-width: 768px) {
    footer {
        padding: 4rem 2rem 2rem;
    }
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr;
    }
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
}

.footer-description {
    color: rgba(255,255,255,0.6);
    font-size: 0.95rem;
    max-width: 300px;
}

.footer-title {
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255,255,255,0.6);
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--secondary);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 2rem;
    padding-top: 1.5rem;
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 0.9rem;
}

/* ========================================
   Utilities
   ======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-gradient {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.hidden { display: none; }

@media (max-width: 767px) {
    .hide-mobile { display: none !important; }
}

@media (min-width: 768px) {
    .hide-desktop { display: none !important; }
}

/* 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);
}

/* ========================================
   Page Specific - Research Cards
   ======================================== */
.research-card {
    display: block;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.research-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.research-card-image {
    height: 160px;
    background: var(--gradient-1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

@media (min-width: 768px) {
    .research-card-image {
        height: 200px;
    }
}

.research-card-content {
    padding: 1.5rem;
}

.research-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.research-card-description {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ========================================
   Animated Background Particles
   ======================================== */
.particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    animation: particleFloat 15s infinite;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}
