/**
 * Multi-Image Service Request Uploader Styles
 */

/* Container */
.image-uploader {
    position: relative;
}

/* Photo guidance */
.photo-guidance {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #e7f2f8;
    border: 1px solid #b3d4fc;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.photo-guidance .guidance-icon {
    font-size: 1.25rem;
}

.photo-guidance .guidance-text strong {
    display: block;
    color: #1a4480;
    margin-bottom: 0.25rem;
}

.photo-guidance .guidance-text p {
    margin: 0;
    color: #3d4551;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Upload dropzone */
.upload-area {
    margin-bottom: 1rem;
}

.upload-dropzone {
    border: 2px dashed #dfe1e2;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: #005ea2;
    background: #e7f2f8;
}

.dropzone-content {
    pointer-events: none;
}

.dropzone-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.dropzone-text {
    color: #3d4551;
    font-size: 1rem;
    margin: 0 0 0.25rem;
}

.dropzone-hint {
    color: #71767a;
    font-size: 0.875rem;
    margin: 0;
}

/* Image previews */
.image-previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.image-preview {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview .remove-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.image-preview .image-number {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Analysis status */
.analysis-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    background: #f5f7fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.analysis-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #dfe1e2;
    border-top-color: #005ea2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.analysis-status p {
    color: #3d4551;
    margin: 0;
}

/* Analysis results */
.analysis-results {
    background: #f5f7fa;
    border: 1px solid #dfe1e2;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.analysis-results h4 {
    margin: 0 0 1rem;
    color: #1a4480;
    font-size: 1rem;
}

.detection-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.detection-label {
    color: #71767a;
    font-size: 0.875rem;
}

.detection-value {
    color: #1a4480;
    font-weight: 600;
}

.detection-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dfe1e2;
}

.detection-section h5 {
    margin: 0 0 0.75rem;
    color: #3d4551;
    font-size: 0.875rem;
}

.detection-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

@media (max-width: 480px) {
    .detection-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.detection-item {
    background: white;
    padding: 0.5rem;
    border-radius: 4px;
}

.detection-item .label {
    display: block;
    font-size: 0.7rem;
    color: #71767a;
    text-transform: uppercase;
    margin-bottom: 0.125rem;
}

.detection-item .value {
    font-weight: 600;
    color: #1a4480;
    font-size: 0.875rem;
}

.commercial-badge {
    display: inline-block;
    background: #fef3cd;
    color: #856404;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

/* License plate display */
.plate-display {
    display: inline-flex;
    align-items: center;
    background: white;
    border: 2px solid #1a4480;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 1.2rem;
    font-weight: bold;
}

.plate-state {
    background: #1a4480;
    color: white;
    padding: 2px 6px;
    margin-right: 8px;
    border-radius: 2px;
    font-size: 0.75rem;
}

.plate-number {
    color: #1a4480;
    letter-spacing: 1px;
}

/* Confidence badges */
.confidence-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 0.5rem;
}

.confidence-badge.high {
    background: #d4edda;
    color: #155724;
}

.confidence-badge.medium {
    background: #fff3cd;
    color: #856404;
}

.confidence-badge.low {
    background: #f8d7da;
    color: #721c24;
}

/* Quality notes */
.quality-notes {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: #fff3cd;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    margin-top: 1rem;
    font-size: 0.875rem;
}

.quality-notes .notes-icon {
    flex-shrink: 0;
}

.quality-notes .notes-text {
    color: #856404;
}

/* Edit button */
#editDetection {
    margin-top: 1rem;
}

/* Vehicle selection modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin: 0 0 0.5rem;
    color: #1a4480;
}

.modal-subtext {
    color: #71767a;
    margin: 0 0 1rem;
    font-size: 0.875rem;
}

.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.vehicle-option {
    border: 2px solid #dfe1e2;
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.vehicle-option:hover {
    border-color: #005ea2;
    background: #f5f7fa;
}

.vehicle-option.selected {
    border-color: #005ea2;
    background: #e7f2f8;
}

.vehicle-option .badge {
    display: inline-block;
    background: #2e7d32;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
}

.vehicle-option.most-likely {
    border-color: #2e7d32;
}

.vehicle-info strong {
    display: block;
    color: #1a4480;
    margin-bottom: 0.25rem;
}

.vehicle-type {
    color: #71767a;
    font-size: 0.875rem;
}

.plate-mini {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 0.8rem;
    color: #1a4480;
    margin-top: 0.25rem;
}

.no-plate {
    font-size: 0.75rem;
    color: #71767a;
    font-style: italic;
    margin-top: 0.25rem;
}

/* Manual entry form */
.manual-form {
    background: #f5f7fa;
    border: 1px solid #dfe1e2;
    border-radius: 8px;
    padding: 1rem;
}

.manual-form .notice {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.manual-form .notice-icon {
    flex-shrink: 0;
}

.manual-form .notice p {
    margin: 0;
    color: #856404;
    font-size: 0.875rem;
}

.manual-form h4 {
    margin: 1rem 0 0.75rem;
    color: #1a4480;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.manual-form h4:first-of-type {
    margin-top: 0;
}

.form-row {
    margin-bottom: 0.75rem;
}

.form-row label {
    display: block;
    margin-bottom: 0.25rem;
    color: #3d4551;
    font-size: 0.875rem;
}

.form-row input[type="text"],
.form-row select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #dfe1e2;
    border-radius: 4px;
    font-size: 1rem;
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: #005ea2;
    box-shadow: 0 0 0 3px rgba(0, 94, 162, 0.1);
}

.checkbox-row label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-primary {
    background: #005ea2;
    color: white;
}

.btn-primary:hover {
    background: #0a4c82;
}

.btn-primary:disabled {
    background: #71767a;
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: #005ea2;
    border: 1px solid #005ea2;
}

.btn-secondary:hover {
    background: #e7f2f8;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Notice toasts */
.notice-toast {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.notice-info {
    background: #e7f2f8;
    color: #0a4c82;
    border: 1px solid #b3d4fc;
}

.notice-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.notice-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.notice-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Photo Examples */
.photo-examples {
    margin-bottom: 1rem;
}

.examples-header {
    margin-bottom: 0.5rem;
}

.examples-toggle {
    background: none;
    border: 1px dashed #b3d4fc;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    color: #005ea2;
    cursor: pointer;
    font-size: 0.875rem;
    width: 100%;
    text-align: left;
    transition: all 0.2s ease;
}

.examples-toggle:hover {
    background: #e7f2f8;
    border-color: #005ea2;
}

.examples-content {
    background: #f9fafb;
    border: 1px solid #dfe1e2;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.5rem;
}

.examples-section {
    margin-bottom: 1rem;
}

.examples-section:last-child {
    margin-bottom: 0;
}

.examples-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.examples-title.good {
    color: #2e7d32;
}

.examples-title.bad {
    color: #c62828;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
}

.example-item {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
}

.example-item.good {
    border-color: #c8e6c9;
}

.example-item.bad {
    border-color: #ffcdd2;
}

.example-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.example-item.bad::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        transparent 40%,
        rgba(198, 40, 40, 0.3) 40%,
        rgba(198, 40, 40, 0.3) 60%,
        transparent 60%);
    pointer-events: none;
}

/* Mobile optimizations for examples */
@media (max-width: 480px) {
    .examples-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
