/* =========================================
   NetPuller Innovation Engine — Public Frontend
   Dark theme, teal accent, responsive
   ========================================= */

/* ── CSS Variables ── */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111827;
    --bg-card: #1a2332;
    --bg-input: #1e293b;
    --border-color: #1e293b;
    --border-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #0d9488;
    --accent-light: #14b8a6;
    --accent-glow: #00e5ff;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --font-sans: 'Inter', 'Segoe UI', -apple-system, sans-serif;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 30px rgba(13, 148, 136, 0.15);
    --transition: all 0.3s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--accent-light);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Navigation ── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.2em;
    color: var(--text-primary);
}
.navbar .logo:hover { color: var(--accent-glow); }
.navbar .logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent), var(--accent-glow));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    font-weight: 500;
    transition: var(--transition);
}
.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
    background: rgba(13, 148, 136, 0.1);
}
.nav-links a.active {
    color: var(--accent-light);
}

.nav-cta {
    background: var(--accent) !important;
    color: #fff !important;
    padding: 8px 20px !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 600 !important;
}
.nav-cta:hover {
    background: var(--accent-light) !important;
    transform: translateY(-1px);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5em;
    cursor: pointer;
    padding: 4px;
}

/* ── Main Content ── */
main {
    margin-top: 64px;
    min-height: calc(100vh - 64px - 200px);
}

/* ── Hero Section ── */
.hero {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    padding: 80px 24px 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(13, 148, 136, 0.05) 0%, transparent 50%);
    animation: heroPulse 8s ease-in-out infinite;
    pointer-events: none;
}
@keyframes heroPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 1; }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: clamp(2.2em, 5vw, 3.5em);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-glow) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.15em;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 36px;
    line-height: 1.7;
}

.hero-input-group {
    display: flex;
    gap: 0;
    max-width: 560px;
    margin: 0 auto;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-glow);
}
.hero-input-group input {
    flex: 1;
    padding: 16px 20px;
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 1em;
    font-family: var(--font-sans);
    outline: none;
    transition: var(--transition);
}
.hero-input-group input:focus {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
}
.hero-input-group input::placeholder {
    color: var(--text-muted);
}
.hero-input-group button {
    padding: 16px 28px;
    background: var(--accent);
    color: #fff;
    border: none;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.hero-input-group button:hover {
    background: var(--accent-light);
}

/* ── Section Common ── */
.section {
    padding: 64px 24px;
    max-width: 1100px;
    margin: 0 auto;
}
.section-title {
    text-align: center;
    font-size: clamp(1.5em, 3vw, 2em);
    font-weight: 700;
    margin-bottom: 12px;
}
.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.05em;
    margin-bottom: 48px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ── How It Works ── */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
@media (max-width: 768px) {
    .steps { grid-template-columns: 1fr; }
}

.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 32px 24px;
    text-align: center;
    transition: var(--transition);
}
.step-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}
.step-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.2), rgba(0, 229, 255, 0.1));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.step-card h3 {
    font-size: 1.1em;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.step-card p {
    color: var(--text-secondary);
    font-size: 0.9em;
    line-height: 1.6;
}

/* ── Stats Section ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 32px 0;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 28px 20px;
    text-align: center;
    transition: var(--transition);
}
.stat-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}
.stat-number {
    font-size: 2.8em;
    font-weight: 800;
    color: var(--accent-glow);
    line-height: 1.1;
    margin-bottom: 4px;
    font-family: var(--font-mono);
}
.stat-label {
    color: var(--text-secondary);
    font-size: 0.85em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.stat-card.teal .stat-number { color: var(--accent-glow); }
.stat-card.green .stat-number { color: var(--success); }
.stat-card.amber .stat-number { color: var(--warning); }
.stat-card.blue .stat-number { color: #60a5fa; }

/* ── Problem Cards ── */
.problems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}
.problem-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: var(--transition);
    cursor: default;
}
.problem-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}
.problem-card .industry-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
    margin-bottom: 12px;
    background: rgba(13, 148, 136, 0.1);
    color: var(--accent-light);
    border: 1px solid rgba(13, 148, 136, 0.3);
}
.problem-card h3 {
    font-size: 1em;
    margin-bottom: 8px;
    line-height: 1.4;
}
.problem-card p {
    color: var(--text-secondary);
    font-size: 0.85em;
    line-height: 1.6;
    margin-bottom: 12px;
}
.problem-card .score {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
}
.score-high { background: rgba(34, 197, 94, 0.1); color: var(--success); border: 1px solid rgba(34, 197, 94, 0.3); }
.score-mid { background: rgba(245, 158, 11, 0.1); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.score-low { background: rgba(100, 116, 139, 0.1); color: var(--text-muted); border: 1px solid rgba(100, 116, 139, 0.3); }

/* ── Trust Section ── */
.trust-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    text-align: center;
    margin: 40px 0;
}
.trust-section h3 {
    font-size: 1.4em;
    margin-bottom: 12px;
}
.trust-section p {
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.7;
}
.trust-badges {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.trust-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9em;
}
.trust-badge .icon {
    font-size: 1.2em;
}

/* ── Footer ── */
.footer {
    border-top: 1px solid var(--border-color);
    padding: 40px 24px 32px;
    margin-top: 0;
}
.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
}
@media (max-width: 768px) {
    .footer-content { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .footer-content { grid-template-columns: 1fr; }
}
.footer-col h4 {
    color: var(--text-primary);
    font-size: 0.95em;
    margin-bottom: 12px;
}
.footer-col p, .footer-col a {
    color: var(--text-muted);
    font-size: 0.85em;
    line-height: 1.8;
    display: block;
}
.footer-col a:hover {
    color: var(--accent-light);
}
.footer-bottom {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8em;
    padding-top: 24px;
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}
.footer-logo {
    font-weight: 700;
    font-size: 1.1em;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.footer .tagline {
    font-style: italic;
    color: var(--accent);
    margin-top: 8px;
}

/* ════════════════════════════════════════
   CHAT PAGE SPECIFIC STYLES
   ════════════════════════════════════════ */

.chat-page {
    display: flex;
    height: calc(100vh - 64px);
    margin-top: 64px;
    overflow: hidden;
}

/* Sidebar */
.chat-sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.chat-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}
.chat-sidebar-header h3 {
    font-size: 0.9em;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.chat-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}
.sidebar-item {
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    font-size: 0.85em;
}
.sidebar-item:hover {
    background: rgba(13, 148, 136, 0.1);
    color: var(--text-primary);
}

/* Main Chat Area */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    position: relative;
}

/* Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.chat-messages:empty::after {
    content: 'Start a conversation — describe your problem above';
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 1em;
    text-align: center;
    padding: 40px;
}

.message {
    max-width: 680px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    line-height: 1.6;
    font-size: 0.95em;
    animation: msgIn 0.3s ease;
}
@keyframes msgIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    background: var(--accent);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.message.bot {
    background: var(--bg-card);
    color: var(--text-primary);
    align-self: flex-start;
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}
.message.bot strong {
    color: var(--accent-light);
}

/* Typing indicator */
.typing {
    align-self: flex-start;
    display: flex;
    gap: 6px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    border-bottom-left-radius: 4px;
}
.typing span {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-8px); opacity: 1; }
}

/* Similar problems in chat */
.similar-problems-box {
    margin-top: 12px;
    padding: 12px 16px;
    background: rgba(13, 148, 136, 0.05);
    border: 1px solid rgba(13, 148, 136, 0.2);
    border-radius: var(--radius-sm);
}
.similar-problems-box h4 {
    font-size: 0.85em;
    color: var(--accent-light);
    margin-bottom: 8px;
}
.similar-problems-box .similar-item {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.85em;
}
.similar-problems-box .similar-item:last-child { border-bottom: none; }

/* Feedback buttons */
.feedback-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.feedback-btn {
    padding: 6px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85em;
    cursor: pointer;
    transition: var(--transition);
}
.feedback-btn:hover {
    border-color: var(--accent);
    color: var(--accent-light);
    background: rgba(13, 148, 136, 0.1);
}
.feedback-btn.active {
    border-color: var(--accent);
    background: rgba(13, 148, 136, 0.2);
    color: var(--accent-light);
}

/* Input Area */
.chat-input-area {
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
    background: var(--bg-secondary);
}
.chat-input-wrapper {
    display: flex;
    gap: 8px;
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 4px;
    transition: var(--transition);
}
.chat-input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}
.chat-input-wrapper textarea {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.95em;
    font-family: var(--font-sans);
    resize: none;
    outline: none;
    min-height: 24px;
    max-height: 120px;
}
.chat-input-wrapper textarea::placeholder {
    color: var(--text-muted);
}
.chat-send-btn {
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff;
    font-size: 1em;
    cursor: pointer;
    transition: var(--transition);
    align-self: flex-end;
    margin: 4px;
}
.chat-send-btn:hover {
    background: var(--accent-light);
}
.chat-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Mobile chat sidebar toggle */
@media (max-width: 768px) {
    .chat-sidebar {
        display: none;
        position: fixed;
        left: 0;
        top: 64px;
        bottom: 0;
        width: 100%;
        z-index: 100;
        background: var(--bg-secondary);
    }
    .chat-sidebar.open {
        display: flex;
    }
    .chat-messages {
        padding: 16px;
    }
    .chat-input-area {
        padding: 12px 16px;
    }
    .mobile-toggle {
        display: block;
    }
    .nav-links {
        display: none;
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid var(--border-color);
        z-index: 999;
    }
    .nav-links.open {
        display: flex;
    }
    .nav-links a {
        width: 100%;
        padding: 12px 16px;
    }
    .hero {
        padding: 56px 16px 40px;
    }
    .hero-input-group {
        flex-direction: column;
        border-radius: var(--radius-md);
    }
    .hero-input-group input {
        border-radius: var(--radius-md) var(--radius-md) 0 0;
        border-right: 1px solid var(--border-color);
    }
    .hero-input-group button {
        border-radius: 0 0 var(--radius-md) var(--radius-md);
    }
    .section {
        padding: 40px 16px;
    }
}

/* ════════════════════════════════════════
   TRENDS PAGE
   ════════════════════════════════════════ */
.industry-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    flex-wrap: wrap;
    justify-content: center;
}
.industry-filter {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85em;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-sans);
}
.industry-filter:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}
.industry-filter.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ════════════════════════════════════════
   ABOUT PAGE
   ════════════════════════════════════════ */
.about-content {
    max-width: 720px;
    margin: 0 auto;
}
.about-content p {
    color: var(--text-secondary);
    font-size: 1.05em;
    line-height: 1.8;
    margin-bottom: 24px;
}
.about-values {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 32px 0;
}
.value-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
}
.value-card .icon {
    font-size: 2em;
    margin-bottom: 12px;
}
.value-card h4 {
    margin-bottom: 8px;
}
.value-card p {
    font-size: 0.9em !important;
    margin-bottom: 0 !important;
}

/* ── Loading Spinner ── */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Utility ── */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
