/**
 * AdisInsight MCP - Springer Nature Design System
 * Inspired by AdisInsight and Springer Nature branding
 */

/* Self-hosted Merriweather Sans (Springer Nature EDS font) */
@font-face {
    font-family: 'Merriweather Sans';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/static/fonts/merriweather-sans-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Merriweather Sans';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/static/fonts/merriweather-sans-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    /* AdisInsight Brand Colors */
    --adis-orange: #e87722;
    --adis-dark-blue: #01324b;

    /* Springer Nature Palette */
    --sn-blue-primary: #025e8d;
    --sn-blue-dark: #01324b;
    --sn-blue-light: #8faec1;
    --sn-blue-muted: #dfedf2;
    --sn-blue-pale: #ebf1f5;

    /* Neutral Colors */
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    --white: #ffffff;
    --black: #000000;

    /* Status */
    --success: #059669;
    --warning: #d97706;
    --error: #dc2626;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;

    /* Typography - Springer Nature EDS (self-hosted, GDPR compliant) */
    --font-sans: 'Merriweather Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    color: var(--gray-900);
}

h1 { font-size: 3rem; letter-spacing: -0.02em; }
h2 { font-size: 2rem; letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }

p { max-width: 65ch; }

a {
    color: var(--sn-blue-primary);
    text-decoration: none;
    transition: color 0.15s;
}

a:hover {
    color: var(--sn-blue-dark);
    text-decoration: underline;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

/* Header - Clean white with subtle border */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.header-logo img {
    height: 48px;
    width: auto;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--sn-blue-pale);
    border-radius: 100px;
    font-size: 0.8125rem;
    color: var(--sn-blue-dark);
    font-weight: 500;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--sn-blue-dark) 0%, var(--sn-blue-primary) 100%);
    color: var(--white);
    padding: var(--space-20) 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 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");
    opacity: 0.5;
}

.hero-content {
    position: relative;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    color: var(--white);
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: var(--space-6);
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: var(--space-10);
    line-height: 1.7;
}

/* Platform Badges */
.hero-platforms {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: var(--space-10);
}

.hero-platform {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-5);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--white);
}

.hero-platform-icon {
    width: 20px;
    height: 20px;
}

.hero-actions {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-8);
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--white);
    color: var(--sn-blue-dark);
}

.btn-primary:hover {
    background: var(--gray-100);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
}

/* Stats Bar */
.stats-bar {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    padding: var(--space-8);
    margin-top: calc(-1 * var(--space-12));
    position: relative;
    z-index: 10;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-8);
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--sn-blue-primary);
    margin-bottom: var(--space-1);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* Sections */
.section {
    padding: var(--space-20) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-12);
}

.section-header h2 {
    margin-bottom: var(--space-4);
}

.section-header p {
    color: var(--gray-600);
    font-size: 1.125rem;
    margin: 0 auto;
}

/* Tool Cards */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
}

.tool-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: var(--space-8);
    transition: all 0.2s ease;
}

.tool-card:hover {
    border-color: var(--sn-blue-light);
    box-shadow: 0 8px 32px rgba(2, 94, 141, 0.08);
    transform: translateY(-2px);
}

.tool-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-4);
}

.tool-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-card-icon svg {
    width: 24px;
    height: 24px;
}

.tool-card-icon--blue {
    background: var(--sn-blue-pale);
    color: var(--sn-blue-primary);
}

.tool-card-icon--green {
    background: #ecfdf5;
    color: var(--success);
}

.tool-card-icon--orange {
    background: #fffbeb;
    color: var(--warning);
}

.tool-card-icon--purple {
    background: #f5f3ff;
    color: #7c3aed;
}

.tool-card-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: var(--space-1) var(--space-3);
    border-radius: 6px;
    background: var(--gray-100);
    color: var(--gray-600);
}

.tool-card h3 {
    font-family: var(--font-mono);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-2);
    color: var(--gray-900);
}

.tool-card p {
    color: var(--gray-600);
    font-size: 0.9375rem;
    margin-bottom: var(--space-4);
    line-height: 1.6;
}

.tool-card-params {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.tool-card-param {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    padding: var(--space-1) var(--space-2);
    background: var(--gray-100);
    border-radius: 4px;
    color: var(--gray-700);
}

/* Connect Section */
.connect {
    background: var(--gray-50);
}

.connect-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
}

.connect-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: var(--space-8);
    transition: all 0.2s ease;
}

.connect-card:hover {
    border-color: var(--sn-blue-light);
    box-shadow: 0 8px 32px rgba(2, 94, 141, 0.08);
}

.connect-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

.connect-card-icon {
    width: 28px;
    height: 28px;
}

.connect-card-header h3 {
    font-size: 1.25rem;
}

.connect-steps {
    padding-left: var(--space-5);
    margin-bottom: var(--space-4);
}

.connect-steps li {
    color: var(--gray-700);
    font-size: 0.9375rem;
    padding: var(--space-1) 0;
    line-height: 1.6;
}

.connect-url-box {
    background: var(--gray-900);
    border-radius: 8px;
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
    overflow-x: auto;
}

.connect-url-box code {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: #86efac;
}

/* Endpoints */
.endpoints {
    max-width: 640px;
    margin: 0 auto;
}

.endpoint {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-3);
    transition: all 0.15s;
}

.endpoint:hover {
    border-color: var(--sn-blue-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.endpoint-method {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 700;
    padding: var(--space-1) var(--space-2);
    border-radius: 4px;
    min-width: 44px;
    text-align: center;
    text-transform: uppercase;
}

.endpoint-method--post {
    background: var(--sn-blue-pale);
    color: var(--sn-blue-primary);
}

.endpoint-method--get {
    background: #ecfdf5;
    color: var(--success);
}

.endpoint-path {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    flex: 1;
    color: var(--gray-800);
}

.endpoint-desc {
    color: var(--gray-500);
    font-size: 0.8125rem;
}

/* Footer - Light background to match header */
.footer {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    color: var(--gray-600);
    padding: var(--space-12) 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: var(--space-8);
    border-bottom: 1px solid var(--gray-200);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.footer-logo img {
    height: 40px;
    width: auto;
}

.footer-logo span {
    color: var(--gray-700);
    font-weight: 600;
    font-size: 0.9375rem;
}

.footer-links {
    display: flex;
    gap: var(--space-8);
}

.footer-links a {
    color: var(--gray-600);
    font-size: 1.125rem;
    font-weight: 500;
    transition: color 0.15s;
}

.footer-links a:hover {
    color: var(--sn-blue-primary);
    text-decoration: none;
}

.footer-copy {
    text-align: center;
    padding-top: var(--space-8);
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* Auth Choice Page */
.auth-page {
    min-height: calc(100vh - 72px - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-10) 0;
    background: var(--gray-50);
}

.auth-card {
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
}

.auth-card-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.auth-card-header h1 {
    font-size: 1.75rem;
    margin-bottom: var(--space-2);
}

.auth-card-header p {
    color: var(--gray-500);
    font-size: 1rem;
    margin: 0 auto;
}

.auth-alert {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    margin-bottom: var(--space-6);
}

.auth-alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--error);
    margin-top: 2px;
}

.auth-alert-icon svg {
    width: 20px;
    height: 20px;
}

.auth-alert-text strong {
    display: block;
    font-size: 0.875rem;
    color: #991b1b;
    margin-bottom: var(--space-1);
}

.auth-alert-text p {
    font-size: 0.8125rem;
    color: #b91c1c;
    line-height: 1.5;
}

.auth-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.auth-option {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-5) var(--space-6);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s ease;
}

.auth-option:hover {
    border-color: var(--sn-blue-light);
    box-shadow: 0 4px 16px rgba(2, 94, 141, 0.08);
    transform: translateY(-1px);
    text-decoration: none;
    color: inherit;
}

.auth-option--primary {
    border-color: var(--sn-blue-primary);
    box-shadow: 0 2px 8px rgba(2, 94, 141, 0.06);
}

.auth-option-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-option-icon svg {
    width: 22px;
    height: 22px;
}

.auth-option-icon--blue {
    background: var(--sn-blue-pale);
    color: var(--sn-blue-primary);
}

.auth-option-icon--teal {
    background: #f0fdfa;
    color: #0d9488;
}

.auth-option-body {
    flex: 1;
    min-width: 0;
}

.auth-option-body h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-1);
}

.auth-option-body p {
    font-size: 0.8125rem;
    color: var(--gray-500);
    line-height: 1.4;
}

.auth-option-arrow {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--gray-400);
}

.auth-option-arrow svg {
    width: 20px;
    height: 20px;
}

.auth-option:hover .auth-option-arrow {
    color: var(--sn-blue-primary);
}

.auth-quote {
    text-align: center;
    margin-top: var(--space-6);
    padding: var(--space-4) var(--space-5);
    background: var(--sn-blue-pale);
    border: 1px solid var(--sn-blue-muted);
    border-radius: 10px;
}

.auth-quote p {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin: 0;
    line-height: 1.5;
}

.auth-quote a {
    color: var(--sn-blue-primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-quote a:hover {
    text-decoration: underline;
    color: var(--sn-blue-dark);
}

.auth-help {
    text-align: center;
    margin-top: var(--space-6);
}

.auth-help p {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin: 0 auto;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 2.25rem; }
    .hero h1 { font-size: 2.5rem; }

    .hero {
        padding: var(--space-12) 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .connect-cards {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: var(--space-6);
        text-align: center;
    }

    .footer-logo {
        flex-direction: column;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-6);
    }

    .endpoint {
        flex-wrap: wrap;
    }

    .endpoint-desc {
        width: 100%;
        margin-top: var(--space-2);
    }
}
