/* General Body and Font Styles */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f0f4f8;
    /* Light gray background */
    color: #333;
    justify-content: center;
    align-items: flex-start;
    /* Align to top to avoid pushing content off screen on smaller devices */
    min-height: 100vh;
    /* Minimum full height */
    margin: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Main Container */
.container {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    /* Wider for desktop content */
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    margin-top: 50px;
    /* Space from the top */
    margin-bottom: 50px;
    /* Space from the bottom */
}

/* Headings */
h1 {
    color: #009999;
    /* Siemens blue-green */
    margin-bottom: 10px;
    font-size: 2.5em;
    font-weight: 700;
}

.tagline {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 30px;
}

/* Sections */
.section {
    background-color: #e6f7f7;
    /* Light background for sections */
    border: 1px solid #b0e0e6;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
}

.section h2 {
    color: #007a7a;
    /* Darker Siemens blue-green */
    font-size: 1.8em;
    margin-bottom: 20px;
}

.section p {
    color: #555;
    font-size: 1em;
    margin-bottom: 15px;
}

/* QR Code Container */
.qrcode-container {
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    display: inline-block;
    /* To center the QR code */
    margin: 20px auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.qrcode-container canvas {
    display: block;
    /* Remove extra space below canvas */
}

/* Image Previews Container */
.image-previews-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    min-height: 150px;
    /* Reserve space */
    border: 1px dashed #b0e0e6;
    border-radius: 8px;
    padding: 20px;
    background-color: #faffff;
    overflow-y: auto;
    /* Enable scrolling for many images */
    max-height: 400px;
    position: relative;
    /* For no scans message */
}

.no-scans-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #888;
    font-style: italic;
    font-size: 1.1em;
    pointer-events: none;
    /* Allow clicks to pass through */
}

.image-preview-item {
    position: relative;
    width: 120px;
    height: 160px;
    /* A4 aspect ratio approximation */
    border: 2px solid #b0e0e6;
    border-radius: 8px;
    overflow: hidden;
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.image-preview-item.dragging {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    z-index: 10;
    /* Bring to front while dragging */
}


.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-item .delete-button {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(220, 53, 69, 0.8);
    /* Red semi-transparent */
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 0.9em;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0.9;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.image-preview-item .delete-button:hover {
    background-color: rgba(220, 53, 69, 1);
    opacity: 1;
}

/* Action Buttons */
.action-buttons {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.action-button {
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, opacity 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: none;
}

.primary-button {
    background-color: #009999;
    /* Siemens blue-green */
    color: white;
}

.primary-button:hover:not(:disabled) {
    background-color: #007a7a;
    /* Darker Siemens blue-green on hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 153, 153, 0.4);
}

.secondary-button {
    background-color: #f8f8f8;
    /* Light gray */
    color: #555;
    border: 1px solid #ddd;
}

.secondary-button:hover:not(:disabled) {
    background-color: #eaeaea;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
}

.action-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
}

/* Status Message */
.status-message {
    font-size: 1em;
    color: #444;
    margin-top: 20px;
    text-align: center;
    min-height: 20px;
    /* Reserve space */
}

.status-message.error {
    color: #d9534f;
    /* Red for errors */
    font-weight: 600;
}

.status-message.success {
    color: #5cb85c;
    /* Green for success */
    font-weight: 600;
}

.status-message.info {
    color: #007a7a;
    /* Info blue-green */
}

.hidden {
    display: none !important;
}

/* Responsive adjustments for desktop */
@media (max-width: 768px) {
    .container {
        padding: 25px;
        margin-top: 20px;
        margin-bottom: 20px;
    }

    h1 {
        font-size: 2em;
    }

    .tagline {
        font-size: 1em;
    }

    .section {
        padding: 20px;
    }

    .section h2 {
        font-size: 1.5em;
    }

    .image-preview-item {
        width: 100px;
        height: 130px;
    }

    .action-button {
        padding: 10px 20px;
        font-size: 0.95em;
    }

    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 1.8em;
    }

    .tagline {
        font-size: 0.9em;
    }
}