/* ----------------------------------------------------------
   ISBN Scanner — Material Design Styles
   ---------------------------------------------------------- */

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

h3, h2 {
    margin-top: 0;
    font-weight: 600;
}

/* ----------------------------------------------------------
   Scanner View
   ---------------------------------------------------------- */

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

#scanner-video {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
}

/* Overlay mit Fokusrahmen */

.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;
}

button {
    cursor: pointer;
}

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

    padding: 14px 22px;
    min-height: 52px;
    font-size: 18px;
    font-weight: 500;

    border-radius: 10px;
    border: none;

    transition: all .18s ease;
}

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

/* Primary (blau) */

.primary {
    background: #2196f3;
    color: #fff;
    border: 2px solid #1976d2;
}

.primary:hover {
    background: #1e88e5;
}

/* Secondary (grau/hell) */

.secondary {
    background: #e0e0e0;
    color: #333;
    border: 2px solid #c2c2c2;
}

.secondary:hover {
    background: #d5d5d5;
}

/* Disabled */

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ----------------------------------------------------------
   Messages
   ---------------------------------------------------------- */

#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;
}

/* ----------------------------------------------------------
   Preview Layout
   ---------------------------------------------------------- */

.preview {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
    padding: 20px;
    border-radius: 12px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
}

.preview-cover img,
.preview-cover .no-cover {
    width: 100%;
    border-radius: 10px;
    border: 2px solid #ddd;
    background: #fff;
}

/* Meta Inputs */

.preview-meta label {
    display: block;
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 600;
}

.preview-meta input,
.preview-meta textarea {
    width: 100%;
    margin-top: 4px;

    padding: 10px 12px;
    font-size: 15px;

    border-radius: 8px;
    border: 1px solid #bbb;

    transition: border-color .18s ease;
}

.preview-meta input:focus,
.preview-meta textarea:focus {
    outline: none;
    border-color: #2196f3;
}

.row {
    display: flex;
    gap: 12px;
}

/* Actions */

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

/* ----------------------------------------------------------
   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;
}

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

@media (max-width: 780px) {

    .preview {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .overlay::after {
        inset: 15% 12%;
    }

    .btn-large {
        width: 100%;
    }

    .row {
        flex-direction: column;
    }
}