﻿/* Layout Structure */
.full-height {
    height: calc(100vh - 100px);
}

.left-panel {
    background-color: var(--mud-palette-background-grey);
    border-right: 1px solid var(--mud-palette-divider);
    overflow-y: auto;
}

.center-panel {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Image Grid for Upload Panel */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.image-card {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

.image-card:hover {
    transform: scale(1.05);
}

.image-card.processing {
    opacity: 0.6;
}

.image-card.selected {
    border: 2px solid var(--mud-palette-primary);
}

.remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.processing-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.status-chip {
    position: absolute;
    bottom: 4px;
    right: 4px;
    min-height: 20px;
    height: 20px;
}

/* Photo Assignment Content */
.photo-assignment-content {
    flex: 1;
    overflow-y: auto;
    background: var(--mud-palette-background);
}

/* Unassigned Photos Container - Horizontal Wrap Layout */
.unassigned-photos-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 8px;
}

/* Assigned Photos Grid - 2 Column Layout */
.assigned-photos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px;
}

/* Photo Selection Card Styling */
.photo-selection-card {
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.photo-selection-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.photo-selection-card.selected {
    border-color: var(--mud-palette-primary);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.2);
}

/* Size Specifications */
.unassigned-photos-container .photo-selection-card {
    width: 150px;
    height: 120px;
    flex-shrink: 0;
}

.assigned-photos-grid .photo-selection-card {
    width: 100%;
    height: 120px;
}

/* Selection Overlay */
.selection-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(33, 150, 243, 0.1);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.selection-overlay.visible {
    opacity: 1;
}

/* Selection Checkmark */
.selection-checkmark {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: #4caf50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* AI Suggestion Overlay */
.ai-suggestion-overlay {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(255, 193, 7, 0.95);
    border-radius: 4px;
    padding: 2px 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Element Error Styling */
.element-error {
    border: 3px solid #f44336 !important;
    background-color: rgba(244, 67, 54, 0.05) !important;
    position: relative;
}

.element-error::before {
    content: "";
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border: 2px solid #f44336;
    border-radius: 8px;
    pointer-events: none;
    animation: error-pulse 2s infinite;
}

@keyframes error-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(244, 67, 54, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0);
    }
}

/* Error state for chips */
.element-error .mud-chip {
    background-color: #f44336 !important;
    color: white !important;
    animation: chip-shake 0.5s ease-in-out;
}

@keyframes chip-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

/* Scrollbar Styling */
.photo-assignment-content::-webkit-scrollbar,
.image-grid::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.photo-assignment-content::-webkit-scrollbar-track,
.image-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.photo-assignment-content::-webkit-scrollbar-thumb,
.image-grid::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.photo-assignment-content::-webkit-scrollbar-thumb:hover,
.image-grid::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .unassigned-photos-container .photo-selection-card {
        width: 120px;
        height: 100px;
    }

    .assigned-photos-grid .photo-selection-card {
        height: 100px;
    }
}

@media (max-width: 768px) {
    .full-height {
        height: auto;
    }

    .assigned-photos-grid {
        grid-template-columns: 1fr;
    }

    .unassigned-photos-container .photo-selection-card {
        width: 100px;
        height: 80px;
    }

    .left-panel {
        border-right: none;
        border-bottom: 1px solid var(--mud-palette-divider);
    }

    /* Reduce error animation on mobile for performance */
    .element-error::before {
        animation: none;
        border: 2px solid #f44336;
    }
}