/* app/styles/components/panels.css */

/* Generic Sidebar Styles */
.sidebar-toggle-btn {
    padding: var(--md-sys-spacing-4) 0;
    cursor: pointer;
    opacity: 0.6;
    width: 100%;
    color: var(--md-sys-color-on-surface);
    transition: opacity 0.2s, background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 10px;
    box-sizing: border-box;
    border-left: 3px solid transparent;
    margin-bottom: var(--md-sys-spacing-4);
}

.sidebar-toggle-btn:hover {
    opacity: 1;
    background-color: var(--md-sys-color-surface-hover);
}

.sidebar-toggle-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.sidebar-items-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    flex: 1;
}
.sidebar-items-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari/Edge */
}

.sidebar-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: var(--md-sys-spacing-4) 0;
    padding-left: 10px;
    cursor: pointer;
    font-size: 20px;
    opacity: 0.6;
    width: 100%;
    color: var(--md-sys-color-on-surface);
    transition: opacity 0.2s, border-left-color 0.2s, background-color 0.2s;
    border-left: 3px solid transparent; /* Prepare for active border */
    box-sizing: border-box;
}

.sidebar-item:hover, .sidebar-item.active {
    opacity: 1;
    border-left-color: var(--md-sys-color-primary);
    background-color: var(--md-sys-color-surface-hover);
}

.sidebar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.sidebar-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.sidebar-label {
    display: none;
    font-size: var(--md-sys-typescale-body-large);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-left: var(--md-sys-spacing-3);
    user-select: none;
    font-weight: 500;
}

#sidebar.expanded .sidebar-label {
    display: block;
}

/* Panel Header Headings (H4s) */
.view-content h4 {
    margin-top: 0;
    margin-bottom: var(--md-sys-spacing-4);
    font-size: var(--md-sys-typescale-title-small);
    text-transform: uppercase;
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 500;
}

/* Console and Problem Lists */
.log-entry {
    margin-bottom: var(--md-sys-spacing-2);
    border-bottom: 1px solid var(--md-sys-color-surface-hover);
    padding-bottom: var(--md-sys-spacing-1);
    word-break: break-all;
}

.log-entry.system { color: #569cd6; } /* VS Code Blue */
.log-entry.info { color: #9cdcfe; }
.log-entry.error { color: var(--md-sys-color-error); }
.log-entry.success { color: var(--md-sys-color-success); }

#problems-list .problem-item {
    display: flex;
    align-items: flex-start;
    gap: var(--md-sys-spacing-3);
    padding: var(--md-sys-spacing-2) var(--md-sys-spacing-4);
    font-size: var(--md-sys-typescale-body-large);
    cursor: pointer;
    border-bottom: 1px solid var(--md-sys-color-outline);
}
#problems-list .problem-item:hover { background: var(--md-sys-color-surface-hover); }
#problems-list .problem-severity-error { color: var(--md-sys-color-error); }
#problems-list .problem-severity-warning { color: #ffb86c; } /* Dracula warning */
#problems-list .problem-loc { color: var(--md-sys-color-on-surface-variant); font-size: var(--md-sys-typescale-body-medium); margin-left: auto; }

/* Cloud Hierarchy / API View Inputs */
.cloud-input, .cloud-select, .api-select, .api-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    color: var(--md-sys-color-on-surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: var(--md-sys-spacing-2) var(--md-sys-spacing-3);
    margin-top: var(--md-sys-spacing-2);
    font-size: var(--md-sys-typescale-body-large);
    border-radius: var(--md-sys-shape-corner-medium);
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.cloud-input:focus, .cloud-select:focus, .api-select:focus, .api-search-input:focus {
    border-color: rgba(25, 127, 230, 0.6);
    background-color: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 8px rgba(25, 127, 230, 0.25);
    outline: none;
}

/* Hierarchy List Items (Cloud / API) */
.cloud-list {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid var(--md-sys-color-outline);
    background: var(--md-sys-color-surface);
    margin-top: var(--md-sys-spacing-2);
    width: 100%;
    border-radius: var(--md-sys-shape-corner-extra-small);
}

.cloud-file-item {
    padding: var(--md-sys-spacing-2);
    font-size: var(--md-sys-typescale-body-medium);
    cursor: pointer;
    border-bottom: 1px solid var(--md-sys-color-surface-hover);
}
.cloud-file-item:hover {
    background: var(--md-sys-color-surface-hover);
}
.cloud-file-item.active {
    background: var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-tertiary);
}

/* Tree View Common Styles */
.tree-node {
    margin-left: var(--md-sys-spacing-4);
    border-left: 1px solid var(--md-sys-color-outline-variant);
    position: relative;
}

.tree-label {
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px var(--md-sys-spacing-2);
    border-radius: var(--md-sys-shape-corner-small);
    transition: background 0.1s;
}

.tree-label:hover {
    background: var(--md-sys-color-surface-hover);
    color: var(--md-sys-color-primary);
}

.tree-key { color: #9cdcfe; }
.tree-val { color: #ce9178; }
.tree-type {
    color: #569cd6;
    font-size: var(--md-sys-typescale-body-small);
    opacity: 0.6;
    margin-left: var(--md-sys-spacing-3);
}

/* AI Agent Specifics */
.chat-msg {
    padding: var(--md-sys-spacing-3);
    border-radius: var(--md-sys-shape-corner-small);
    max-width: 90%;
    word-break: break-word;
}
.chat-msg.user {
    background-color: var(--md-sys-color-primary);
    align-self: flex-end;
    color: var(--md-sys-color-on-primary);
}
.chat-msg.ai {
    background-color: var(--md-sys-color-surface-hover);
    align-self: flex-start;
    border: 1px solid var(--md-sys-color-outline-variant);
}

.ai-input-area {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-2);
    padding: var(--md-sys-spacing-2);
    background: var(--md-sys-color-surface-variant);
    border-top: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
}

.ai-input-area textarea {
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    padding: var(--md-sys-spacing-2);
    resize: none;
    min-height: 60px;
    font-family: inherit;
    border-radius: var(--md-sys-shape-corner-extra-small);
}

.ai-input-area textarea:focus {
    border-color: var(--md-sys-color-primary);
    outline: none;
}

/* Progress bar */
.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    overflow: hidden;
}
.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: var(--md-sys-color-tertiary);
    transition: width 0.3s ease;
}
