/* ============================================
   TiansheAI Plugin System - n8n.io Style
   ============================================ */

:root {
    /* n8n-inspired dark theme */
    --bg-primary: #0e0918;
    --bg-secondary: #1a1225;
    --bg-card: #1f192a;
    --bg-card-hover: #2a2235;

    /* Accent colors */
    --accent: #ff6d4a;
    --accent-hover: #ff8566;
    --accent-glow: rgba(255, 109, 74, 0.4);

    /* Secondary accent */
    --secondary: #35a670;
    --secondary-light: #4cc98a;

    /* Purple accent */
    --purple: #8b5cf6;
    --purple-light: #a78bfa;

    /* Text colors */
    --text-primary: #ffffff;
    --text-secondary: #c4bbd3;
    --text-muted: #8b7fa5;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);

    /* Shadows and effects */
    --glow-accent: 0 0 40px rgba(255, 109, 74, 0.3);
    --glow-purple: 0 0 40px rgba(139, 92, 246, 0.3);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 8px 40px rgba(0, 0, 0, 0.4);

    /* Radius */
    --radius: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-secondary);
    background: var(--bg-primary);
    overflow-x: hidden;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--accent);
    color: var(--text-primary);
    box-shadow: 0 4px 20px rgba(255, 109, 74, 0.3);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 30px rgba(255, 109, 74, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-hover);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-large {
    padding: 18px 40px;
    font-size: 18px;
    border-radius: var(--radius-lg);
}

.btn-nav {
    background: var(--accent);
    color: #ffffff !important;
    padding: 10px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(255, 109, 74, 0.25);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-nav:hover {
    background: var(--accent-hover);
    color: #ffffff !important;
    transform: scale(1.05);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(14, 9, 24, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 36px;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color var(--transition-fast);
}

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

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}

/* Animated gradient background */
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(255, 109, 74, 0.1) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 80%, rgba(53, 166, 112, 0.08) 0%, transparent 50%);
    animation: gradientMove 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes gradientMove {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(2%, 2%) rotate(1deg); }
    66% { transform: translate(-2%, 1%) rotate(-1deg); }
}

/* Grid pattern overlay */
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-size: 56px;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.1;
}

.hero-content h1 span {
    background: linear-gradient(135deg, var(--accent) 0%, var(--purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 24px;
    color: var(--purple-light);
    font-weight: 600;
    margin-bottom: 24px;
}

.hero-description {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    margin-bottom: 60px;
}

.hero-stats {
    display: flex;
    gap: 48px;
}

.stat {
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Hero Code Block */
.hero-code {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.hero-code::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.5;
}

.hero-code pre {
    margin: 0;
    overflow-x: auto;
}

.hero-code code {
    font-family: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.hero-code .keyword { color: #c678dd; }
.hero-code .function { color: #61afef; }
.hero-code .string { color: #98c379; }
.hero-code .comment { color: #5c6370; font-style: italic; }

/* Section Styles */
.section-title {
    font-size: 48px;
    text-align: center;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.section-subtitle {
    text-align: center;
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 64px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Features Section */
.features {
    padding: 120px 0;
    background: var(--bg-secondary);
    position: relative;
}

.features::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--bg-card);
    padding: 36px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--purple));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card-hover);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(255, 109, 74, 0.15), rgba(139, 92, 246, 0.15));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.feature-icon svg {
    width: 28px;
    height: 28px;
    color: var(--accent);
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 15px;
}

/* Architecture Section */
.architecture {
    padding: 120px 0;
    background: var(--bg-primary);
}

.arch-diagram {
    max-width: 1000px;
    margin: 0 auto;
}

.arch-layer {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    position: relative;
}

.arch-item {
    background: var(--bg-card);
    padding: 16px 28px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.arch-item:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 20px rgba(255, 109, 74, 0.2);
}

.arch-item.primary {
    background: linear-gradient(135deg, var(--accent), #ff8566);
    color: var(--text-primary);
    border: none;
    padding: 20px 56px;
    font-size: 16px;
    box-shadow: 0 4px 20px rgba(255, 109, 74, 0.3);
}

.arch-item.secondary {
    background: var(--secondary);
    color: var(--text-primary);
    border: none;
    padding: 18px 40px;
    box-shadow: 0 4px 20px rgba(53, 166, 112, 0.3);
}

.arch-item.namespace {
    background: var(--bg-primary);
    color: var(--purple-light);
    border: 1px solid var(--purple);
    font-family: 'JetBrains Mono', monospace;
    padding: 12px 20px;
    font-size: 13px;
}

.arch-item.namespace:hover {
    background: rgba(139, 92, 246, 0.1);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.arch-desc {
    position: absolute;
    right: 0;
    font-size: 13px;
    color: var(--text-muted);
    padding: 16px 0;
}

.arch-top, .arch-middle {
    margin-bottom: 36px;
}

.arch-managers {
    margin-bottom: 28px;
}

/* APIs Section */
.apis {
    padding: 120px 0;
    background: var(--bg-secondary);
}

.api-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.api-category {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.api-category:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
}

.api-category h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-primary);
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.api-list {
    list-style: none;
}

.api-list li {
    padding: 10px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.api-list code {
    background: var(--bg-primary);
    color: var(--purple-light);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    margin-right: 8px;
    border: 1px solid var(--purple);
    font-family: 'JetBrains Mono', monospace;
}

/* Examples Section */
.examples {
    padding: 120px 0;
    background: var(--bg-primary);
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.example-card {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.example-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--purple), var(--secondary));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.example-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card-hover);
}

.example-card:hover::after {
    opacity: 1;
}

.example-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(255, 109, 74, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.example-card h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.example-card p {
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.7;
    font-size: 15px;
}

.example-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.example-tags span {
    background: var(--bg-primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.example-tags span:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* CTA Section */
.cta {
    padding: 120px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(255, 109, 74, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.cta h2 {
    font-size: 48px;
    color: var(--text-primary);
    margin-bottom: 20px;
    position: relative;
}

.cta p {
    font-size: 20px;
    color: var(--text-muted);
    margin-bottom: 40px;
    position: relative;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    padding: 80px 0 40px;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    margin-bottom: 60px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-logo-img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 100px;
}

.footer-col h4 {
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 12px;
}

.footer-col a {
    color: var(--text-muted);
    font-size: 14px;
    transition: color var(--transition-fast);
}

.footer-col a:hover {
    color: var(--accent);
}

.footer-col .contact-label {
    color: var(--text-muted);
    font-size: 14px;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

.footer-bottom a {
    color: var(--accent);
}

.footer-bottom a:hover {
    color: var(--accent-hover);
}

/* Responsive */
@media (max-width: 1024px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 60px;
    }

    .hero-content h1 {
        font-size: 44px;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-code {
        max-width: 600px;
        margin: 0 auto;
    }

    .features-grid,
    .api-categories,
    .examples-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-title {
        font-size: 40px;
    }
}

@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        height: auto;
        padding: 16px 24px;
        gap: 16px;
    }

    .nav-links {
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero {
        padding: 140px 0 80px;
    }

    .hero-content h1 {
        font-size: 36px;
    }

    .hero-subtitle {
        font-size: 20px;
    }

    .hero-code {
        display: none;
    }

    .features-grid,
    .api-categories,
    .examples-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 32px;
    }

    .section-subtitle {
        font-size: 16px;
        margin-bottom: 48px;
    }

    .arch-desc {
        display: none;
    }

    .footer-content {
        flex-direction: column;
        gap: 48px;
    }

    .footer-links {
        gap: 48px;
        flex-wrap: wrap;
    }

    .cta h2 {
        font-size: 36px;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Selection */
::selection {
    background: var(--accent);
    color: var(--text-primary);
}
