/* ============================================================
   ADJ HIGHLIGHT PANEL - Glassmorphism Design
   Extends unified-panel-design.css with Adj-specific styling
   ============================================================ */

/* Position panel with relative positioning for stacking behavior - No gaps */
#adjHighlightPanelContainer {
    position: relative;
    width: 100%;
    margin-bottom: 0;
    background: var(--glass-bg-primary);
    border: 2px solid rgba(156, 39, 176, 0.3);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow),
                0 0 40px var(--adj-glow);
    font-family: var(--font-body);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    overflow: hidden;

    /* Adj-specific custom properties */
    --panel-primary: var(--adj-primary);
    --panel-secondary: var(--adj-secondary);
    --panel-glow: var(--adj-glow);
}

#adjHighlightPanelContainer:hover {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6),
                0 0 60px var(--adj-glow);
    border-color: rgba(156, 39, 176, 0.5);
    transform: translateY(-2px);
}

/* Panel header styling - Glassmorphism with shimmer effect */
#adjHighlightPanelContainer .panel-header {
    background: linear-gradient(135deg,
        rgba(156, 39, 176, 0.25),
        rgba(142, 36, 170, 0.15));
    padding: var(--spacing-lg) var(--spacing-xl);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(156, 39, 176, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#adjHighlightPanelContainer .panel-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(156, 39, 176, 0.2),
        transparent);
    transition: left 0.5s ease;
}

#adjHighlightPanelContainer .panel-header:hover::before {
    left: 100%;
}

#adjHighlightPanelContainer .panel-header:hover {
    background: linear-gradient(135deg,
        rgba(156, 39, 176, 0.35),
        rgba(142, 36, 170, 0.25));
    border-bottom-color: rgba(156, 39, 176, 0.5);
}

#adjHighlightPanelContainer .panel-header h3 {
    margin: 0;
    background: linear-gradient(135deg, #9C27B0, #AB47BC);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: var(--font-title);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 0 20px var(--adj-glow);
    flex: 1;
}

/* Panel header controls (toggle + close button) */
#adjHighlightPanelContainer .panel-header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

#adjHighlightPanelContainer .toggle-icon {
    color: #8E24AA;
    font-size: 16px;
    font-weight: bold;
    transition: transform 0.3s ease;
}

#adjHighlightPanelContainer .close-icon {
    color: #ff5252;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

#adjHighlightPanelContainer .close-icon:hover {
    transform: rotate(90deg) scale(1.2);
    color: #ff1744;
}

/* Panel content styling - Enhanced spacing with smart scrollbar */
#adjHighlightPanelContainer .panel-content {
    padding: 18px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* Panel buttons styling - Single row flex layout */
.adj-panel-buttons {
    display: flex;
    gap: 4px;
    margin-bottom: var(--spacing-lg);
}

.adj-panel-buttons button {
    padding: 6px 8px;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: relative;
    overflow: visible;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
    min-width: 0;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Primary action buttons - larger */
#highlightAdjButton,
#resetAdjButton {
    flex: 1.3;
    font-size: 12px;
    padding: 8px 10px;
}

/* Secondary action buttons - smaller, allow two lines */
#refreshAdjDataButton,
#unselectAdjDropdownsButton {
    flex: 1;
    font-size: 10px;
    padding: 6px 6px;
    line-height: 1.2;
}

.adj-panel-buttons button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.adj-panel-buttons button:hover::before {
    width: 300px;
    height: 300px;
}

.adj-panel-buttons button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

.adj-panel-buttons button:active {
    transform: translateY(0);
}

.adj-panel-buttons button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Individual Button Themes */
#highlightAdjButton {
    background: linear-gradient(135deg, var(--success), #388E3C);
    border-color: var(--success);
    color: white;
}

#highlightAdjButton:hover:not(:disabled) {
    box-shadow: 0 6px 24px rgba(76, 175, 80, 0.5);
}

#resetAdjButton {
    background: linear-gradient(135deg, var(--error), #D32F2F);
    border-color: var(--error);
    color: white;
}

#resetAdjButton:hover:not(:disabled) {
    box-shadow: 0 6px 24px rgba(244, 67, 54, 0.5);
}

#refreshAdjDataButton {
    background: linear-gradient(135deg, var(--info), #1976D2);
    border-color: var(--info);
    color: white;
}

#refreshAdjDataButton:hover:not(:disabled) {
    box-shadow: 0 6px 24px rgba(33, 150, 243, 0.5);
}

#unselectAdjDropdownsButton {
    background: linear-gradient(135deg, var(--warning), #F57C00);
    border-color: var(--warning);
    color: white;
}

#unselectAdjDropdownsButton:hover:not(:disabled) {
    box-shadow: 0 6px 24px rgba(255, 152, 0, 0.5);
}

/* Dropdown sections - Enhanced styling */
.dropdown-section {
    margin-bottom: 18px;
}

.dropdown-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: #8E24AA;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.dropdown-section select {
    width: 100%;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.08));
    color: #fff;
    border: 1.5px solid rgba(0, 172, 193, 0.4);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.dropdown-section select:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.12));
    border-color: rgba(0, 172, 193, 0.6);
    box-shadow: 0 2px 8px rgba(0, 172, 193, 0.2);
}

.dropdown-section select:focus {
    outline: none;
    border-color: rgba(0, 172, 193, 0.8);
    box-shadow: 0 0 12px rgba(0, 172, 193, 0.4);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.15));
}

.dropdown-section select:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.dropdown-section select option {
    background: #2a2a2a;
    color: #fff;
    padding: 8px;
}

/* Dropdown info text - Enhanced */
.dropdown-info {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 6px;
    font-style: italic;
    padding-left: 4px;
}

/* Adj summary section */
#adjSummary {
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-info {
    font-size: 11px;
    color: #ccc;
    text-align: center;
}

/* Loading states */
.loading-dropdown {
    background: rgba(255, 255, 0, 0.1) !important;
    border-color: rgba(255, 255, 0, 0.5) !important;
}

.error-dropdown {
    background: rgba(255, 0, 0, 0.1) !important;
    border-color: rgba(255, 0, 0, 0.5) !important;
}

/* Scrollbar styling - Cyan theme to match panel */
#adjHighlightPanelContainer .panel-content::-webkit-scrollbar {
    width: 8px;
}

#adjHighlightPanelContainer .panel-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

#adjHighlightPanelContainer .panel-content::-webkit-scrollbar-thumb {
    background: linear-gradient(145deg,
        rgba(156, 39, 176, 0.6),
        rgba(142, 36, 170, 0.6));
    border-radius: 4px;
    border: 1px solid rgba(156, 39, 176, 0.3);
}

#adjHighlightPanelContainer .panel-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(145deg,
        rgba(156, 39, 176, 0.8),
        rgba(142, 36, 170, 0.8));
    box-shadow: 0 0 12px rgba(156, 39, 176, 0.5);
}

/* Responsive adjustments - Inherited from rightPanelsContainer */
@media (max-width: 768px) {
    #adjHighlightPanelContainer .panel-header h3 {
        font-size: 15px;
    }

    #adjHighlightPanelContainer .panel-content {
        padding: 15px;
    }

    .dropdown-section {
        margin-bottom: 12px;
    }

    .adj-panel-buttons {
        gap: 8px;
    }
}

    .adj-panel-buttons {
        gap: 6px;
        margin-bottom: 12px;
    }
}

/* Animation for panel appearance */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

#adjHighlightPanelContainer {
    animation: slideInFromRight 0.3s ease-out;
}

/* Empty state styling */
.no-adj-data {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 20px;
    font-size: 12px;
}

/* Success state for dropdown */
.success-dropdown {
    background: rgba(0, 255, 0, 0.1) !important;
    border-color: rgba(0, 255, 0, 0.5) !important;
}

/* Highlight effect for active selections */
.active-selection {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6) !important;
}

/* Location List View Styles */
#adjLocationsList {
    margin-top: 15px;
    display: block !important;
    visibility: visible !important;
}

#adjLocationsList .list-header {
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#adjLocationsList .list-header label {
    font-weight: bold;
    color: #fff;
    font-size: 13px;
}

.list-controls {
    display: flex;
    gap: 5px;
}

.select-all-btn, .deselect-all-btn {
    padding: 3px 8px;
    font-size: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.select-all-btn:hover, .deselect-all-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.location-list-view {
    max-height: 200px;
    min-height: 50px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 8px;
    display: block !important;
    visibility: visible !important;
}

/* Empty state for list */
.location-list-view .list-empty {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 20px;
    font-size: 11px;
}

/* Location item in list */
.location-list-item {
    padding: 6px 8px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    font-size: 11px;
    color: #fff;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.location-list-item input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.location-list-item .location-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.location-list-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateX(2px);
}

.location-list-item .location-code {
    font-weight: bold;
    color: #4FC3F7;
}

.location-list-item .location-details {
    display: flex;
    gap: 10px;
    font-size: 10px;
    color: #aaa;
}

.location-list-item .location-qty {
    color: #81C784;
    font-weight: bold;
}

/* Loading state for list */
.location-list-view.loading {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffeb3b;
}

/* Scrollbar styling for location list */
.location-list-view::-webkit-scrollbar {
    width: 6px;
}

.location-list-view::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.location-list-view::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.location-list-view::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}