/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: #0a1a0f;
    color: #e0e0e0;
    min-height: 100vh;
    line-height: 1.6;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== Colors ===== */
:root {
    --green: #2E7D32;
    --green-light: #4CAF50;
    --green-dark: #1B5E20;
    --gold: #D4A843;
    --gold-light: #E8C96A;
    --bg-dark: #0a1a0f;
    --bg-card: #0f2416;
    --bg-card-hover: #132e1b;
    --border: rgba(46,125,50,0.15);
    --text-primary: #f0f0f0;
    --text-secondary: rgba(255,255,255,0.55);
    --text-muted: rgba(255,255,255,0.3);
}

/* ===== Header ===== */
.header {
    background: rgba(10,26,15,0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 24px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}
.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #fff;
    padding: 3px;
    object-fit: contain;
}
.logo-title {
    font-weight: 800;
    font-size: 1.2rem;
    color: #fff;
    letter-spacing: 0.06em;
}
.logo-sub {
    display: block;
    font-size: 0.62rem;
    color: var(--green);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.nav { display: flex; gap: 8px; }
.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 8px;
    transition: all 0.2s;
}
.nav-link:hover { color: #fff; background: rgba(46,125,50,0.1); }
.nav-link.active { color: #fff; background: rgba(46,125,50,0.15); }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}
.btn-primary {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: #fff;
    box-shadow: 0 2px 12px rgba(46,125,50,0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--green-light) 0%, var(--green) 100%);
    transform: translateY(-1px);
}
.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-outline:hover {
    color: #fff;
    border-color: var(--green);
    background: rgba(46,125,50,0.08);
}
.btn-full { width: 100%; justify-content: center; }

.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    margin: 4px 0;
    border-radius: 2px;
}
.mobile-nav {
    display: none;
    flex-direction: column;
    padding: 8px 24px 16px;
    background: rgba(10,26,15,0.98);
    border-bottom: 1px solid var(--border);
}
.mobile-nav.show { display: flex; }

/* ===== Hero ===== */
.hero {
    background: linear-gradient(180deg, #0d2817 0%, #0a1a0f 100%);
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(46,125,50,0.08) 0%, transparent 70%);
    pointer-events: none;
}
.hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
    position: relative;
}
.hero-sub {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 32px;
    position: relative;
}
.search-box {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}
.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}
.search-box input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: #fff;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}
.search-box input:focus {
    border-color: var(--green);
    background: rgba(255,255,255,0.06);
    box-shadow: 0 0 0 3px rgba(46,125,50,0.1);
}
.search-box input::placeholder { color: var(--text-muted); }
.search-results {
    max-width: 600px;
    margin: 8px auto 0;
    text-align: left;
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border);
    display: none;
    max-height: 300px;
    overflow-y: auto;
}
.search-results.show { display: block; }
.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}
.search-result-item:hover { background: var(--bg-card-hover); }
.search-result-item:last-child { border-bottom: none; }
.search-result-item h4 { color: #fff; font-size: 0.88rem; margin-bottom: 2px; }
.search-result-item p { color: var(--text-secondary); font-size: 0.78rem; }

/* ===== Categories ===== */
.categories { padding: 60px 0; }
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}
.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    cursor: pointer;
    transition: all 0.25s;
}
.category-card:hover {
    border-color: rgba(46,125,50,0.4);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.cat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(46,125,50,0.1);
    border: 1px solid rgba(46,125,50,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.cat-icon svg { width: 22px; height: 22px; color: var(--green-light); }
.category-card h3 { color: #fff; font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.category-card p { color: var(--text-secondary); font-size: 0.82rem; margin-bottom: 12px; line-height: 1.5; }
.article-count { color: var(--gold); font-size: 0.75rem; font-weight: 600; }

/* ===== Ticket CTA ===== */
.ticket-cta { padding: 0 0 60px; }
.cta-card {
    background: linear-gradient(135deg, rgba(46,125,50,0.12) 0%, rgba(212,168,67,0.06) 100%);
    border: 1px solid rgba(46,125,50,0.25);
    border-radius: 16px;
    padding: 40px 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.cta-card h2 { color: #fff; font-size: 1.3rem; margin-bottom: 6px; }
.cta-card p { color: var(--text-secondary); font-size: 0.9rem; }

/* ===== Contact ===== */
.contact-info { padding: 0 0 80px; }
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    text-align: center;
}
.contact-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(46,125,50,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.contact-icon svg { width: 22px; height: 22px; color: var(--green-light); }
.contact-card h4 { color: #fff; font-size: 0.95rem; margin-bottom: 6px; }
.contact-card p { color: var(--gold); font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; }
.contact-hours { color: var(--text-muted); font-size: 0.78rem; }

/* ===== Page switching ===== */
.page { display: none; }
.page.active { display: block; }

/* ===== Knowledge Base ===== */
.kb-section { padding: 48px 0 80px; }
.kb-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; flex-wrap: wrap; gap: 16px; }
.kb-header h2 { color: #fff; font-size: 1.5rem; }
.kb-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}
.filter-btn:hover { border-color: var(--green); color: #fff; }
.filter-btn.active { background: var(--green); color: #fff; border-color: var(--green); }

.kb-articles { display: flex; flex-direction: column; gap: 12px; }
.kb-article {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px 24px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.kb-article:hover { border-color: rgba(46,125,50,0.3); background: var(--bg-card-hover); }
.kb-article-info h4 { color: #fff; font-size: 0.92rem; margin-bottom: 4px; }
.kb-article-info p { color: var(--text-secondary); font-size: 0.8rem; }
.kb-article-meta { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.kb-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.kb-badge.getting-started { background: rgba(46,125,50,0.15); color: var(--green-light); }
.kb-badge.metering { background: rgba(33,150,243,0.15); color: #64b5f6; }
.kb-badge.vending { background: rgba(212,168,67,0.15); color: var(--gold-light); }
.kb-badge.billing { background: rgba(156,39,176,0.15); color: #ce93d8; }
.kb-badge.integration { background: rgba(0,188,212,0.15); color: #4dd0e1; }
.kb-badge.troubleshooting { background: rgba(244,67,54,0.15); color: #ef9a9a; }

/* ===== Tickets ===== */
.tickets-section { padding: 48px 0 80px; }
.tickets-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.tickets-header h2 { color: #fff; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state svg { margin-bottom: 16px; opacity: 0.3; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 0.85rem; }

.ticket-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 32px;
}
.ticket-form h3 { color: #fff; margin-bottom: 24px; }
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: #fff;
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--green);
}
.form-group select { cursor: pointer; }
.form-group select option { background: #1a2e1f; }
.form-group textarea { resize: vertical; min-height: 100px; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; }

.ticket-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ticket-item-info h4 { color: #fff; font-size: 0.92rem; margin-bottom: 4px; }
.ticket-item-info p { color: var(--text-secondary); font-size: 0.8rem; }
.ticket-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
}
.ticket-status.open { background: rgba(212,168,67,0.15); color: var(--gold); }
.ticket-status.in-progress { background: rgba(33,150,243,0.15); color: #64b5f6; }
.ticket-status.resolved { background: rgba(46,125,50,0.15); color: var(--green-light); }

/* ===== System Status ===== */
.status-section { padding: 48px 0 80px; }
.status-section h2 { color: #fff; margin-bottom: 4px; }
.status-updated { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 24px; }
.status-overall {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-radius: 10px;
    margin-bottom: 32px;
    font-weight: 600;
    font-size: 1rem;
}
.status-overall.operational {
    background: rgba(46,125,50,0.1);
    border: 1px solid rgba(46,125,50,0.3);
    color: var(--green-light);
}
.status-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 48px; }
.status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.status-dot.operational { background: var(--green-light); box-shadow: 0 0 8px rgba(76,175,80,0.4); }
.status-dot.degraded { background: var(--gold); box-shadow: 0 0 8px rgba(212,168,67,0.4); }
.status-dot.outage { background: #ef5350; box-shadow: 0 0 8px rgba(239,83,80,0.4); }
.status-name { flex: 1; color: var(--text-primary); font-size: 0.9rem; font-weight: 500; }
.status-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
}
.status-badge.operational { background: rgba(46,125,50,0.15); color: var(--green-light); }
.status-badge.degraded { background: rgba(212,168,67,0.15); color: var(--gold); }
.status-badge.outage { background: rgba(239,83,80,0.15); color: #ef9a9a; }

.incident-heading { color: #fff; font-size: 1.1rem; margin-bottom: 16px; }
.incident-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 12px;
}
.incident-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.incident-date { color: var(--text-muted); font-size: 0.78rem; }
.incident-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}
.incident-badge.resolved { background: rgba(46,125,50,0.15); color: var(--green-light); }
.incident-badge.investigating { background: rgba(212,168,67,0.15); color: var(--gold); }
.incident-card h4 { color: #fff; font-size: 0.92rem; margin-bottom: 6px; }
.incident-card p { color: var(--text-secondary); font-size: 0.82rem; }

/* ===== Modals ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.modal-overlay.show { display: flex; }
.modal {
    background: linear-gradient(180deg, #0f2416 0%, #0a1a0f 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px;
    width: 100%;
    max-width: 440px;
    position: relative;
}
.modal-wide { max-width: 700px; max-height: 80vh; overflow-y: auto; }
.modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}
.modal-close:hover { color: #fff; }
.modal-logo { text-align: center; margin-bottom: 20px; }
.modal-logo img { width: 64px; height: 64px; border-radius: 12px; background: #fff; padding: 4px; }
.modal h3 { color: #fff; text-align: center; margin-bottom: 4px; }
.modal-sub { color: var(--text-secondary); text-align: center; font-size: 0.85rem; margin-bottom: 24px; }

/* Article content */
#articleContent h2 { color: #fff; font-size: 1.3rem; margin-bottom: 8px; }
#articleContent .article-meta { color: var(--text-muted); font-size: 0.78rem; margin-bottom: 20px; }
#articleContent p { color: var(--text-secondary); font-size: 0.88rem; margin-bottom: 14px; line-height: 1.7; }
#articleContent h3 { color: #fff; font-size: 1.05rem; margin: 20px 0 8px; }
#articleContent ul { color: var(--text-secondary); margin: 8px 0 14px 20px; font-size: 0.88rem; }
#articleContent li { margin-bottom: 6px; }
#articleContent code {
    background: rgba(255,255,255,0.06);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.82rem;
    color: var(--gold-light);
}

/* ===== Footer ===== */
.footer {
    background: rgba(10,26,15,0.95);
    border-top: 1px solid var(--border);
    padding: 20px 0;
}
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.footer-sep { margin: 0 8px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--text-secondary); text-decoration: none; font-size: 0.78rem; }
.footer-links a:hover { color: var(--green-light); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav, .header-actions { display: none; }
    .mobile-menu-btn { display: block; }
    .category-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .cta-card { flex-direction: column; text-align: center; padding: 28px; }
    .hero h1 { font-size: 1.6rem; }
    .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
    .kb-header { flex-direction: column; align-items: flex-start; }
    .tickets-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}
