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

/* Stock Panel Container - Apply unified glass styles + Stock theme */
#stockHighlightPanelContainer {
    /* Inherit base glass panel styles */
    position: relative;
    width: 100%;
    margin-bottom: 0;
    background: var(--glass-bg-primary);
    border: 2px solid rgba(33, 150, 243, 0.3);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow),
                0 0 40px var(--stock-glow);
    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;

    /* Stock-specific custom properties */
    --panel-primary: var(--stock-primary);
    --panel-secondary: var(--stock-secondary);
    --panel-glow: var(--stock-glow);
    --panel-border: rgba(33, 150, 243, 0.3);
    --panel-border-hover: rgba(33, 150, 243, 0.5);
}

#stockHighlightPanelContainer:hover {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6),
                0 0 60px var(--stock-glow);
    border-color: rgba(33, 150, 243, 0.5);
    transform: translateY(-2px);
}

/* Panel Header - Stock Theme */
#stockHighlightPanelContainer .panel-header {
    background: linear-gradient(135deg,
        rgba(33, 150, 243, 0.25),
        rgba(25, 140, 233, 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(33, 150, 243, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

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

#stockHighlightPanelContainer .panel-header:hover {
    background: linear-gradient(135deg,
        rgba(33, 150, 243, 0.35),
        rgba(25, 140, 233, 0.25));
    border-bottom-color: rgba(33, 150, 243, 0.5);
}

#stockHighlightPanelContainer .panel-header h3 {
    margin: 0;
    font-family: var(--font-title);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #2196F3, #64B5F6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px var(--stock-glow);
    flex: 1;
}

/* Header Controls */
#stockHighlightPanelContainer .panel-header-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

#stockHighlightPanelContainer .toggle-icon {
    font-size: 18px;
    color: var(--stock-primary);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 8px var(--stock-glow));
}

#stockHighlightPanelContainer .close-icon {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 8px rgba(244, 67, 54, 0.3));
}

#stockHighlightPanelContainer .close-icon:hover {
    color: var(--error);
    transform: rotate(90deg) scale(1.15);
    filter: drop-shadow(0 0 12px rgba(244, 67, 54, 0.6));
}

/* Panel Content - Smart scrolling to prevent going beyond screen */
#stockHighlightPanelContainer .panel-content {
    padding: 12px 16px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
    font-family: var(--font-body);
    scroll-behavior: smooth;
}

/* Custom scrollbar styling for panel content */
#stockHighlightPanelContainer .panel-content::-webkit-scrollbar {
    width: 8px;
}

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

#stockHighlightPanelContainer .panel-content::-webkit-scrollbar-thumb {
    background: linear-gradient(145deg, rgba(33, 150, 243, 0.6), rgba(25, 118, 210, 0.6));
    border-radius: 4px;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

#stockHighlightPanelContainer .panel-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(145deg, rgba(33, 150, 243, 0.8), rgba(25, 118, 210, 0.8));
}

/* Stock Panel Buttons - 2x2 Grid */
.stock-panel-buttons {
    display: flex;
    gap: 4px;
    margin-bottom: var(--spacing-lg);
}

.stock-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 */
#highlightStockButton,
#resetStockButton {
    flex: 1.3;
    font-size: 12px;
    padding: 8px 10px;
}

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

.stock-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;
}

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

.stock-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);
}

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

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

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

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

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

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

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

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

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

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

/* Dropdown Sections - Stock Theme - Compact spacing */
#stockFiltersSection .dropdown-section {
    margin-bottom: 10px;
}

#stockFiltersSection .dropdown-section label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    color: var(--stock-primary);
    text-shadow: 0 0 10px var(--stock-glow);
}

#stockFiltersSection .dropdown-section select {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    border: 2px solid rgba(33, 150, 243, 0.3);
    border-radius: var(--radius-md);
    background: rgba(30, 30, 45, 0.8);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#stockFiltersSection .dropdown-section select:hover {
    border-color: rgba(33, 150, 243, 0.5);
    background: rgba(40, 40, 55, 0.9);
    box-shadow: 0 4px 16px var(--stock-glow);
}

#stockFiltersSection .dropdown-section select:focus {
    outline: none;
    border-color: var(--stock-primary);
    box-shadow: 0 0 24px var(--stock-glow);
}

#stockFiltersSection .dropdown-section select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

/* Dropdown Info Text */
#stockFiltersSection .dropdown-info {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(33, 150, 243, 0.6);
    font-style: italic;
    font-family: var(--font-body);
}

/* Location List - Stock Theme */
#stockLocationsList {
    margin-top: var(--spacing-lg);
}

#stockLocationsList .list-header {
    margin-bottom: var(--spacing-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#stockLocationsList .list-header label {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    color: var(--stock-primary);
    text-shadow: 0 0 10px var(--stock-glow);
}

#stockLocationsList #locationCount {
    color: #64B5F6;
    font-weight: 700;
}

.list-controls {
    display: flex;
    gap: var(--spacing-xs);
}

.select-all-btn,
.deselect-all-btn {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-body);
    border: 1px solid rgba(33, 150, 243, 0.4);
    border-radius: var(--radius-sm);
    background: rgba(33, 150, 243, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-all-btn:hover {
    background: rgba(33, 150, 243, 0.3);
    border-color: rgba(33, 150, 243, 0.6);
    box-shadow: 0 2px 8px var(--stock-glow);
}

.deselect-all-btn:hover {
    background: rgba(244, 67, 54, 0.3);
    border-color: rgba(244, 67, 54, 0.6);
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.4);
}

/* Location List View */
.location-list-view {
    margin-top: var(--spacing-md);
    max-height: 200px;
    overflow-y: auto;
    border: 2px solid rgba(33, 150, 243, 0.3);
    border-radius: var(--radius-md);
    background: rgba(20, 20, 30, 0.6);
    padding: var(--spacing-sm);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.location-list-view::-webkit-scrollbar {
    width: 6px;
}

.location-list-view::-webkit-scrollbar-track {
    background: rgba(33, 150, 243, 0.1);
    border-radius: 3px;
}

.location-list-view::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--stock-primary), var(--stock-secondary));
    border-radius: 3px;
}

.location-list-view::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--stock-secondary), var(--stock-primary));
}

.location-list-view .list-empty {
    color: rgba(33, 150, 243, 0.5);
    font-style: italic;
    text-align: center;
    padding: var(--spacing-xl);
    font-size: 12px;
    font-family: var(--font-body);
}

/* Location List Item */
.location-list-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-xs);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(33, 150, 243, 0.2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body);
}

.location-list-item:hover {
    background: rgba(33, 150, 243, 0.15);
    border-color: rgba(33, 150, 243, 0.4);
    transform: translateX(4px);
    box-shadow: 0 2px 12px var(--stock-glow);
}

.location-list-item input[type="checkbox"] {
    margin-right: var(--spacing-md);
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--stock-primary);
}

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

.location-list-item .location-code {
    font-weight: 700;
    font-size: 13px;
    color: #64B5F6;
}

.location-list-item .location-details {
    display: flex;
    gap: var(--spacing-md);
    font-size: 11px;
    color: var(--text-secondary);
}

.location-list-item .location-qty {
    color: var(--success);
    font-weight: 700;
}

/* Summary Section - Stock Theme */
#stockSummary {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: rgba(33, 150, 243, 0.08);
    border: 2px solid rgba(33, 150, 243, 0.3);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#stockSummary .summary-info {
    color: var(--stock-primary);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.8;
    text-align: center;
}

/* Loading States */
.loading-dropdown {
    background: rgba(255, 235, 59, 0.15) !important;
    border-color: rgba(255, 235, 59, 0.5) !important;
}

.error-dropdown {
    background: rgba(244, 67, 54, 0.15) !important;
    border-color: rgba(244, 67, 54, 0.5) !important;
}

.success-dropdown {
    background: rgba(76, 175, 80, 0.15) !important;
    border-color: rgba(76, 175, 80, 0.5) !important;
}

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

#stockHighlightPanelContainer {
    animation: slideInFromRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive Design */
@media (max-width: 768px) {
    #stockHighlightPanelContainer .panel-header h3 {
        font-size: 16px;
    }

    #stockHighlightPanelContainer .panel-content {
        padding: var(--spacing-lg);
    }

    .stock-panel-buttons {
        gap: var(--spacing-sm);
    }

    .dropdown-section {
        margin-bottom: var(--spacing-md);
    }
}
