/* Shared Selected Images Pane Styles */
/* Consistent styling across PatientImages, ImageCloud, and Favourite pages */

.selection-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: #2d2d2d;
    border-top: 3px solid #007bff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    height: 280px;
    animation: slideUpFromBottom 0.3s ease-out;
}

@keyframes slideUpFromBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.selection-panel-left {
    flex: 1;
    display: flex;
    padding: 15px 20px;
    overflow: hidden;
}

.selected-images-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
}

.selection-header h4 {
    color: #fff;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.selected-images-list {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 0;
}

.selected-images-list::-webkit-scrollbar {
    height: 8px;
}

.selected-images-list::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

.selected-images-list::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.selected-images-list::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.selected-image-thumb {
    position: relative;
    flex-shrink: 0;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: visible; /* Changed from hidden to allow X button to show outside circle */
    border: 3px solid #007bff;
    background: #000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

/* Add a wrapper inside to maintain circular clipping for image only */
.selected-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.selected-image-thumb:hover {
    transform: scale(1.05);
}

.remove-selection-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 20px;
    font-weight: 700;
    padding: 0;
    z-index: 10000;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.remove-selection-btn:hover {
    color: #ff0000;
    transform: scale(1.2);
    text-shadow: 0 2px 8px rgba(255, 0, 0, 0.8);
}

.remove-selection-btn i {
    pointer-events: none;
    color: inherit;
    font-size: 20px;
}

/* Only show ::before X if there's no icon inside */
.remove-selection-btn:not(:has(i))::before {
    content: '\00d7';
    color: inherit;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    display: block;
}

.selection-panel-right {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 20px;
    background: #1a1a1a;
    border-left: 2px solid #444;
    min-width: 380px;
    align-content: center;
}

.selection-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    color: white;
}

.selection-action-btn i {
    font-size: 14px;
}

.selection-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.compare-btn {
    background: #17a2b8;
}

.compare-btn:hover:not(:disabled) {
    background: #138496;
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.3);
}

.delete-btn {
    background: #dc3545;
}

.delete-btn:hover:not(:disabled) {
    background: #c82333;
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.export-btn {
    background: #28a745;
}

.export-btn:hover:not(:disabled) {
    background: #218838;
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.report-btn {
    background: #007bff;
}

.report-btn:hover:not(:disabled) {
    background: #0056b3;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.clear-btn {
    background: #6c757d;
}

.clear-btn:hover:not(:disabled) {
    background: #545b62;
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

/* Responsive selection panel */
@media (max-width: 1024px) {
    .selection-panel {
        height: auto;
        min-height: 180px;
    }

    .selection-panel-right {
        min-width: 160px;
    }

    .selection-action-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .selected-image-thumb {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 768px) {
    .selection-panel {
        flex-direction: column;
        height: auto;
    }

    .selection-panel-right {
        border-left: none;
        border-top: 2px solid #444;
        min-width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 15px;
    }

    .selection-action-btn {
        flex: 1;
        min-width: calc(50% - 6px);
    }
}
