/* Styles specific to Manage Tools page */

/* Select Service Section */
.service-section {
    margin-bottom: 18px;
    padding: 12px;
    background: #f3f2f1;
    border: 1px solid #edebe9;
    border-radius: 8px;
}

.section-header {
    background: #edebe9;
    border: 1px solid #e1dfdd;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.service-dropdown-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e1dfdd;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 10px;
}

.service-dropdown {
    flex: 1 1 auto;
    height: 40px;
    border: 1px solid #c8c6c4;
    border-radius: 4px;
    padding: 0 12px;
    font-size: 14px;
    background: #ffffff;
    color: #323130;
}

.refresh-button {
    width: 40px;
    height: 40px;
    border-radius: 4px; /* square-ish */
    border: 1px solid #c7e0f4;
    background: #deecf9;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
    transition: background 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.refresh-button:hover {
    background: #c7e0f4;
    border-color: #7fb3e6;
}

.service-version {
    color: #605e5c;
    font-size: 13px;
    padding: 4px 8px;
    border: 1px solid #edebe9;
    border-radius: 999px;
    background: #ffffff;
    white-space: nowrap;
}

.service-info {
    color: #605e5c;
    font-size: 14px;
    margin-top: 8px;
}

/* Available Tools Section */
.tools-section {
    margin-top: 18px;
    padding: 12px;
    background: #f3f2f1;
    border: 1px solid #edebe9;
    border-radius: 8px;
}

.tools-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #323130;
    margin: 0;
}

.tools-filters {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    background: #ffffff;
    border: 1px solid #e1dfdd;
    border-radius: 6px;
    padding: 10px;
}

.search-bar {
    flex: 1;
    max-width: 300px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid #edebe9;
    border-radius: 4px;
    font-size: 14px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #605e5c;
}

.toggle-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-label {
    font-size: 14px;
    color: #323130;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: #c8c6c4;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-switch.active {
    background: #0078D4;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.2s;
}

.toggle-switch.active::after {
    transform: translateX(20px);
}

/* Tool Cards */
.tools-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tool-card {
    background: white;
    border: 1px solid #e1dfdd;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.tool-card:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.10);
    border-color: #c8c6c4;
}

.tool-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.tool-avatar {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    border: 3px solid #a19f9d;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: hidden;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.tool-avatar.tool-avatar-connecting {
    border-color: #92c353; /* lighter green while connecting */
    box-shadow: 0 0 0 2px rgba(146, 195, 83, 0.22);
}

.tool-avatar.tool-avatar-connected {
    border-color: #107c10; /* Fluent green */
    box-shadow: 0 0 0 2px rgba(16, 124, 16, 0.22);
}

.tool-avatar-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    display: block;
}

.tool-details {
    flex: 1;
}

.tool-name {
    font-weight: 600;
    font-size: 16px;
    color: #323130;
    margin-bottom: 4px;
}

.tool-serial {
    font-size: 14px;
    color: #605e5c;
    margin-bottom: 4px;
}

.tool-kv {
    font-size: 14px;
    color: #605e5c;
    margin-bottom: 2px;
}

.tool-kv-label {
    font-weight: 600;
    color: #605e5c;
}

.tool-kv-value {
    font-weight: 600;
    color: #323130;
}

.tool-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    color: #605e5c;
    margin-top: 2px;
}

.tool-meta-value {
    color: #323130;
    font-weight: 600;
}

.tool-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.tool-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    color: #323130;
    background: #faf9f8;
    border: 1px solid #edebe9;
    border-radius: 999px;
    white-space: nowrap;
}

.tool-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-top: 6px;
    padding: 4px 8px;
    background: #faf9f8;
    border-radius: 4px;
    border: 1px solid #edebe9;
    width: fit-content;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-indicator.connected {
    background-color: #107c10;
    box-shadow: 0 0 6px rgba(16, 124, 16, 0.6);
}

.status-indicator.disconnected {
    background-color: #a19f9d;
}

.status-indicator.loading {
    background-color: #0078d4;
    animation: pulse-dot 1.5s infinite;
}

.status-text {
    color: #323130;
    font-weight: 600;
    font-size: 13px;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.9);
    }
}

.tool-actions {
    display: flex;
    gap: 8px;
}

.tool-actions.tool-actions-seg {
    gap: 0;
}

.tool-actions.tool-actions-seg .tool-button.tool-seg {
    border-color: #0078D4;
    color: #0078D4;
    background: #ffffff;
    border-radius: 0;
    height: 32px;
    padding: 6px 14px;
    line-height: 18px;
}

.tool-actions.tool-actions-seg .tool-button.tool-seg:hover:not(:disabled) {
    background: #f3f9ff;
}

.tool-actions.tool-actions-seg .tool-button.tool-seg + .tool-button.tool-seg {
    margin-left: -1px; /* collapse shared borders */
}

.tool-actions.tool-actions-seg .tool-button.tool-seg:first-child {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.tool-actions.tool-actions-seg .tool-button.tool-seg:last-child {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.tool-actions.tool-actions-seg .tool-button.tool-seg.active {
    background: #0078D4;
    border-color: #0078D4;
    color: #ffffff;
    position: relative;
    z-index: 1;
}

.tool-actions.tool-actions-seg .tool-button.tool-seg:disabled {
    opacity: 0.6;
}

.details-button {
    background-color: #0078d4;
    color: white;
}

.details-button.has-result {
    background-color: #107c10;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Command Interface */
.command-container {
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    border-top: 1px solid #edebe9;
    background: #faf9f8;
    border-radius: 4px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.command-select {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #edebe9;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.command-param {
    flex: 1;
    min-width: 150px;
    padding: 8px 12px;
    border: 1px solid #edebe9;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.send-button {
    padding: 8px 16px;
    white-space: nowrap;
}

/* Floating Button */
.floating-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #7B68EE;
    color: white;
    border: none;
    font-size: 24px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: transform 0.2s, box-shadow 0.2s;
}

.floating-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}
