/* ----------------------------------------------------------
   ISBN OCR Extension — Stylesheet v2.0.0
   Enthält:
   - Scanner Layout
   - Material Design Buttons
   - Panels & Message Boxes
   - Vollbild-Crop-Overlay (Option A)
   - Responsive Optimierung
---------------------------------------------------------- */

#isbn-ocr-app {
    max-width: 900px;
    margin: 0 auto;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

h3, h2 {
    font-weight: 600;
}

/* ----------------------------------------------------------
   Scanner Area
---------------------------------------------------------- */

.scanner-wrap {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

#ocr-video {
    width: 100%;
    max-height: 60vh;
    object-fit: cover;
    display: block;
}

.overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.overlay::after {
    content: "";
    position: absolute;
    inset: 10% 15%;
    border: 3px solid #00d4a6;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0,212,166,.5);
}

/* ----------------------------------------------------------
   Controls / Buttons (Material Design)
---------------------------------------------------------- */

.controls {
    margin: 12px 0 18px;
    display: flex;
    gap: 12px;
}

.btn-large {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 14px 22px;
    min-height: 52px;

    font-size: 18px;
    font-weight: 500;

    border: none;
    border-radius: 10px;

    cursor: pointer;
    transition: all .18s ease;
}

.btn-large:active {
    transform: scale(0.96);
}

/* Primary Style */
.primary {
    background: #2196f3;
    color: #fff;
    border: 2px solid #1976d2;
}
.primary:hover {
    background: #1e88e5;
}

/* Secondary Style */
.secondary {
    background: #e0e0e0;
    color: #333;
    border: 2px solid #c2c2c2;
}
.secondary:hover {
    background: #d5d5d5;
}

/* Disabled state */
button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ----------------------------------------------------------
   Message Boxes
---------------------------------------------------------- */

#ocr-messages {
    margin-bottom: 14px;
    min-height: 30px;
}

.msg {
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 16px;
    line-height: 1.4;
}

.msg.info {
    background: #e3f2fd;
    color: #0d47a1;
    border: 1px solid #bbdefb;
}
.msg.error {
    background: #ffebee;
    color: #b71c1c;
    border: 1px solid #ffcdd2;
}
.msg.success {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #c8e6c9;
}

/* ----------------------------------------------------------
   Result Panel
---------------------------------------------------------- */

.panel {
    padding: 20px;
    border-radius: 12px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
}

.panel h3 small {
    font-size: 14px;
    font-weight: normal;
    opacity: 0.7;
}

/* Meta Grid */
.meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 8px 0 14px;
}

/* Textareas */

label {
    display: block;
    margin: 10px 0;
    font-weight: 600;
}

textarea {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid #bbb;
    border-radius: 8px;
    min-height: 120px;
}

textarea[readonly] {
    background: #f4f4f4;
}

/* Replace/Append Mode */

.save-mode {
    margin: 14px 0;
    display: flex;
    gap: 20px;
    font-size: 16px;
    align-items: center;
}

.save-mode input[type="radio"] {
    margin-right: 5px;
}

/* Actions */

.actions {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ----------------------------------------------------------
   Done Screen
---------------------------------------------------------- */

.done-screen {
    padding: 40px 20px;
    text-align: center;
    border-radius: 12px;
    background: #e8f5e9;
    border: 2px solid #c8e6c9;
}

.done-screen h2 {
    font-size: 28px;
    margin-bottom: 22px;
    color: #2e7d32;
}

/* ----------------------------------------------------------
   FULLSCREEN CROP OVERLAY (Option A)
---------------------------------------------------------- */

.ocr-crop-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 99999;

    display: flex;
    justify-content: center;
    align-items: center;

    overflow: hidden;
}

.ocr-crop-canvas {
    max-width: 90%;
    max-height: 90%;
    border: 2px solid #00d4a6;
    border-radius: 6px;
    touch-action: none;
}

.crop-confirm {
    margin-top: 20px;
}

/* ----------------------------------------------------------
   Responsive
---------------------------------------------------------- */

@media (max-width: 780px) {

    .meta-grid {
        grid-template-columns: 1fr;
    }

    .btn-large {
        width: 100%;
    }

    .ocr-crop-canvas {
        max-width: 96%;
        max-height: 80%;
    }
}