* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background-color: #1a1a1a;
    color: #e0e0e0;
    padding: 20px;
    font-size: 14px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #333;
}

h1 {
    font-size: 24px;
    color: #4CAF50;
}

h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #e0e0e0;
}

h3 {
    font-size: 14px;
    margin-bottom: 8px;
    color: #999;
}

section {
    margin-bottom: 40px;
}

/* Status indicator */
.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #666;
}

.status-dot.connected {
    background-color: #4CAF50;
}

.status-dot.error {
    background-color: #f44336;
}

/* Cards */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.card {
    background-color: #252525;
    border: 1px solid #333;
    padding: 15px;
}

.card div {
    margin-top: 8px;
    font-size: 13px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background-color: #252525;
    border: 1px solid #333;
}

th, td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #333;
}

th {
    background-color: #2a2a2a;
    color: #999;
    font-weight: normal;
}

tr:hover {
    background-color: #2a2a2a;
}

/* Status colors */
.status-healthy,
.status-active,
.status-running,
.status-idle {
    color: #4CAF50;
}

.status-paused,
.status-processing {
    color: #FFC107;
}

.status-error,
.status-failed,
.status-unhealthy {
    color: #f44336;
}

/* Buttons */
button {
    background-color: #333;
    color: #e0e0e0;
    border: 1px solid #555;
    padding: 6px 12px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    margin: 2px;
}

button:hover {
    background-color: #444;
}

button:active {
    background-color: #222;
}

button.primary {
    background-color: #4CAF50;
    border-color: #4CAF50;
}

button.primary:hover {
    background-color: #45a049;
}

button.danger {
    background-color: #f44336;
    border-color: #f44336;
}

button.danger:hover {
    background-color: #da190b;
}

/* Controls */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.controls-left {
    display: flex;
    gap: 15px;
    align-items: center;
}

.pagination {
    display: flex;
    gap: 10px;
    align-items: center;
}

select {
    background-color: #333;
    color: #e0e0e0;
    border: 1px solid #555;
    padding: 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

label {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Checkboxes */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #4CAF50;
}

#select-all {
    cursor: pointer;
}

/* Bot controls */
#bot-controls {
    margin-bottom: 15px;
    padding: 15px;
    background-color: #252525;
    border: 1px solid #333;
}

.service-scale {
    display: inline-block;
    margin-right: 20px;
    margin-bottom: 10px;
}

.scale-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}

.scale-controls button {
    width: 30px;
    padding: 4px;
}

/* Variant Service Styling */
.base-service {
    background-color: #252525;
    border: 1px solid #444;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.variant-service {
    background-color: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-left: 3px solid #4CAF50;
    padding: 10px;
    margin-bottom: 8px;
    margin-left: 20px;
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.service-status {
    color: #999;
    font-size: 12px;
}

.service-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.service-note {
    margin-top: 8px;
    font-size: 11px;
    color: #666;
}

.variants-container {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #333;
}

.variants-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
    font-weight: bold;
}

.variant-indicator {
    color: #4CAF50;
    font-weight: bold;
    font-size: 14px;
}

.create-variant-btn {
    background-color: #2d5f8d;
    border-color: #2d5f8d;
    color: #fff;
    font-size: 11px;
    padding: 6px 10px;
}

.create-variant-btn:hover {
    background-color: #3a7ab5;
}

.delete-variant-btn {
    background-color: #8d2d2d;
    border-color: #8d2d2d;
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
}

.delete-variant-btn:hover {
    background-color: #b53a3a;
}

/* Events */
#events-list {
    background-color: #252525;
    border: 1px solid #333;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.event {
    padding: 8px 0;
    border-bottom: 1px solid #333;
    font-size: 12px;
}

.event:last-child {
    border-bottom: none;
}

.event-time {
    color: #666;
    margin-right: 10px;
}

.event-type {
    color: #4CAF50;
    margin-right: 10px;
}

/* Network details */
#network-details {
    background-color: #252525;
    border: 1px solid #333;
    padding: 15px;
    margin-bottom: 15px;
}

#sessions-list {
    background-color: #252525;
    border: 1px solid #333;
    padding: 15px;
}

.session {
    padding: 8px 0;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.session:last-child {
    border-bottom: none;
}

/* Architecture */
.mermaid-container {
    background-color: #252525;
    border: 1px solid #333;
    padding: 20px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.mermaid-container pre.mermaid {
    background-color: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

.health-indicator {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    cursor: help;
    display: inline-block;
    padding: 2px 4px;
}

.health-ok {
    color: #4CAF50;
}

.health-down {
    color: #666;
}

.architecture-notes {
    background-color: #252525;
    border: 1px solid #333;
    padding: 15px;
    margin-top: 15px;
}

.routing-flow {
    margin-top: 10px;
}

.routing-flow div {
    padding: 8px 0;
    border-left: 3px solid #4CAF50;
    padding-left: 12px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #999;
}

.routing-flow div:last-child {
    margin-bottom: 0;
}

/* Bot Configuration */
#config-list {
    background-color: #252525;
    border: 1px solid #333;
    padding: 15px;
}

.config-item {
    padding: 15px;
    border-bottom: 1px solid #333;
    margin-bottom: 15px;
}

.config-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.config-preview {
    background-color: #1a1a1a;
    padding: 10px;
    font-size: 11px;
    border: 1px solid #333;
    margin: 0;
    max-height: 80px;
    overflow: hidden;
}

/* Config Form */
.config-form {
    background-color: #1a1a1a;
    padding: 20px;
    border: 1px solid #333;
    margin-bottom: 15px;
    max-height: 500px;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}

.form-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #4CAF50;
    font-weight: bold;
    font-size: 13px;
}

.field-description {
    display: block;
    color: #999;
    font-weight: normal;
    font-size: 11px;
    margin-top: 4px;
    font-style: italic;
}

.config-input,
.config-textarea {
    width: 100%;
    background-color: #252525;
    color: #e0e0e0;
    border: 1px solid #555;
    padding: 8px 12px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.config-input:focus,
.config-textarea:focus {
    outline: none;
    border-color: #4CAF50;
    background-color: #2a2a2a;
}

.config-textarea {
    resize: vertical;
    min-height: 80px;
}

.input-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.config-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #4CAF50;
}

.checkbox-label {
    color: #e0e0e0;
    margin: 0;
    cursor: pointer;
}

.array-input-container {
    width: 100%;
}

#config-editor {
    width: 100%;
    background-color: #1a1a1a;
    color: #e0e0e0;
    border: 1px solid #333;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    resize: vertical;
}

.loading-message {
    text-align: center;
    padding: 20px;
    color: #999;
}

.modal-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.config-modal-large {
    max-width: 900px;
    width: 90%;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background-color: #252525;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #333;
    width: 90%;
    max-width: 1400px;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: auto;
}

.close {
    color: #999;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #e0e0e0;
}

pre {
    background-color: #1a1a1a;
    padding: 15px;
    overflow-x: auto;
    font-size: 12px;
    border: 1px solid #333;
}

/* Utility */
.error-message {
    color: #f44336;
    padding: 10px;
    background-color: #2a1a1a;
    border: 1px solid #f44336;
    margin: 10px 0;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    background-color: #252525;
    border: 1px solid #555;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.toast.error {
    border-left: 4px solid #f44336;
}

.toast.success {
    border-left: 4px solid #4CAF50;
}

.toast.warning {
    border-left: 4px solid #FFC107;
}

.toast.info {
    border-left: 4px solid #2196F3;
}

.toast-message {
    flex: 1;
    font-size: 13px;
}

.toast-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 20px;
    height: 20px;
    margin: 0;
}

.toast-close:hover {
    color: #e0e0e0;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Item Details Formatting */
.item-details-formatted {
    color: #e0e0e0;
}

/* Generation rows - flexible layout */
.generation-row {
    flex-wrap: wrap;
    min-height: 200px;
}

.generation-row > div {
    flex-shrink: 0;
}

.item-details-formatted h3 {
    font-size: 16px;
    color: #4CAF50;
    margin: 20px 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
}

.item-details-formatted h3:first-child {
    margin-top: 0;
}

/* Images Grid */
.item-images {
    margin-bottom: 20px;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.image-container {
    background-color: #1a1a1a;
    border: 1px solid #333;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.item-image {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    transition: transform 0.2s;
}

.item-image:hover {
    transform: scale(1.02);
}

/* Info Table */
.item-info {
    margin-bottom: 20px;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #1a1a1a;
    border: 1px solid #333;
    margin-top: 10px;
}

.info-table tr {
    border-bottom: 1px solid #333;
}

.info-table tr:last-child {
    border-bottom: none;
}

.info-table td {
    padding: 10px;
}

.info-label {
    font-weight: bold;
    color: #999;
    width: 150px;
    vertical-align: top;
}

.info-value {
    color: #e0e0e0;
}

.info-value a {
    color: #4CAF50;
    text-decoration: none;
}

.info-value a:hover {
    text-decoration: underline;
}

/* Description Section */
.item-description {
    margin-bottom: 20px;
}

.item-description p {
    background-color: #1a1a1a;
    border: 1px solid #333;
    padding: 15px;
    margin-top: 10px;
    line-height: 1.6;
    color: #e0e0e0;
}

/* JSON Section */
.item-json {
    margin-top: 20px;
    border: 1px solid #333;
    background-color: #1a1a1a;
}

.item-json summary {
    padding: 10px 15px;
    cursor: pointer;
    background-color: #252525;
    color: #999;
    user-select: none;
}

.item-json summary:hover {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

.item-json pre {
    margin: 0;
    border: none;
    border-top: 1px solid #333;
}

/* Bot Settings Tabs */
#settings-tabs-container {
    background-color: #252525;
    border: 1px solid #333;
    padding: 0;
}

.tabs-navigation {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #333;
    background-color: #1a1a1a;
}

.tab-button {
    background-color: #252525;
    color: #999;
    border: none;
    border-right: 1px solid #333;
    padding: 12px 20px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    transition: all 0.2s;
    margin: 0;
}

.tab-button:hover {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

.tab-button.active {
    background-color: #252525;
    color: #4CAF50;
    border-bottom: 2px solid #4CAF50;
    margin-bottom: -2px;
}

.tabs-content {
    padding: 20px;
    min-height: 600px;
}

.settings-tab-content {
    max-width: 100%;
}

.settings-form {
    background-color: #1a1a1a;
    padding: 20px;
    border: 1px solid #333;
    margin-bottom: 15px;
    max-height: 800px;
    overflow-y: auto;
}

.settings-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

.info-message {
    background-color: #1a3a52;
    border: 1px solid #2d5f8d;
    padding: 20px;
    border-radius: 4px;
    color: #e0e0e0;
}

.info-message strong {
    color: #4CAF50;
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
}

.info-message p {
    margin: 0;
    color: #999;
    font-size: 13px;
}

/* Navigation */
.navbar {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    border-bottom: 2px solid #333;
}

.nav-link {
    padding: 12px 24px;
    text-decoration: none;
    color: #999;
    background-color: #222;
    border: 1px solid #333;
    border-bottom: none;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.nav-link:hover {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

.nav-link.active {
    background-color: #1a1a1a;
    color: #4CAF50;
    border-bottom: 2px solid #1a1a1a;
    margin-bottom: -2px;
}

/* Pages */
.page {
    display: none;
}

.page.active {
    display: block;
}
