/**
 * Supplier Sidebar Buttons Component Styles
 * Vertical sidebar with icon-only buttons on supplier detail page
 * 
 * @version 1.0.0
 * @date 2025-01-XX
 */

/* ============================================
   SIDEBAR WRAPPER
   ============================================ */
.supplier-sidebar-buttons {
    position: fixed;
    bottom: 140px;
    right: 0;
    z-index: 998; /* Lower than helper panel (999) */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none; /* Allow clicks to pass through wrapper */
}

/* ============================================
   SIDEBAR BORDER (Dotted left border)
   ============================================ */
.supplier-sidebar-buttons__border {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    pointer-events: none;
}

/* ============================================
   BUTTONS LIST
   ============================================ */
.supplier-sidebar-buttons__list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 6px 0 0 6px;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.08);
    pointer-events: auto; /* Enable clicks on buttons */
}

/* ============================================
   INDIVIDUAL BUTTON
   ============================================ */
.supplier-sidebar-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 10px;
    border: none;
    border-radius: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08); /* Light separator line */
    background: transparent;
    color: #1f2937;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: visible;
}

/* Remove border from last button */
.supplier-sidebar-button:last-child {
    border-bottom: none;
}

.supplier-sidebar-button:hover {
    background: rgba(16, 141, 82, 0.08);
    color: var(--color-primary, #108D52);
}

.supplier-sidebar-button:active {
    background: rgba(16, 141, 82, 0.12);
}

.supplier-sidebar-button:focus {
    outline: none;
}

/* ============================================
   BUTTON ICON
   ============================================ */
.supplier-sidebar-button__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    transition: color 0.2s ease;
}

.supplier-sidebar-button__svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    stroke: currentColor;
    transition: color 0.2s ease;
}

.supplier-sidebar-button:hover .supplier-sidebar-button__svg {
    color: var(--color-primary, #108D52); /* Primary color on hover */
}

/* Helper icon (text "?") inside sidebar button */
.supplier-sidebar-button .helper-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
    color: currentColor;
    transition: color 0.2s ease;
}

.supplier-sidebar-button:hover .helper-icon {
    color: var(--color-primary, #108D52); /* Primary color on hover */
}

/* ============================================
   TOOLTIP
   ============================================ */
.supplier-sidebar-button__tooltip {
    position: absolute;
    right: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: #1f2937;
    color: #ffffff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Tooltip arrow */
.supplier-sidebar-button__tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: #1f2937;
    margin-left: -1px; /* Close the gap between tooltip and arrow */
}

.supplier-sidebar-button:hover .supplier-sidebar-button__tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .supplier-sidebar-buttons {
        /* Slightly adjust position on tablets */
        bottom: 120px;
        right: -4px;
    }
    
    .supplier-sidebar-buttons__list {
        padding: 10px 6px;
        gap: 0;
    }
    
    .supplier-sidebar-button {
        width: 36px;
        height: 36px;
        padding: 6px;
    }
    
    .supplier-sidebar-button__svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 768px) {
    /* Hide sidebar on mobile to avoid clutter */
    .supplier-sidebar-buttons {
        display: none;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.supplier-sidebar-button:focus-visible {
    outline: none;
}

/* Ensure tooltip is readable */
@media (prefers-reduced-motion: reduce) {
    .supplier-sidebar-button,
    .supplier-sidebar-button__icon,
    .supplier-sidebar-button__svg,
    .supplier-sidebar-button__tooltip {
        transition: none;
    }
}

/* ============================================
   HIGH CONTRAST MODE SUPPORT
   ============================================ */
@media (prefers-contrast: high) {
    .supplier-sidebar-button {
        border-bottom-width: 1px;
    }
}
