/* ==========================================================
   Hauptlayout für die Scanner-Seite
   ========================================================== */

.scanner-main {
    /* Stellt sicher, dass die Hauptinhalte den verfügbaren Platz einnehmen */
}

.scanner-command-center {
    display: grid;
    grid-template-columns: 1.2fr 1fr; 
    gap: 2rem;
    max-width: 1400px; 
    margin: 2rem auto; 
    padding: 0 1rem;
}

/* Hauptspalten */
.scanner-interface,
.scanner-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; 
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-large, 24px);
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--border-color);
}

/* ==========================================================
   Linke Spalte: Scanner-Interface
   ========================================================== */

.scanner-header h3 {
    margin-top: 0;
    color: var(--text-dark);
}
.scanner-header p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.mode-selector-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Modus-Karte */
.mode-card {
    background-color: var(--background-section-alt);
    padding: 1.25rem;
    border-radius: var(--radius-normal, 12px);
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease-in-out;
}

.mode-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-light);
    border-color: var(--border-color);
}

.mode-card.active {
    background-color: #e6f6e8; 
    border-color: var(--green-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-light);
}

.mode-card i {
    font-size: 2rem;
    color: var(--green-primary);
    margin-bottom: 0.75rem;
}

.mode-card h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text-dark);
}
.mode-card span {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Video-Container & Steuerung */
#video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background-color: #000;
    border-radius: var(--radius-normal);
    overflow: hidden; 
    display: flex;
    align-items: center;
    justify-content: center;
}

#scanner-start-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0,0,0,0.6);
    z-index: 5; 
}

#video-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    background-color: rgba(0,0,0,0.5);
    padding: 0.5rem;
    border-radius: 99px;
    z-index: 10;
}

.icon-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px; 
    cursor: pointer;
    padding: 6px;
    line-height: 1;
    transition: opacity 0.2s;
}
.icon-btn:hover {
    opacity: 0.8;
}

.scanner-status {
    text-align: center;
    padding: 0.75rem;
    background-color: var(--background-section-alt);
    border-radius: var(--radius-normal);
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ==========================================================
   Rechte Spalte: Dashboard & Ergebnisse
   ========================================================== */

.dashboard-section h3 {
    margin-top: 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

/* Platzhalter-Stil für leere Zustände */
.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-light);
    padding: 1.5rem; /* Padding für den Platzhalter-Text */
}
.placeholder-content i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Container für Scan-Verlauf */
#scan-history {
    background-color: var(--background-section-alt);
    padding: 1.5rem;
    border-radius: var(--radius-normal);
    min-height: 150px;
}

/* Verlauf-Einträge */
.history-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}
.history-item:last-child {
    border-bottom: none;
}
.history-item-icon {
    font-size: 1.5rem;
    color: var(--green-primary);
}
.history-item-info strong {
    display: block;
    color: var(--text-dark);
}
.history-item-info span {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* =============================================== */
/* ==       NEU: Scan-Ergebnis-Karte            == */
/* =============================================== */

/* Entfernt das Standard-Padding, da die Karte es nun selbst übernimmt */
#scan-result {
    padding: 0;
    background-color: transparent;
    overflow: hidden; /* Stellt sicher, dass der Radius der Karte respektiert wird */
    min-height: 150px; /* Behält eine Mindesthöhe bei, um Layout-Sprünge zu vermeiden */
}

.scan-result-card {
    display: grid;
    grid-template-columns: 80px 1fr; /* Spalte für Bild und Spalte für Info */
    gap: 1.5rem;
    align-items: center;
    background-color: var(--background-section-alt);
    padding: 1.5rem;
    border-radius: var(--radius-normal); /* Radius von #scan-history übernommen */
    animation: fadeInResult 0.5s ease-out;
}

@keyframes fadeInResult {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: var(--radius-normal, 12px);
    background-color: #fff; /* Heller Hintergrund für transparente Produktbilder */
    border: 1px solid var(--border-color);
}

.result-info h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.3;
}

.result-brands {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.brand-pill {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 99px; /* Pillenform */
    background-color: var(--border-color);
    color: var(--text-light);
}

/* =====================================================
   MHD-Erfassungs-Modal
   ===================================================== */

#mhd-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1001; 
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

#mhd-modal-overlay.mhd-modal-hidden {
    opacity: 0;
    pointer-events: none;
}

#mhd-modal {
    position: relative;
    background: var(--white); 
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    width: 90%;
    max-width: 400px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.modal-close-btn {
    position: absolute;
    top: 0.75rem;  
    right: 0.75rem;  
    background: transparent; 
    border: none;         
    font-size: 1.5rem;   
    line-height: 1;  
    color: var(--text-light);
    cursor: pointer;         
    padding: 0.5rem;         
    transition: color 0.2s ease, transform 0.2s ease;
}

.modal-close-btn:hover {
    color: var(--text-dark);
    transform: scale(1.1);
}

#mhd-modal h3 {
    margin-top: 0;
    color: var(--text-dark);
    padding-right: 2.5rem; 
}

.mhd-product-context {
    font-size: 1rem;
    font-style: italic;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.mhd-input-group {
    margin-bottom: 2rem;
}

.mhd-input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    text-align: left;
    color: var(--text-dark);
}

.mhd-input-group input[type="date"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.1rem;
    background-color: var(--background-light);
    color: var(--text-dark);
}

.mhd-modal-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}
.mhd-modal-actions .btn {
    flex: 1;
}

/* =====================================================
   Produkt-Melden-Modal
   ===================================================== */

.report-product-trigger {
    text-align: center;
    margin: 0.5rem 0 1.5rem 0;
}

.report-product-trigger a {
    font-size: 0.85rem;
    color: var(--text-light);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: var(--radius-small);
    transition: color 0.2s, background-color 0.2s;
}

.report-product-trigger a:hover {
    color: var(--orange-dark);
    background-color: var(--background-section-alt);
    text-decoration: none;
}

.report-product-trigger a i {
    color: var(--orange-primary);
}

#report-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 1002;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

#report-modal-overlay.report-modal-hidden {
    opacity: 0;
    pointer-events: none;
}

#report-modal {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-medium);
    width: 90%;
    max-width: 450px;
    text-align: center;
    border: 1px solid var(--border-color);
}

#report-modal h3 {
    margin-top: 0;
    color: var(--text-dark);
}

.report-product-details {
    background-color: var(--background-section-alt);
    padding: 0.75rem;
    border-radius: var(--radius-normal);
    margin: 1rem 0 1.5rem 0;
    font-size: 0.9rem;
    color: var(--text-light);
    word-break: break-all;
}

#report-form .form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

#report-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

#report-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-normal);
    font-size: 1rem;
    background-color: var(--background-light);
    color: var(--text-dark);
    resize: vertical;
    min-height: 80px;
    box-sizing: border-box;
}
#report-form textarea:focus {
    outline: none;
    border-color: var(--green-primary);
    box-shadow: 0 0 0 2px rgba(41, 199, 120, 0.2);
}

.report-modal-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.report-modal-actions .btn {
    flex: 1;
}


/* =============================================== */
/* ==          RESPONSIVES VERHALTEN            == */
/* =============================================== */

@media (max-width: 1024px) {
    .scanner-command-center {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .mode-selector-cards {
        grid-template-columns: 1fr;
    }
}

/* =============================================== */
/* ==             DARK MODE STYLES              == */
/* =============================================== */

body.dark-mode .mode-card.active {
    background-color: rgba(41, 199, 120, 0.15); 
    border-color: var(--green-primary);
}

body.dark-mode .brand-pill {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

body.dark-mode .mhd-input-group input[type="date"] {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-dark);
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .mhd-input-group input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

body.dark-mode #mhd-modal .btn--secondary,
body.dark-mode #report-modal .btn--secondary {
    background: var(--background-section-alt);
    color: var(--text-dark);
    border-color: var(--border-color);
}

body.dark-mode #mhd-modal .btn--secondary:hover,
body.dark-mode #report-modal .btn--secondary:hover {
    background: var(--border-color);
}

body.dark-mode .report-product-details {
    background-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode #report-form textarea {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-dark);
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .modal-close-btn:hover {
    color: var(--white);
}