/* Network Monitor UI Styling */
.network-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--md-sys-shape-corner-medium, 6px);
    padding: var(--md-sys-spacing-3);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-2);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.network-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(25, 127, 230, 0.25);
    transform: translateY(-1px);
}

.network-item.expanded {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(25, 127, 230, 0.35);
}

.network-item-header {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-2);
    justify-content: space-between;
}

.network-item-header-left {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-2);
    overflow: hidden;
    flex: 1;
}

.network-endpoint-name {
    font-weight: 600;
    font-size: 11px;
    color: var(--md-sys-color-on-surface-strong);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    flex: 1;
}

.network-item-time {
    font-size: 9px;
    opacity: 0.5;
    white-space: nowrap;
}

.badge-method {
    font-size: 8px;
    font-weight: 700;
    border-radius: 4px;
    padding: 1px 4px;
    color: #ffffff;
    text-transform: uppercase;
    flex-shrink: 0;
}

.badge-method.get { background: #007acc; }
.badge-method.post { background: #4caf50; }
.badge-method.put { background: #ff9800; }
.badge-method.delete { background: #f44336; }
.badge-method.deluge-execution {
    background: linear-gradient(135deg, #b5179e, #7209b7);
    box-shadow: 0 0 6px rgba(114, 9, 183, 0.4);
}
.badge-method.deluge-task {
    background: linear-gradient(135deg, #00f2fe, #4facfe);
    box-shadow: 0 0 6px rgba(0, 242, 254, 0.4);
    color: #ffffff;
}
.deluge-task-item {
    border-left: 3px solid #00f2fe !important;
}
.deluge-execution-item {
    border-left: 3px solid #7209b7 !important;
}
.console-log-block {
    background: #181820 !important;
    border: 1px solid rgba(80, 250, 123, 0.2) !important;
    color: #50fa7b !important;
    font-family: 'Fira Code', 'Courier New', Courier, monospace !important;
}

.badge-status {
    font-size: 8px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 4px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.badge-status.success {
    background: rgba(80, 250, 123, 0.15);
    color: #50fa7b;
    border: 1px solid rgba(80, 250, 123, 0.3);
}

.badge-status.warning {
    background: rgba(255, 184, 108, 0.15);
    color: #ffb86c;
    border: 1px solid rgba(255, 184, 108, 0.3);
}

.badge-status.error {
    background: rgba(255, 85, 85, 0.15);
    color: #ff5555;
    border: 1px solid rgba(255, 85, 85, 0.3);
}

.network-context-chip {
    font-size: 8.5px;
    font-family: monospace;
    padding: 1px 4px;
    border-radius: 3px;
    background: rgba(25, 127, 230, 0.08);
    color: #197fe6;
    border: 1px solid rgba(25, 127, 230, 0.15);
    align-self: flex-start;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 100%;
}
.network-context-chip.clickable {
    cursor: pointer;
    transition: all 0.15s ease;
}
.network-context-chip.clickable:hover {
    background: rgba(25, 127, 230, 0.18);
    border-color: rgba(25, 127, 230, 0.35);
}

.network-item-body {
    display: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: var(--md-sys-spacing-3);
    margin-top: var(--md-sys-spacing-1);
    flex-direction: column;
    gap: var(--md-sys-spacing-3);
    animation: fadeIn 0.2s ease-out;
}

.network-item.expanded .network-item-body {
    display: flex;
}

.network-detail-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

.network-log-details-label {
    font-weight: 700;
    color: var(--md-sys-color-primary);
    font-size: 8.5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.network-url-text {
    font-family: monospace;
    font-size: 9.5px;
    word-break: break-all;
    background: rgba(0, 0, 0, 0.15);
    padding: 4px;
    border-radius: 4px;
    color: #a9b2c3;
}

.network-json-block {
    margin: 2px 0;
    background: #141416;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 6px;
    max-height: 150px;
    overflow-y: auto;
    font-family: var(--md-sys-font-mono, monospace);
    font-size: 9px;
    color: #f8f8f2;
    white-space: pre-wrap;
    line-height: 1.3;
}

.network-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: var(--md-sys-spacing-2);
}

.network-action-btn {
    font-size: 9px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.03);
    color: var(--md-sys-color-on-surface);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.network-action-btn:hover {
    background: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
    color: white;
}

.network-action-btn.secondary {
    border-color: rgba(80, 250, 123, 0.2);
    color: #50fa7b;
}

.network-action-btn.secondary:hover {
    background: rgba(80, 250, 123, 0.15);
    color: #50fa7b;
    border-color: #50fa7b;
}

.network-action-btn.tertiary {
    border-color: rgba(189, 147, 249, 0.2);
    color: #bd93f9;
}

.network-action-btn.tertiary:hover {
    background: rgba(189, 147, 249, 0.15);
    color: #bd93f9;
    border-color: #bd93f9;
}

.network-action-btn.danger {
    border-color: rgba(255, 85, 85, 0.2);
    color: #ff5555;
    background: rgba(255, 85, 85, 0.05);
}

.network-action-btn.danger:hover {
    background: rgba(255, 85, 85, 0.15);
    color: #ff5555;
    border-color: #ff5555;
}

/* Scrolling isolation and layout rules */
#view-network {
    overflow: hidden !important;
    height: 100% !important;
    display: none;
    flex-direction: column;
    padding-bottom: 0 !important;
}

#view-network.active {
    display: flex !important;
}

#network-logs-container {
    flex: 1 !important;
    overflow-y: auto !important;
    max-height: none !important;
    padding-bottom: 24px;
}
