/**
 * Condition Annotator Styles
 * Bootstrap 5 compatible
 */

.condition-annotator {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    overflow: hidden;
}

.annotator-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #e9ecef;
    border-bottom: 1px solid #dee2e6;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toolbar-group label {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0;
    color: #495057;
}

.toolbar-group.tools {
    border-right: 1px solid #ced4da;
    padding-right: 1rem;
}

.tool-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    background: #fff;
    color: #495057;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease-in-out;
}

.tool-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.tool-btn.active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.toolbar-group.category select {
    min-width: 140px;
}

.toolbar-group.color input[type="color"] {
    width: 40px;
    height: 32px;
    padding: 2px;
    cursor: pointer;
}

.annotator-canvas-container {
    position: relative;
    min-height: 400px;
    max-height: 700px;
    overflow: auto;
    background: #343a40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.annotator-canvas-container canvas {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.annotator-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #e9ecef;
    border-top: 1px solid #dee2e6;
    font-size: 0.875rem;
    color: #6c757d;
}

.annotation-count {
    font-weight: 500;
}

/* Photo Gallery Styles */
.condition-photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.condition-photo-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    overflow: hidden;
    transition: box-shadow 0.15s ease-in-out;
}

.condition-photo-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.condition-photo-card .photo-thumb {
    position: relative;
    padding-top: 100%;
    background: #f8f9fa;
    overflow: hidden;
}

.condition-photo-card .photo-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.condition-photo-card .photo-thumb .annotation-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(13, 110, 253, 0.9);
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.condition-photo-card .photo-thumb .ai-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(255, 20, 147, 0.9);
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.condition-photo-card .photo-type-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.condition-photo-card .photo-info {
    padding: 0.75rem;
}

.condition-photo-card .photo-caption {
    font-size: 0.875rem;
    color: #212529;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.condition-photo-card .photo-actions {
    display: flex;
    gap: 0.5rem;
}

.condition-photo-card .photo-actions .btn {
    flex: 1;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Condition Check Header */
.condition-check-header {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    color: #fff;
    padding: 1.5rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
}

.condition-check-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.condition-check-header .object-info {
    opacity: 0.9;
    font-size: 0.95rem;
}

.condition-check-header .check-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.condition-check-header .meta-item {
    display: flex;
    flex-direction: column;
}

.condition-check-header .meta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    opacity: 0.7;
}

.condition-check-header .meta-value {
    font-weight: 500;
}

/* Condition Rating Badges */
.condition-rating {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.condition-rating.excellent { background: #198754; color: #fff; }
.condition-rating.good { background: #20c997; color: #fff; }
.condition-rating.fair { background: #ffc107; color: #212529; }
.condition-rating.poor { background: #fd7e14; color: #fff; }
.condition-rating.unacceptable { background: #dc3545; color: #fff; }

/* Photo Type Badges */
.photo-type {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.photo-type.general { background: #6c757d; color: #fff; }
.photo-type.detail { background: #0dcaf0; color: #212529; }
.photo-type.damage { background: #dc3545; color: #fff; }
.photo-type.before { background: #198754; color: #fff; }
.photo-type.after { background: #20c997; color: #fff; }
.photo-type.raking { background: #6f42c1; color: #fff; }
.photo-type.uv { background: #d63384; color: #fff; }
.photo-type.ir { background: #fd7e14; color: #fff; }
.photo-type.xray { background: #212529; color: #fff; }

/* Upload Zone */
.photo-upload-zone {
    border: 2px dashed #ced4da;
    border-radius: 0.375rem;
    padding: 2rem;
    text-align: center;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.photo-upload-zone:hover,
.photo-upload-zone.drag-over {
    border-color: #0d6efd;
    background: #e7f1ff;
}

.photo-upload-zone i {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.photo-upload-zone p {
    margin-bottom: 0.5rem;
    color: #495057;
}

.photo-upload-zone .upload-hint {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Annotation Legend */
.annotation-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Annotation List Panel */
.annotation-list-panel {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    max-height: 400px;
    overflow-y: auto;
}

.annotation-list-panel .panel-header {
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 500;
    position: sticky;
    top: 0;
}

.annotation-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f3f5;
}

.annotation-list-item:last-child {
    border-bottom: none;
}

.annotation-list-item .ann-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.annotation-list-item .ann-info {
    flex: 1;
    min-width: 0;
}

.annotation-list-item .ann-label {
    font-weight: 500;
    font-size: 0.875rem;
}

.annotation-list-item .ann-notes {
    font-size: 0.8rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.annotation-list-item .ann-ai {
    font-size: 0.7rem;
    background: #FF1493;
    color: #fff;
    padding: 1px 6px;
    border-radius: 10px;
}

/* Modal Enhancements */
.annotator-modal .modal-dialog {
    max-width: 95vw;
}

.annotator-modal .modal-body {
    padding: 0;
    max-height: 85vh;
    overflow: hidden;
}

.annotator-modal .condition-annotator {
    border: none;
    border-radius: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .annotator-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-group.tools {
        border-right: none;
        border-bottom: 1px solid #ced4da;
        padding-right: 0;
        padding-bottom: 0.75rem;
        justify-content: center;
    }
    
    .toolbar-group {
        justify-content: center;
    }
    
    .condition-photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

/* Print styles */
@media print {
    .annotator-toolbar,
    .annotator-status-bar,
    .photo-actions {
        display: none !important;
    }
    
    .condition-annotator {
        border: none;
    }
    
    .annotator-canvas-container {
        background: #fff;
        max-height: none;
        overflow: visible;
    }
}
