﻿/* wwwroot/css/camera.css */
/* CSS Styles für die Kamera-Integration */

/* Video-Element Styling */
.camera-video {
    width: 100%;
    max-width: 500px;
    height: auto;
    border: 2px solid #007acc;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background: #000;
    object-fit: cover;
}

    .camera-video:not([src]) {
        background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #f0f0f0 75%), linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
        background-size: 20px 20px;
        background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    }

/* Kamera-Bedienelemente Container */
.camera-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

    .camera-controls .rz-button {
        min-width: 120px;
        padding: 8px 16px;
    }

/* Bildvorschau Container */
.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.image-preview-item {
    position: relative;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 8px;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

    .image-preview-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }

.image-preview-thumbnail {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.image-preview-filename {
    font-size: 11px;
    color: #6c757d;
    margin-top: 5px;
    text-align: center;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-remove-button {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #dc3545;
    border: 2px solid white;
    color: white;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .image-remove-button:hover {
        background: #c82333;
    }

/* Tab-Styling für Datei-Upload vs Kamera */
.upload-tabs .rz-tabview-nav-content {
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.upload-tabs .rz-tabview-panel {
    padding: 20px;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    background: white;
}

/* File Input Styling */
.file-upload-area {
    border: 2px dashed #007acc;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

    .file-upload-area:hover {
        background: #e9ecef;
        border-color: #0056b3;
    }

    .file-upload-area.dragover {
        background: #cce7ff;
        border-color: #0056b3;
        transform: scale(1.02);
    }

/* Responsive Design */
@media (max-width: 768px) {
    .camera-video {
        max-width: 100%;
    }

    .camera-controls {
        flex-direction: column;
        align-items: center;
    }

        .camera-controls .rz-button {
            width: 200px;
        }

    .image-preview-container {
        justify-content: center;
    }
}

/* Loading-Animation für Kamera-Start */
.camera-loading {
    position: relative;
    overflow: hidden;
}

    .camera-loading::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 40px;
        height: 40px;
        margin: -20px 0 0 -20px;
        border: 3px solid #f3f3f3;
        border-top: 3px solid #007acc;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        z-index: 10;
    }

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Status-Anzeigen */
.camera-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
}

    .camera-status.active {
        background: #d4edda;
        color: #155724;
        border: 1px solid #c3e6cb;
    }

    .camera-status.inactive {
        background: #f8d7da;
        color: #721c24;
        border: 1px solid #f5c6cb;
    }

.camera-status-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: currentColor;
}

/* Accessibility-Verbesserungen */
.camera-controls .rz-button:focus {
    outline: 2px solid #007acc;
    outline-offset: 2px;
}

.image-preview-item:focus-within {
    outline: 2px solid #007acc;
    outline-offset: 2px;
}

/* Print-Styles (Bilder in Ausdrucken berücksichtigen) */
@media print {
    .camera-controls,
    .upload-tabs {
        display: none;
    }

    .image-preview-container {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        page-break-inside: avoid;
    }

    .image-preview-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
}
