:root {
    --background-color: #1a1a1a;
    --surface-color: #2c2c2c;
    --primary-color: #1a73e8;
    --text-color: #e0e0e0;
    --text-muted-color: #d0d0d0;
    --border-color: #444;
    --success-color: #4caf50;
    --error-color: #f44336;
    scrollbar-width: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tab-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.card {
    background-color: var(--surface-color);
    border-radius: 8px;
    padding: 10px;
    border: 1px solid var(--border-color);
}

h2 {
    margin-top: 0;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    font-size: 1.2em;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px;
}

label {
    font-weight: 500;
    color: var(--text-muted-color);
    flex-shrink: 0;
}

select, input[type="text"], input[type="number"] {
    width: 100%;
    max-width: 800px;
    background-color: var(--background-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 1em;
}

input[type="range"] {
    width: 100%;
    max-width: 500px;
    background-color: var(--background-color);
    color: var(--text-color);
    /*padding: 8px 12px;*/
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: 500;
}

button:hover {
    background-color: #5a7dff;
}

button.secondary {
    background-color: #4a4a4a;
}

button.secondary:hover {
    background-color: #5a5a5a;
}

button.danger {
    background-color: var(--error-color);
}

button.danger:hover {
    background-color: #d32f2f;
}

/* ========================================================= */
/* === IMPROVED TOOLTIP STYLES (VERSION 2 - PRESERVES HTML) === */
/* ========================================================= */

/* Main container for any element that triggers a tooltip */
/* Add directional classes here (e.g., class="tooltip tooltip-right") */
.tooltip,
.tooltip-indicator {
    position: relative; /* Essential for positioning the tooltip text */
    display: inline-block;
    cursor: help;
}

/* The actual tooltip text box */
.tooltip .tooltiptext,
.tooltip-indicator .tooltiptext {
    /* Visibility & Animation */
    visibility: hidden;
    opacity: 0;
    transform: translateY(4px); /* Start slightly lower for a subtle lift effect */
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    pointer-events: none;

    /* Themed Appearance */
    background-color: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);

    /* Text & Sizing */
    text-align: left;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;

    /* Positioning */
    position: absolute;
    z-index: 10;
    width: max-content;
    max-width: 240px;
}


/* --- Show the tooltip on hover/focus --- */
/* Using :focus-within for better accessibility */
.tooltip:hover .tooltiptext,
.tooltip:focus-within .tooltiptext,
.tooltip-indicator:hover .tooltiptext,
.tooltip-indicator:focus-within .tooltiptext {
    visibility: visible;
    opacity: 1;
    transform: translateY(0); /* Move to final position */
    pointer-events: auto;
}


/* --- Directional Modifier Classes --- */

/* TOP (Default Position) */
.tooltip:not([class*="tooltip-"]) .tooltiptext,
.tooltip-indicator:not([class*="tooltip-"]) .tooltiptext,
.tooltip.tooltip-top .tooltiptext,
.tooltip-indicator.tooltip-top .tooltiptext {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px; /* Space between trigger and tooltip */
}

.tooltip:not([class*="tooltip-"]) .tooltiptext::after,
.tooltip-indicator:not([class*="tooltip-"]) .tooltiptext::after,
.tooltip.tooltip-top .tooltiptext::after,
.tooltip-indicator.tooltip-top .tooltiptext::after {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-color: var(--surface-color) transparent transparent transparent;
}


/* BOTTOM */
.tooltip.tooltip-bottom .tooltiptext,
.tooltip-indicator.tooltip-bottom .tooltiptext {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
}

.tooltip.tooltip-bottom .tooltiptext::after,
.tooltip-indicator.tooltip-bottom .tooltiptext::after {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-color: transparent transparent var(--surface-color) transparent;
}


/* RIGHT */
.tooltip.tooltip-right .tooltiptext,
.tooltip-indicator.tooltip-right .tooltiptext {
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    margin-left: 8px;
}

.tooltip.tooltip-right .tooltiptext::after,
.tooltip-indicator.tooltip-right .tooltiptext::after {
    top: 50%;
    right: 100%;
    transform: translateY(-50%);
    border-color: transparent var(--surface-color) transparent transparent;
}


/* LEFT */
.tooltip.tooltip-left .tooltiptext,
.tooltip-indicator.tooltip-left .tooltiptext {
    top: 50%;
    right: 100%;
    transform: translateY(-50%);
    margin-right: 8px;
}

.tooltip.tooltip-left .tooltiptext::after,
.tooltip-indicator.tooltip-left .tooltiptext::after {
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    border-color: transparent transparent transparent var(--surface-color);
}

.collapsible-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#extra-debug-content {
    margin-top: 15px;
}

#dynamic-size-display {
    font-size: 16px;
    margin-left: 10px;
    color: var(--primary-color);
}

/* Styles for the status buttons */
.status-button {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Align icon and text to the start */
    gap: 0.75rem; /* Space between icon and text */
    font-weight: 500; /* Lighter font weight for a modern look */
    color: var(--text-color); /* Use the text color from your root variables */
    border: 1px solid var(--border-color); /* Use the border color from your root variables */
    border-radius: 8px; /* Slightly less rounded corners to match .card */
    padding: 10px 15px; /* Adjust padding for better look */
    transition: all 0.2s ease-in-out; /* Smooth transitions for all properties */
    cursor: default; /* Still not clickable directly */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Softer initial shadow */
    width: 100%; /* Take full width of its container (e.g., grid cell) */
}

/* Ensure the .card class styles are applied */
.status-button.card {
    background-color: var(--surface-color);
}

.status-button .icon {
    font-size: 1.4em; /* Slightly adjusted size relative to parent font size */
    flex-shrink: 0; /* Prevent icon from shrinking */
}

.status-button span:last-child {
    flex-grow: 1; /* Allow the status text to take available space */
    text-align: right; /* Align status text to the right */
    /*color: #b0b0b0; !* Slightly less muted color for the status text *!*/
    color: var(--text-muted-color); /* Muted color for the status text */
}

.status-button.green {
    background-color: var(--success-color); /* Use success color from root */
    border-color: var(--success-color);
    color: white; /* Ensure text is white on success background */
}

.status-button.red {
    background-color: var(--error-color); /* Use error color from root */
    border-color: var(--error-color);
    color: white; /* Ensure text is white on error background */
}

.status-button.neutral {
    background-color: var(--primary-color); /* Use primary color for neutral */
    border-color: var(--primary-color);
    color: white; /* Ensure text is white on primary background */
}

/* Hover effects for a more modern feel */
.status-button:hover {
    transform: translateY(-2px); /* Slight lift */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3); /* More pronounced shadow on hover */
    border-color: var(--primary-color); /* Highlight border on hover */
}

/* Active state for a pressed look */
.status-button:active {
    transform: translateY(0); /* Return to original position */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Restore original shadow */
}

/* Tooltip text remains styled by the .tooltip class */
.status-button:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.collapsible-header {
    cursor: pointer;
    user-select: none; /* Prevents text selection on click */
}
.arrow-icon {
    float: right;
    font-style: normal;
}

/* For WebKit browsers (Chrome, Safari, Edge, etc.) */
#terminal-container::-webkit-scrollbar {
    display: none; /* Hides the scrollbar */
}

/* For Firefox */
#terminal-container {
    scrollbar-width: none; /* Hides the scrollbar */
}

/* For Internet Explorer and older Edge */
#terminal-container {
    -ms-overflow-style: none; /* Hides the scrollbar */
}
