/* PURE TRIANGLE ARROW - Correct direction: RIGHT when collapsed, DOWN when expanded */

/* AGGRESSIVELY HIDE ALL FONT AWESOME ICONS */
.catalog-toggle-btn i,
.expand-collapse-btn i,
button.catalog-toggle-btn i,
button.expand-collapse-btn i,
button.catalog-toggle-btn::after,
button.expand-collapse-btn::after {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    font-size: 0 !important;
    line-height: 0 !important;
    content: none !important;
}

/* RESET BUTTON */
.catalog-toggle-btn,
.expand-collapse-btn,
button.catalog-toggle-btn,
button.expand-collapse-btn {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    padding: 0 !important;
    margin: 0 !important;
    
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    
    cursor: pointer !important;
    transition: transform 0.25s ease !important;
    font-size: 0 !important;
    line-height: 0 !important;
    text-indent: -9999px !important;
}

/* PURE CSS TRIANGLE - DEFAULT RIGHT arrow (collapsed) */
.catalog-toggle-btn::before,
.expand-collapse-btn::before {
    content: '' !important;
    position: absolute !important;
    
    width: 0 !important;
    height: 0 !important;
    border-top: 4px solid transparent !important;
    border-bottom: 4px solid transparent !important;
    border-left: 6px solid #6b7280 !important;
    
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    
    transition: transform 0.25s ease, border-color 0.25s ease !important;
}

/* EXPANDED STATE - ARROW POINTS DOWN (rotate 90 degrees clockwise) */
.catalog-toggle-btn[aria-expanded="true"]::before,
.expand-collapse-btn[aria-expanded="true"]::before,
tr[aria-expanded="true"] .catalog-toggle-btn::before,
tr[aria-expanded="true"] .expand-collapse-btn::before,
tr[data-expanded="true"] .catalog-toggle-btn::before,
tr[data-expanded="true"] .expand-collapse-btn::before {
    transform: translate(-50%, -50%) rotate(90deg) !important;
    border-left-color: #0066ff !important;
}

/* COLLAPSED STATE - ARROW POINTS RIGHT */
.catalog-toggle-btn[aria-expanded="false"]::before,
.expand-collapse-btn[aria-expanded="false"]::before,
tr[aria-expanded="false"] .catalog-toggle-btn::before,
tr[aria-expanded="false"] .expand-collapse-btn::before,
tr[data-expanded="false"] .catalog-toggle-btn::before,
tr[data-expanded="false"] .expand-collapse-btn::before {
    transform: translate(-50%, -50%) !important;
    border-left-color: #6b7280 !important;
}

/* HOVER STATE - Scale up */
.catalog-toggle-btn:hover,
.expand-collapse-btn:hover,
button.catalog-toggle-btn:hover,
button.expand-collapse-btn:hover {
    transform: scale(1.2) !important;
}

.catalog-toggle-btn:hover::before,
.expand-collapse-btn:hover::before {
    border-left-color: #0066ff !important;
}

/* ACTIVE STATE - Scale down */
.catalog-toggle-btn:active,
.expand-collapse-btn:active {
    transform: scale(0.9) !important;
}

/* PHASE ROW ORANGE THEME */
.phase-row .catalog-toggle-btn::before,
.phase-row .expand-collapse-btn::before,
tr.catalog-phase-row .catalog-toggle-btn::before,
tr.catalog-phase-row .expand-collapse-btn::before {
    border-left-color: #ea580c !important;
}

.phase-row .catalog-toggle-btn[aria-expanded="true"]::before,
.phase-row .expand-collapse-btn[aria-expanded="true"]::before,
tr.catalog-phase-row tr[aria-expanded="true"] .catalog-toggle-btn::before,
tr.catalog-phase-row tr[aria-expanded="true"] .expand-collapse-btn::before {
    border-left-color: #fb923c !important;
}

.phase-row .catalog-toggle-btn:hover::before,
.phase-row .expand-collapse-btn:hover::before,
tr.catalog-phase-row .catalog-toggle-btn:hover::before,
tr.catalog-phase-row .expand-collapse-btn:hover::before {
    border-left-color: #fb923c !important;
}

/* COST CENTER ROW ORANGE THEME (matching Phase) */
.cc-row .catalog-toggle-btn::before,
.cc-row .expand-collapse-btn::before,
tr.catalog-cc-row .catalog-toggle-btn::before,
tr.catalog-cc-row .expand-collapse-btn::before {
    border-left-color: #ea580c !important;
}

.cc-row .catalog-toggle-btn[aria-expanded="true"]::before,
.cc-row .expand-collapse-btn[aria-expanded="true"]::before,
tr.catalog-cc-row tr[aria-expanded="true"] .catalog-toggle-btn::before,
tr.catalog-cc-row tr[aria-expanded="true"] .expand-collapse-btn::before {
    border-left-color: #fb923c !important;
}

.cc-row .catalog-toggle-btn:hover::before,
.cc-row .expand-collapse-btn:hover::before,
tr.catalog-cc-row .catalog-toggle-btn:hover::before,
tr.catalog-cc-row .expand-collapse-btn:hover::before {
    border-left-color: #fb923c !important;
}

/* DARK MODE */
[data-theme="dark"] .catalog-toggle-btn::before,
[data-theme="dark"] .expand-collapse-btn::before {
    border-left-color: #d1d5db !important;
}

[data-theme="dark"] .catalog-toggle-btn[aria-expanded="true"]::before,
[data-theme="dark"] .expand-collapse-btn[aria-expanded="true"]::before {
    border-left-color: #FFB800 !important;
}

[data-theme="dark"] .catalog-toggle-btn:hover::before,
[data-theme="dark"] .expand-collapse-btn:hover::before {
    border-left-color: #FFB800 !important;
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
    .catalog-toggle-btn,
    .catalog-toggle-btn::before,
    .expand-collapse-btn,
    .expand-collapse-btn::before {
        transition: none !important;
    }
}
