* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: #121212;
    color: #e0e0e0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.app-container {
    background-color: #1e1e1e;
    padding: 24px;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

h1 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    text-align: center;
    color: #ffffff;
}

.input-group input[type="file"] {
    width: 100%;
    padding: 12px;
    background: #2a2a2a;
    border: 2px dashed #444;
    border-radius: 8px;
    color: #bbb;
    cursor: pointer;
}

.preview-box {
    background-color: #0b0b0b;
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 150px;
    max-height: 300px;
}

canvas {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.control-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.control-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-row label {
    font-size: 0.85rem;
    color: #aaa;
}

.control-row input, .control-row select {
    padding: 10px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    color: #fff;
    outline: none;
}

.checkbox-row {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.checkbox-row input {
    cursor: pointer;
}

.action-panel {
    display: flex;
    gap: 12px;
}

button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

#downloadBtn {
    background-color: #00adb5;
    color: #ffffff;
}

#downloadBtn:hover:not(:disabled) { background-color: #00888e; }

#supabaseBtn {
    background-color: #3ecf8e;
    color: #ffffff;
}

#supabaseBtn:hover:not(:disabled) { background-color: #2e9f6d; }

button:disabled {
    background-color: #333333 !important;
    color: #666666;
    cursor: not-allowed;
}
/* --- PENGATURAN DASAR WORKSPACE --- */
.workspace {
    display: flex;
    flex-direction: column; /* Default di HP menumpuk ke bawah */
    gap: 20px;
    margin-top: 20px;
}

.preview-box {
    margin: 0; /* Hapus margin atas/bawah bawaan agar rata */
    height: 100%;
}

/* 🔥 TAMPILAN PC / LAPTOP / TABLET (Layar Lebar) 🔥 */
@media (min-width: 768px) {
    .app-container {
        max-width: 850px; /* Perlebar kontainer utama dari 480px menjadi 850px agar leluasa */
    }

    .workspace {
        flex-direction: row; /* Belah layout jadi Kiri dan Kanan */
        align-items: flex-start; /* Sejajarkan ke atas */
    }

    .preview-section {
        flex: 1.2; /* Beri porsi ruang yang sedikit lebih besar untuk area gambar */
        position: sticky; /* Jika panel kanan terlalu panjang, gambar di kiri tetap diam saat di-scroll */
        top: 20px;
    }

    .control-section {
        flex: 1; /* Porsi ruang untuk panel kontrol */
    }

    /* Buat preview canvas lebih lega di PC */
    .preview-box {
        min-height: 250px;
        max-height: 400px;
    }

    canvas {
        max-height: 400px;
    }
}
