:root {
    --bg-color: #050505;
    --text-color: #e0e0e0;
    --accent-red: #FF2A2A;
    --accent-green: #00FF41;
    --panel-bg: #111111;
    --border-color: #333333;
    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    line-height: 1.6;
}

h1, h2, h3, .pkg-header, .agent-id {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: -0.05em;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: rgba(5, 5, 5, 0.9);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.1em;
}

.text-red { color: var(--accent-red); }

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    margin-left: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.3s;
}

.nav-links a:hover { color: var(--accent-red); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-family: var(--font-mono);
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.btn-small { padding: 8px 16px; font-size: 0.8rem; }

.btn-red {
    background-color: var(--accent-red);
    color: #fff;
}

.btn-red:hover {
    background-color: #ff0000;
    box-shadow: 0 0 15px rgba(255, 42, 42, 0.5);
}

.btn-primary {
    background-color: var(--text-color);
    color: var(--bg-color);
}

.btn-primary:hover {
    background-color: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.btn-outline {
    border-color: var(--text-color);
    color: var(--text-color);
}

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

.btn-outline-dark {
    border-color: #000;
    color: #000;
}

.btn-outline-dark:hover {
    background-color: #000;
    color: #fff;
}

.btn-black {
    background-color: #000;
    color: #fff;
    border: 1px solid #000;
}

.btn-black:hover {
    background-color: #333;
}

.btn-block { display: block; text-align: center; margin-top: 20px; }

/* Hero Section */
.hero {
    padding: 100px 0;
    position: relative;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.grid-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        linear-gradient(var(--border-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.1;
    z-index: -1;
}

.hero h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 20px;
}

.hero-sub {
    font-size: 1.2rem;
    color: #888;
    max-width: 600px;
    margin-bottom: 40px;
}

.status-indicator {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-green);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.led-green {
    width: 8px;
    height: 8px;
    background-color: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--accent-green);
    animation: blink 2s infinite;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.hero-actions { display: flex; gap: 20px; }

/* Core System */
.section-dark { padding: 80px 0; }

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 { font-size: 2.5rem; margin-bottom: 10px; }
.section-header p { color: #888; }

.core-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.core-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    padding: 40px;
    position: relative;
}

.core-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 2px;
    background: var(--accent-red);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s;
}

.core-card:hover::before { transform: scaleX(1); }

.agent-id {
    display: block;
    color: var(--accent-red);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.core-card h3 { font-size: 1.8rem; margin-bottom: 20px; }

.tech-list {
    list-style: none;
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.tech-list li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: #888;
}

.tech-list li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--accent-red);
}

.system-benefit {
    text-align: center;
    padding: 20px;
    border: 1px dashed var(--border-color);
    color: var(--accent-green);
    font-family: var(--font-mono);
}

/* Pakete Section */
.section-light {
    background-color: #f0f0f0;
    color: #111;
    padding: 80px 0;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: stretch;
}

.pricing-card {
    background: #fff;
    padding: 30px;
    border: 1px solid #ddd;
    display: flex;
    flex-direction: column;
}

.pkg-header {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.pkg-price {
    font-family: var(--font-mono);
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.pkg-features {
    list-style: none;
    flex-grow: 1;
}

.pkg-features li {
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.featured {
    border: 2px solid var(--accent-red);
    position: relative;
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 1;
}

.ultimum {
    background: #111;
    color: #fff;
    border: 1px solid #000;
    position: relative;
}

.ultimum .pkg-price { color: #888; border-color: #333; }
.ultimum .btn-black { background: #fff; color: #000; border-color: #fff; }
.ultimum .btn-black:hover { background: #ddd; }

.ultimum-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: var(--accent-green);
    color: #000;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 4px 8px;
    font-weight: 700;
}

/* Footer */
.footer {
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #666;
}

/* Responsive */
@media (max-width: 900px) {
    .hero h1 { font-size: 2.5rem; }
    .core-grid { grid-template-columns: 1fr; }
    .pricing-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    .pricing-grid { grid-template-columns: 1fr; }
    .nav-links { display: none; } /* Simplification for mobile */
}

/* FAQ Section */
.faq-section {
    padding: 60px 0;
    border-top: 1px solid var(--border-color);
}

.faq-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    padding: 20px;
    transition: border-color 0.3s;
}

.faq-item:hover {
    border-color: var(--accent-red);
}

.faq-question {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.faq-question::before {
    content: '+';
    color: var(--accent-red);
    font-weight: bold;
}

.faq-answer {
    color: #888;
    font-size: 0.9rem;
    padding-left: 20px;
    display: none;
    margin-top: 10px;
    line-height: 1.5;
}

.faq-item.active .faq-answer {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

.faq-item.active .faq-question::before {
    content: '-';
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Light Mode Theme */
body.light-mode {
    --bg-color: #f5f5f5;
    --text-color: #111111;
    --panel-bg: #ffffff;
    --border-color: #dddddd;
    --accent-green: #00aa2c; /* Darker green for better contrast on white */
}

body.light-mode .navbar {
    background: rgba(245, 245, 245, 0.9);
}

body.light-mode .section-light {
    background-color: #e0e0e0; /* Slightly darker to distinguish from white panels */
}

body.light-mode .btn-outline {
    border-color: #111;
    color: #111;
}

body.light-mode .btn-outline:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .hero-sub, 
body.light-mode .tech-list li,
body.light-mode .pkg-price,
body.light-mode .section-header p,
body.light-mode .faq-answer {
    color: #555;
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    margin-left: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.theme-toggle:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* FIX: Ensure visibility in Light Mode */
body.light-mode h1, 
body.light-mode h2, 
body.light-mode h3,
body.light-mode .logo,
body.light-mode .nav-links a {
    color: #111111 !important;
}

body.light-mode .core-card,
body.light-mode .faq-item {
    background: #ffffff;
    border-color: #dddddd;
    color: #111111;
}

body.light-mode .core-card h3,
body.light-mode .faq-question {
    color: #111111;
}

/* Ensure Ultimum card remains dark even in Light Mode for contrast */
body.light-mode .ultimum {
    background: #111111;
    color: #ffffff;
    border-color: #000000;
}

body.light-mode .ultimum h3,
body.light-mode .ultimum .pkg-price,
body.light-mode .ultimum li {
    color: #ffffff !important;
}

/* --- Core System Simulation --- */
.simulation-container {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.light-mode .simulation-container {
    background: #f5f5f5;
    border-color: #ddd;
}

.sim-network {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    height: 120px;
    max-width: 800px;
    margin: 0 auto;
}

/* Nodes */
.sim-node {
    width: 80px;
    height: 80px;
    background: var(--panel-bg);
    border: 1px solid var(--primary-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2;
    position: relative;
    transition: all 0.3s ease;
}

.sim-node.active {
    box-shadow: 0 0 15px var(--accent-green);
    border-color: #fff;
}

.sim-node .icon {
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
}

.sim-node .label {
    font-size: 0.7rem;
    font-family: 'JetBrains Mono', monospace;
    text-align: center;
    line-height: 1.2;
    color: var(--text-color);
}

.sim-node small {
    font-size: 0.6rem;
    opacity: 0.7;
}

/* Input Node Specifics */
.input-node {
    border-radius: 50%;
    width: 60px;
    height: 60px;
    border-color: var(--text-color);
}

.input-node .status-dot {
    width: 8px;
    height: 8px;
    background: #555;
    border-radius: 50%;
    margin-top: 5px;
}

.input-node.active .status-dot {
    background: var(--accent-green);
    box-shadow: 0 0 5px var(--accent-green);
}

/* Agent Node Specifics */
.agent-node .status-ring {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 1px dashed var(--accent-green);
    border-radius: 50%; /* Make ring circular if node was circular, but node is square-ish */
    opacity: 0;
    animation: spin 2s linear infinite;
}

.agent-node {
    border-radius: 4px; /* Square nodes for agents */
}

.agent-node.processing .status-ring {
    opacity: 1;
    border-radius: 4px;
}

/* Output Node Specifics */
.output-node {
    width: 100px;
    border-color: var(--accent-red);
}

.log-lines {
    width: 80%;
    margin-top: 5px;
}

.log-lines .line {
    height: 2px;
    background: #333;
    margin-bottom: 3px;
    width: 100%;
}

.output-node.active .line {
    background: var(--accent-red);
    animation: typeLine 0.5s ease forwards;
}

@keyframes typeLine {
    from { width: 0; }
    to { width: 100%; }
}

/* Connections */
.sim-connection {
    flex-grow: 1;
    height: 2px;
    background: #333;
    position: relative;
    margin: 0 10px;
}

.light-mode .sim-connection {
    background: #ccc;
}

/* Data Packets */
.data-packet {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    position: absolute;
    top: -3px;
    left: 0;
    opacity: 0;
    box-shadow: 0 0 5px var(--accent-green);
}

/* Animations */
@keyframes travel {
    0% { left: 0; opacity: 1; }
    90% { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Status Text */
.sim-status-text {
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    margin-top: 1.5rem;
    color: var(--accent-green);
    min-height: 1.2em;
}

.light-mode .sim-status-text {
    color: #00aa2c; /* Darker green for readability */
}

/* --- Live Status Bar --- */
.live-status-bar {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 0.75rem 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-green);
    backdrop-filter: blur(5px);
    width: fit-content;
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.status-label {
    font-size: 0.7rem;
    color: #888;
    letter-spacing: 1px;
}

.status-value {
    font-family: var(--font-mono);
    font-weight: bold;
    color: var(--text-color);
    font-size: 1.1rem;
}

/* Light Mode Adjustments for Status Bar */
body.light-mode .live-status-bar {
    background: rgba(255, 255, 255, 0.5);
    border-color: #ccc;
    border-left-color: var(--accent-green);
}

body.light-mode .status-label {
    color: #666;
}

@media (max-width: 768px) {
    .live-status-bar {
        flex-wrap: wrap;
        gap: 1rem;
        width: 100%;
    }
    
    .status-item {
        flex: 1 1 40%;
    }
}

/* --- Live Chat Widget --- */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: var(--font-mono);
}

.chat-toggle-btn {
    background: var(--accent-red);
    color: #fff;
    border: none;
    padding: 12px 20px;
    font-family: var(--font-mono);
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 0 15px rgba(255, 42, 42, 0.3);
    transition: all 0.3s;
}

.chat-toggle-btn:hover {
    background: #ff0000;
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(255, 42, 42, 0.6);
}

.chat-window {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 350px;
    height: 450px;
    background: var(--panel-bg);
    border: 1px solid var(--accent-red);
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.chat-window.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.chat-header {
    background: var(--accent-red);
    color: #fff;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-status .led-green {
    background: #fff;
    box-shadow: 0 0 5px #fff;
}

.chat-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
}

.chat-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
}

.message {
    padding: 10px;
    font-size: 0.85rem;
    max-width: 85%;
    line-height: 1.4;
    word-wrap: break-word;
}

.system-message {
    align-self: flex-start;
    background: rgba(255, 42, 42, 0.1);
    border-left: 2px solid var(--accent-red);
    color: var(--text-color);
}

.user-message {
    align-self: flex-end;
    background: rgba(255, 255, 255, 0.1);
    border-right: 2px solid #fff;
    color: var(--text-color);
    text-align: right;
}

.chat-input-area {
    padding: 10px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    background: var(--panel-bg);
}

#chat-input {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

#chat-input:focus {
    outline: none;
    border-color: var(--accent-red);
}

.chat-send-btn {
    background: var(--text-color);
    color: var(--bg-color);
    border: none;
    padding: 0 15px;
    font-family: var(--font-mono);
    font-weight: bold;
    cursor: pointer;
    font-size: 0.8rem;
}

.chat-send-btn:hover {
    background: #fff;
}

/* Light Mode Adjustments for Chat */
body.light-mode .chat-window {
    background: #fff;
    border-color: var(--accent-red);
}

body.light-mode .chat-messages {
    background: #f9f9f9;
}

body.light-mode .system-message {
    background: rgba(255, 42, 42, 0.05);
    color: #333;
}

body.light-mode .user-message {
    background: #e0e0e0;
    border-color: #999;
    color: #333;
}

body.light-mode #chat-input {
    background: #fff;
    border-color: #ccc;
    color: #333;
}

body.light-mode .chat-send-btn {
    background: #333;
    color: #fff;
}
