body {
    font-family: "Poppins", sans-serif;
    text-align: center;
    padding: 20px;
    background-color: #f4f4f9;
    color: #333;
    margin: 0;
}

h1 {
    color: #4a90e2;
    margin-bottom: 20px;
    font-weight: 500;
}

/* ---- Status bar ---- */
.status-bar {
    max-width: 620px;
    margin: 0 auto 15px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: left;
}
.status-bar.hidden {
    display: none;
}
.status-bar.info {
    background-color: #e3f2fd;
    color: #1565c0;
}
.status-bar.success {
    background-color: #e8f5e9;
    color: #2e7d32;
}
.status-bar.error {
    background-color: #fce4ec;
    color: #c62828;
}

/* ---- Progress bar ---- */
#progress-container {
    height: 6px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}
#progress-container.hidden {
    display: none;
}
#progress-bar {
    height: 100%;
    width: 0;
    background-color: #4a90e2;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ---- Mode selector ---- */
.mode-selector {
    max-width: 620px;
    margin: 0 auto 15px;
    padding: 10px 16px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    font-size: 0.9rem;
}
.mode-selector label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}
.backend-available {
    color: #2e7d32;
    font-size: 0.8rem;
}
.backend-unavailable {
    color: #c62828;
    font-size: 0.8rem;
}
.preload-button {
    padding: 6px 14px;
    font-size: 0.8rem;
    margin: 0;
}

/* ---- Inputs ---- */
.input-group {
    margin: 15px 0;
}
.input-group input[type="number"] {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
}
.input-group select {
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
}
.input-group label {
    margin: 0 4px 0 10px;
}

/* ---- Image container ---- */
#image-container {
    width: 600px;
    height: 400px;
    margin: 20px auto;
    border: 2px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: #fff;
    overflow: hidden;
}
img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    border-radius: 8px;
}

/* ---- Buttons ---- */
.zoom-buttons,
.action-buttons {
    margin: 10px 0;
}
button {
    padding: 12px 24px;
    margin: 5px;
    border: none;
    border-radius: 8px;
    background-color: #4a90e2;
    color: #fff;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
button:hover:not(:disabled) {
    background-color: #357abd;
    transform: scale(1.05);
}
button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* ---- Responsive ---- */
@media (max-width: 680px) {
    #image-container {
        width: 100%;
        height: 300px;
    }
    .mode-selector {
        flex-direction: column;
        gap: 8px;
    }
    button {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}
