/**
 * new-toolbox.css
 * Purpose: Styling for the new simplified toolbox (v1.26.10)
 * Contains: Tool buttons, attribute panels, responsive layout
 */

/* New Toolbox Main Section */
.new-toolbox-section {
    width: 100%;
}

/* Toolbox Title - Match actions panel styling */
.new-toolbox-section .form-label {
    background: transparent;
    color: var(--helisite-off-white) !important;
    padding: 0.4rem 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 2px;
    display: block;
}

/* Tool Selection Grid */
.new-toolbox-tools {
    display: grid !important;
    grid-auto-flow: row;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

/* Ensure tool buttons are always visible (override any hidden classes) */
.new-toolbox-tools button {
    display: block !important;
    visibility: visible !important;
    width: 100%;
}

/* Tool Selection Buttons */
.new-toolbox-tools .new-tool-btn {
    font-size: 0.75rem;
    padding: 0.5rem 0.5rem;
    transition: all 0.2s ease;
}

.new-toolbox-tools .new-tool-btn:not(.active) {
    opacity: 0.7;
}

.new-toolbox-tools .new-tool-btn.active {
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.25);
    font-weight: 600;
}

.new-toolbox-tools .new-tool-btn i {
    font-size: 0.9rem;
}

/* Attributes Panel Container - Match actions panel background */
.new-toolbox-attributes {
    margin-top: 0.5rem;
    background: var(--helisite-off-white);
    border: 1px solid var(--helisite-blue-black);
    border-radius: 2px;
    overflow: hidden;
}

/* Wrapper div inside attributes panel */
.new-toolbox-attributes .border {
    border: none !important;
    background: var(--helisite-off-white) !important;
    padding: 0.35rem !important;
    margin: 0 !important;
    border-radius: 0 !important;
}

/* Tool attribute heading - Match blue panel styling */
.new-toolbox-attributes h6 {
    /* background: #5B6F86 !important; */
    color: var(--helisite-blue-black) !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
    margin: 0 0 0.35rem 0 !important;
    /* padding: 0.3rem 0.35rem !important; */
    border: none !important;
}

/* Override Bootstrap text-muted class */
.new-toolbox-attributes h6.text-muted {
    color: var(--helisite-blue-black) !important;
}

.new-toolbox-attributes .p-2 {
    padding: 0.75rem !important;
}

/* Individual tool attribute panel */
.tool-attributes {
    display: none;
}

/* Attribute rows - 2 column grid layout (label | value) */
.tool-attributes .attr-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    margin-bottom: 0.15rem;
    align-items: flex-start;
}

/* Individual column in attribute row */
.tool-attributes .attr-col {
    display: flex;
    align-items: center;
}

/* Attribute label column - right-aligned */
.tool-attributes .attr-label {
    justify-content: flex-start;
    padding-right: 0.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--helisite-blue-black) !important;
    line-height: 1.2;
}

/* Attribute value column */
.tool-attributes .attr-value {
    justify-content: flex-end;
}

/* Tool attribute form groups */
.tool-attributes .form-group {
    margin-bottom: 0;
}

.tool-attributes .form-label-sm {
    font-size: 0.65rem;
    font-weight: 600;
    margin-bottom: 0.1rem;
    color: var(--helisite-blue-black) !important;
    line-height: 1;
}

.tool-attributes .form-control-sm,
.tool-attributes .form-select-sm {
    font-size: 0.7rem;
    height: 1.5rem;
    padding: 0.2rem 0.35rem;
}

.tool-attributes .form-control-sm {
    border-radius: 0.25rem;
    border: 1px solid var(--helisite-blue-black);
    cursor: pointer;
}

.tool-attributes .form-control-sm:focus {
    border-color: var(--helisite-mid-teal);
    box-shadow: 0 0 0 0.15rem rgba(51, 136, 153, 0.2);
}

.tool-attributes .form-select-sm {
    border-radius: 0.25rem;
    border: 1px solid var(--helisite-blue-black);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.3rem center;
    background-size: 0.85rem;
    padding-right: 1.4rem;
    margin-top: 0.1rem !important;
    min-width: 5rem !important;
}

.tool-attributes .form-select-sm:focus {
    border-color: var(--helisite-mid-teal);
    box-shadow: 0 0 0 0.15rem rgba(51, 136, 153, 0.2);
}

.tool-attributes .form-check {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 0;
}

.tool-attributes .line-label-orientation-option {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
}

.tool-attributes .form-check-input {
    width: 0.9rem;
    height: 0.9rem;
    margin: 0;
    cursor: pointer;
    border: 1px solid var(--helisite-blue-black);
    border-radius: 0.2rem;
    flex-shrink: 0;
    padding: 0.7rem;
}

.tool-attributes .form-check-input:checked {
    background-color: var(--helisite-mid-teal);
    border-color: var(--helisite-mid-teal);
}

.tool-attributes .form-check-input:focus {
    border-color: var(--helisite-mid-teal);
    box-shadow: 0 0 0 0.15rem rgba(51, 136, 153, 0.2);
}

.tool-attributes .form-check-label {
    margin-left: 0;
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--helisite-blue-black);
    margin: 0;
    line-height: 1.1;
}

/* Color Pebble Styling */
.tool-attributes .color-pebble-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.tool-attributes .color-pebble {
    width: 5rem !important;
    height: 24px !important;
    min-width: 5rem !important;
    max-width: 5rem !important;
    border: 1px solid var(--helisite-blue-black) !important;
    border-radius: 2px !important;
    cursor: pointer !important;
    padding: 1px !important;
    flex-shrink: 0 !important;
    margin-bottom: 0.1rem !important;
}

.tool-attributes .color-pebble:hover {
    border-color: var(--helisite-mid-teal);
    box-shadow: 0 0 3px rgba(51, 136, 153, 0.3);
}

.tool-attributes .color-pebble:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--helisite-off-white), 0 0 0 3px var(--helisite-mid-teal);
}

/* Tool Preview Canvas */
.tool-attributes .tool-preview {
    background: #cfcfcf;
    border: 1px solid #1a1a1a;
    border-radius: 0.25rem;
    padding: 0.25rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 30px;
    margin-bottom: 0.5rem !important;
}

.tool-attributes .preview-canvas {
    max-width: 100%;
    height: auto;
    display: block;
    border: none;
}

/* Preset Buttons */
.tool-attributes .preset-group {
    margin-bottom: 0.5rem;
}

.tool-attributes .preset-row {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.tool-attributes .preset-btn {
    flex: 1;
    min-width: 60px;
    padding: 0.35rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 600;
    border: 1px solid var(--helisite-blue-black);
    background: white;
    color: var(--helisite-blue-black);
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-attributes .preset-btn:hover {
    background: var(--helisite-mid-teal);
    color: white;
    border-color: var(--helisite-mid-teal);
}

.tool-attributes .preset-btn:active {
    transform: scale(0.98);
}

/* Opacity Controls */
.tool-attributes .opacity-controls {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    width: 100%;
}

.tool-attributes .opacity-slider {
    flex: 1;
    min-width: 60px;
    height: 1.5rem;
    padding: 0;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background: #eee;
    border: 1px solid var(--helisite-blue-black);
    border-radius: 0.25rem;
}

.tool-attributes .opacity-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--helisite-mid-teal);
    border: 1px solid var(--helisite-blue-black);
    border-radius: 50%;
    cursor: pointer;
}

.tool-attributes .opacity-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--helisite-mid-teal);
    border: 1px solid var(--helisite-blue-black);
    border-radius: 50%;
    cursor: pointer;
}

.tool-attributes .opacity-number {
    width: 50px;
    height: 1.5rem;
    padding: 0.2rem 0.35rem;
    font-size: 0.7rem;
    border: 1px solid var(--helisite-blue-black);
    border-radius: 0.25rem;
}

.tool-attributes .opacity-number:focus {
    border-color: var(--helisite-mid-teal);
    box-shadow: 0 0 0 0.15rem rgba(51, 136, 153, 0.2);
}

/* Rotate Buttons */
.tool-rotate-btn {
    padding: 0.35rem 0.5rem !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    border: 1px solid var(--helisite-blue-black) !important;
    background: white !important;
    color: var(--helisite-blue-black) !important;
    border-radius: 0.25rem !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    min-width: 35px !important;
    height: 1.75rem !important;
}

.tool-rotate-btn:hover {
    background: var(--helisite-mid-teal) !important;
    color: white !important;
    border-color: var(--helisite-mid-teal) !important;
}

.tool-rotate-btn:active {
    transform: scale(0.98);
}

.tool-rotate-btn:focus {
    outline: none;
    box-shadow: 0 0 0 0.15rem rgba(51, 136, 153, 0.2) !important;
}

/* Divider */
#newToolbox + .hr-my-2 {
    margin: 1rem 0;
    opacity: 0.5;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .new-toolbox-section {
        margin-bottom: 1.5rem;
    }

    .new-toolbox-tools {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .tool-attributes .form-control-sm,
    .tool-attributes .form-select-sm {
        font-size: 0.75rem;
        height: 1.75rem;
    }
}

/* Dark Theme Support (if applicable) */
@media (prefers-color-scheme: dark) {
    .new-toolbox-attributes .border {
        border-color: var(--helisite-blue-black) !important;
    }

    .new-toolbox-attributes h6 {
        color: var(--helisite-off-white);
        border-bottom-color: var(--helisite-blue-black);
    }

    .tool-attributes .form-label-sm {
        color: var(--helisite-off-white);
    }

    .tool-attributes .form-control-sm,
    .tool-attributes .form-select-sm {
        background-color: var(--helisite-blue-black);
        color: var(--helisite-off-white);
        border-color: var(--helisite-blue-black);
    }

    .tool-attributes .form-check-input {
        background-color: var(--helisite-blue-black);
        border-color: var(--helisite-blue-black);
    }

    .tool-attributes input[type="color"] {
        border-color: var(--helisite-blue-black);
    }

    .tool-attributes input[type="color"]:hover {
        border-color: var(--helisite-blue-black);
    }
}

/* Animation for attribute panel appearance */
.new-toolbox-attributes {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
