* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 50%, #e3f2fd 100%);
    color: #1a237e;
    min-height: 100vh;
    line-height: 1.6;
}

/* Main Content Container */
.main-content {
    padding-top: 80px;
    min-height: calc(100vh - 80px);
}

/* Module Styles */
.module {
    width: 100%;
    animation: fadeIn 0.3s ease-out;
}

.module.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(30, 136, 229, 0.2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1565c0, #42a5f5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: #546e7a;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5rem 0;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: #1565c0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #1565c0, #42a5f5);
    transition: width 0.3s;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 2rem 4rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../imgs/spermdna.png');
    background-size: 120%;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0.35;
    transform: translateY(-5%);
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(227, 242, 253, 0.05) 0%, rgba(187, 222, 251, 0.05) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #1a237e;
    animation: fadeInUp 1s ease-out;
}

.hero .subtitle {
    font-size: 1.25rem;
    color: #546e7a;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1565c0;
}

.stat-label {
    font-size: 0.875rem;
    color: #0d47a1;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Sections */
section {
    padding: 5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: #0d47a1;
}

.section-subtitle {
    text-align: center;
    color: #546e7a;
    max-width: 700px;
    margin: 0 auto 3rem;
}

/* Cards */
.card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(227, 242, 253, 0.9));
    border: 1px solid rgba(30, 136, 229, 0.2);
    border-radius: 16px;
    padding: 2rem;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(30, 136, 229, 0.15);
}

/* Introduction Section */
.intro-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    flex: 1;
    max-width: 1000px;
    margin: 3rem auto 0;
}

@media (max-width: 768px) {
    .intro-grid {
        grid-template-columns: 1fr;
    }
}

.intro-card {
    position: relative;
    overflow: hidden;
}

.intro-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1565c0, #42a5f5);
}

.intro-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #0d47a1;
}

.intro-card p {
    color: #546e7a;
    line-height: 1.8;
}

.card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* APA Browser */
.browser-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    border: 1px solid rgba(30, 136, 229, 0.2);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.browser-toolbar {
    background: rgba(227, 242, 253, 0.5);
    padding: 1rem 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(30, 136, 229, 0.2);
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-left: 2.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(30, 136, 229, 0.3);
    border-radius: 8px;
    color: #1a237e;
    font-size: 0.95rem;
}

.search-box input:focus {
    outline: none;
    border-color: #1565c0;
}

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, rgba(30, 136, 229, 0.15), rgba(66, 165, 245, 0.15));
    border: 1px solid rgba(30, 136, 229, 0.3);
    border-radius: 8px;
    color: #1565c0;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover {
    background: linear-gradient(135deg, rgba(30, 136, 229, 0.25), rgba(66, 165, 245, 0.25));
}

.browser-content {
    padding: 1.5rem;
}

/* Table styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(30, 136, 229, 0.15);
}

.data-table th {
    background: rgba(227, 242, 253, 0.5);
    color: #1565c0;
    font-weight: 600;
}

.data-table td {
    color: #1a237e;
}

.data-table tr:hover td {
    background: rgba(30, 136, 229, 0.05);
}

/* UMAP Comparison Sections */
.comparison-section {
    margin: 3rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(227, 242, 253, 0.9));
    border: 1px solid rgba(30, 136, 229, 0.2);
    border-radius: 16px;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 1.5rem;
}

.comparison-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(30, 136, 229, 0.15);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
}

.comparison-card:hover {
    box-shadow: 0 8px 25px rgba(30, 136, 229, 0.15);
    transform: translateY(-3px);
}

.comparison-card h4 {
    font-weight: 600;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid;
}

.comparison-card:first-child h4 {
    border-color: #1565c0;
}

.comparison-card:last-child h4 {
    border-color: #e53935;
}

iframe {
    background: #f5f5f5;
    border: 1px solid rgba(30, 136, 229, 0.2);
}

/* Lazy iframe loading states */
iframe.lazy-iframe {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    position: relative;
}

iframe.lazy-iframe::before {
    content: 'Loading...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #78909c;
    font-size: 0.9rem;
    z-index: 1;
}

iframe.lazy-iframe.loading {
    opacity: 0.7;
}

iframe.lazy-iframe.loading::before {
    display: block;
}

iframe.lazy-iframe.loaded {
    opacity: 1;
}

iframe.lazy-iframe.loaded::before {
    display: none;
}

/* Hide loading text once src is set */
iframe.lazy-iframe[src]::before {
    display: none;
}

@media (max-width: 900px) {
    .comparison-grid {
        grid-template-columns: 1fr;
    }
}

/* Function Table Styles */
.function-table-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(30, 136, 229, 0.2);
}

.function-search {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.function-search input {
    flex: 1;
    min-width: 250px;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(30, 136, 229, 0.3);
    border-radius: 8px;
    font-size: 0.95rem;
}

.function-search select {
    padding: 0.75rem 1rem;
    border: 1px solid rgba(30, 136, 229, 0.3);
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    min-width: 150px;
}

.function-table-wrapper {
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
}

.function-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.function-table th {
    background: linear-gradient(135deg, #1565c0, #42a5f5);
    color: white;
    padding: 0.75rem 0.5rem;
    text-align: left;
    position: sticky;
    top: 0;
    font-weight: 600;
}

.function-table td {
    padding: 0.5rem;
    border-bottom: 1px solid rgba(30, 136, 229, 0.15);
    color: #1a237e;
}

.function-table tr:hover td {
    background: rgba(30, 136, 229, 0.08);
}

.result-count {
    margin-top: 1rem;
    text-align: right;
    color: #546e7a;
    font-size: 0.9rem;
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.page-button {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(227, 242, 253, 0.9));
    border: 1px solid rgba(30, 136, 229, 0.3);
    border-radius: 8px;
    color: #1565c0;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.page-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #1565c0, #42a5f5);
    color: white;
    border-color: #1565c0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.3);
}

.page-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(227, 242, 253, 0.5);
}

.page-button.active {
    background: linear-gradient(135deg, #1565c0, #42a5f5);
    color: white;
    border-color: #1565c0;
}

/* ===== CONTACT MODULE STYLES ===== */

/* Contact Cards Grid */
.contact-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Contact Main Card */
.contact-main-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(30, 136, 229, 0.2);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.contact-main-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(30, 136, 229, 0.2);
}

/* Card Header */
.card-header {
    background: linear-gradient(135deg, #1565c0, #42a5f5);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-icon {
    font-size: 1.5rem;
}

.card-header h3 {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

/* Card Body */
.card-body {
    padding: 1.5rem;
}

/* Contact Info Card */
.contact-row {
    display: flex;
    margin-bottom: 0.75rem;
    align-items: flex-start;
}

.contact-label {
    font-weight: 600;
    color: #0d47a1;
    min-width: 90px;
    flex-shrink: 0;
}

.contact-value {
    color: #1a237e;
    word-break: break-word;
}

.divider {
    height: 1px;
    background: rgba(30, 136, 229, 0.15);
    margin: 1rem 0;
}

/* Highlight Card (Database Download) */
.highlight-card .card-header {
    background: linear-gradient(135deg, #2e7d32, #43a047);
}

.download-desc {
    color: #546e7a;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.db-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.db-badge {
    background: linear-gradient(135deg, #1565c0, #42a5f5);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.db-name {
    color: #0d47a1;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Download Button */
.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #1565c0, #42a5f5);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(30, 136, 229, 0.4);
    background: linear-gradient(135deg, #0d47a1, #1565c0);
}

.download-btn span {
    font-size: 1.2rem;
}

.download-note {
    text-align: center;
    color: #78909c;
    font-size: 0.8rem;
    margin-top: 0.75rem;
}

/* Citation Card */
.citation-card .card-header {
    background: linear-gradient(135deg, #7b1fa2, #9c27b0);
}

.citation-text {
    color: #1a237e;
    font-size: 0.95rem;
    line-height: 1.7;
    font-style: italic;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(30, 136, 229, 0.05);
    border-radius: 8px;
    border-left: 3px solid #9c27b0;
}

.citation-box {
    background: linear-gradient(135deg, rgba(123, 31, 162, 0.1), rgba(156, 39, 176, 0.1));
    border: 1px solid rgba(123, 31, 162, 0.2);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
}

.citation-box p {
    color: #7b1fa2;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0;
}

/* Responsive Contact Section */
@media (max-width: 768px) {
    .contact-cards-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .contact-main-card {
        margin-bottom: 0;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-header h3 {
        font-size: 1.1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .contact-row {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .contact-label {
        min-width: auto;
    }
    
    .download-btn {
        padding: 0.75rem 1rem;
    }
}

/* Footer */
footer {
    background: rgba(255, 255, 255, 0.9);
    padding: 3rem 2rem;
    margin-top: 4rem;
    border-top: 1px solid rgba(30, 136, 229, 0.2);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-logo {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1565c0, #42a5f5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: #78909c;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #1565c0;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll behavior */
html {
    scroll-behavior: smooth;
}

section[id] {
    scroll-margin-top: 80px;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: flex !important;
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links a {
        font-size: 0.85rem;
        padding: 0.25rem 0.5rem;
    }

    .nav-container {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
    }

    .logo {
        font-size: 1.25rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero-stats {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    section {
        padding: 2rem 0.5rem;
    }

    iframe {
        width: 100% !important;
        height: 300px !important;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}