/* DocuMind - PaddlePaddle Theme */
:root {
    --bg-dark: #0d1117;
    --bg-card: #161b22;
    --bg-elevated: #21262d;
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --secondary: #0ea5e9;
    --accent: #06b6d4;
    --text: #e6edf3;
    --text-muted: #7d8590;
    --border: #30363d;
    --glow: rgba(37, 99, 235, 0.5);
    --glow-secondary: rgba(14, 165, 233, 0.5);
    /* Baidu/PaddlePaddle colors */
    --paddle-blue: #2563eb;
    --ernie-blue: #1d4ed8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

.neural-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.3;
}

#neuralCanvas {
    width: 100%;
    height: 100%;
}

.app {
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 60px;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.8);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-neural {
    width: 36px;
    height: 36px;
    position: relative;
}

.neuron {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--glow);
}

.n1 { top: 0; left: 50%; transform: translateX(-50%); }
.n2 { bottom: 5px; left: 5px; }
.n3 { bottom: 5px; right: 5px; }

.synapse {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform-origin: left center;
}

.s1 { top: 12px; left: 18px; width: 15px; transform: rotate(50deg); }
.s2 { top: 12px; right: 3px; width: 15px; transform: rotate(-50deg); }

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.nav a:hover {
    color: var(--text);
}

.github-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.github-link:hover {
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--glow);
}

/* Hero */
.hero {
    text-align: center;
    padding: 100px 20px 80px;
    max-width: 900px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
    border: 1px solid var(--primary);
    border-radius: 30px;
    font-size: 0.85rem;
    color: var(--primary-light);
    margin-bottom: 30px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 25px;
}

.title-line {
    display: block;
}

.gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 40px;
}

.hero-cta {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn-primary {
    position: relative;
    padding: 16px 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px var(--glow);
}

.btn-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.3);
    border-radius: 12px;
    transform: translate(-50%, -50%) scale(0);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

.btn-secondary {
    padding: 16px 36px;
    background: transparent;
    color: var(--text);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

/* Section Styles */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.section-desc {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 50px;
}

/* Neural Network Section */
.neural-section {
    padding: 80px 60px;
}

.neural-network {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 60px;
}

.network-svg {
    width: 100%;
    height: auto;
    max-height: 500px;
}

.conn {
    fill: none;
    stroke: var(--border);
    stroke-width: 2;
    transition: stroke 0.5s;
}

.conn.active {
    stroke: url(#nodeGrad);
    filter: url(#glow);
}

.node-bg {
    fill: var(--bg-dark);
    stroke: var(--border);
    stroke-width: 2;
    transition: all 0.5s;
}

.node-inner {
    fill: var(--bg-card);
    transition: all 0.5s;
}

.node.active .node-bg {
    stroke: var(--primary);
    filter: url(#glow);
}

.node.active .node-inner {
    fill: rgba(99, 102, 241, 0.2);
}

.node-icon {
    fill: var(--text);
    font-size: 14px;
    font-weight: 600;
    text-anchor: middle;
    font-family: 'Space Grotesk', sans-serif;
}

.node-sub {
    fill: var(--text-muted);
    font-size: 10px;
    text-anchor: middle;
}

.node-label {
    fill: var(--text-muted);
    font-size: 11px;
    text-anchor: middle;
}

.coordinator-node .node-bg {
    stroke: var(--secondary);
}

.network-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
}

.ctrl-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.ctrl-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 30px var(--glow);
}

.network-status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
}

.status-dot {
    width: 10px;
    height: 10px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.3s;
}

.status-dot.active {
    background: #22c55e;
    box-shadow: 0 0 10px #22c55e;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% { opacity: 0.5; }
}

/* Agent Cards */
.agent-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.agent-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 25px;
    transition: all 0.3s;
    overflow: hidden;
}

.agent-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--glow) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.agent-card:hover .card-glow {
    opacity: 0.1;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.1rem;
}

.card-icon.coord { background: linear-gradient(135deg, var(--primary), var(--secondary)); }
.card-icon.ocr { background: linear-gradient(135deg, #22d3ee, #06b6d4); }
.card-icon.ana { background: linear-gradient(135deg, #f472b6, #ec4899); }
.card-icon.sum { background: linear-gradient(135deg, #a3e635, #84cc16); }
.card-icon.qa { background: linear-gradient(135deg, #fbbf24, #f59e0b); }

.card-header h3 {
    font-size: 1.1rem;
}

.agent-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.card-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.card-tech span {
    padding: 4px 10px;
    background: var(--bg-elevated);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Demo Section */
.demo-section {
    padding: 80px 60px;
    background: var(--bg-card);
}

.demo-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.demo-input-panel, .demo-output-panel {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.panel-header, .output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
}

.panel-title {
    font-weight: 600;
}

.load-sample {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.load-sample:hover {
    border-color: var(--primary);
    color: var(--primary);
}

#docInput {
    width: 100%;
    height: 300px;
    padding: 20px;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    resize: none;
}

#docInput:focus {
    outline: none;
}

.process-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: calc(100% - 40px);
    margin: 20px;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.process-btn:hover {
    box-shadow: 0 5px 30px var(--glow);
}

.output-tabs {
    display: flex;
    gap: 5px;
}

.out-tab {
    padding: 10px 18px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s;
}

.out-tab.active {
    background: var(--primary);
    color: white;
}

.output-content {
    height: 400px;
    overflow: hidden;
}

.out-panel {
    display: none;
    height: 100%;
    overflow-y: auto;
    padding: 20px;
}

.out-panel.active {
    display: block;
}

.neural-log {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.log-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.placeholder-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    opacity: 0.3;
}

.placeholder-hint {
    font-size: 0.8rem;
    margin-top: 10px;
}

.log-entry {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.log-time {
    color: var(--text-muted);
    font-size: 0.8rem;
    min-width: 60px;
}

.log-agent {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 80px;
    text-align: center;
}

.log-agent.coordinator { background: var(--primary); }
.log-agent.analysis { background: #ec4899; }
.log-agent.summary { background: #84cc16; }
.log-agent.qa { background: #f59e0b; }

.log-message {
    flex: 1;
}

/* Chat */
.chat-messages {
    height: calc(100% - 60px);
    overflow-y: auto;
    padding-bottom: 10px;
}

.chat-msg {
    margin-bottom: 15px;
    max-width: 85%;
}

.chat-msg.user {
    margin-left: auto;
}

.chat-msg .msg-content {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.chat-msg.user .msg-content {
    background: var(--primary);
}

.chat-msg.assistant .msg-content {
    background: var(--bg-elevated);
}

.chat-input {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

#chatInput {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
}

#chatInput:focus {
    outline: none;
    border-color: var(--primary);
}

#chatSend {
    padding: 12px 16px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

#chatSend:hover {
    background: var(--primary-light);
}

/* Deep Dive */
.deep-section {
    padding: 80px 60px;
}

.tech-showcase {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

.tech-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 25px;
}

.tech-header {
    margin-bottom: 20px;
}

.tech-badge {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.tech-header h3 {
    font-size: 1.2rem;
}

.tech-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.tech-content ul {
    list-style: none;
}

.tech-content li {
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.tech-content li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    transform: translateY(-50%);
}

/* Footer */
.footer {
    text-align: center;
    padding: 60px 20px;
    border-top: 1px solid var(--border);
}

.footer-neural {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-neural span {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: footerPulse 2s infinite;
}

.footer-neural span:nth-child(2) { animation-delay: 0.3s; }
.footer-neural span:nth-child(3) { animation-delay: 0.6s; }

@keyframes footerPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

.footer-text {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.footer-event {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .demo-container {
        grid-template-columns: 1fr;
    }
    
    .tech-showcase {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 15px 20px;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .neural-section, .demo-section, .deep-section {
        padding: 60px 20px;
    }
    
    .agent-details {
        grid-template-columns: 1fr;
    }
}
