/* --- RESET & GLOBAL --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    height: 100vh; /* Full layar window */
    display: flex;
    flex-direction: column;
    background-color: #eef1f5;
    overflow: hidden; /* Hilangkan scroll body utama */
}

/* --- HEADER --- */
.control-bar {
    background: #ffffff;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 100;
    flex-shrink: 0; /* Header tidak boleh mengecil */
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-container {
    display: flex;
    gap: 10px;
    flex: 1;
    max-width: 600px;
    margin: 0 20px;
}

input[type="text"] {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
}

button {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

button:hover { background: #0056b3; }

select {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    cursor: pointer;
}

/* --- PREVIEW AREA (AREA KERJA) --- */
.preview-area {
    flex: 1; /* Mengisi sisa ruang di bawah header */
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Mulai dari atas, bukan tengah */
    overflow: auto; /* Scroll jika dizoom besar */
    padding: 20px;
    position: relative;
    width: 100%;
}

.phone-wrapper {
    /* Wrapper ini yang akan di-scale, bukan langsung bezelnya */
    transition: transform 0.3s ease;
    transform-origin: top center; /* Scale dari titik tengah atas */
    margin-bottom: 50px; /* Jarak aman bawah agar tidak mepet */
}

/* --- IPHONE FRAME CSS --- */
:root {
    --p-width: 390px;
    --p-height: 844px;
    --bezel: 12px;
    --radius: 45px;
}

.phone-bezel {
    width: calc(var(--p-width) + (var(--bezel) * 2));
    height: calc(var(--p-height) + (var(--bezel) * 2));
    background: #181818;
    border-radius: var(--radius);
    position: relative;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3), 0 0 0 3px #333 inset;
    flex-shrink: 0;
}

/* NOTCH */
.notch {
    position: absolute;
    top: var(--bezel);
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 30px;
    background: #181818;
    border-radius: 0 0 16px 16px;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}
.notch .speaker { width: 50px; height: 4px; background: #333; border-radius: 5px; }
.notch .camera { width: 8px; height: 8px; background: #111; border: 1px solid #333; border-radius: 50%; }

/* TOMBOL SAMPING */
.btn-side { position: absolute; background: #222; width: 4px; border-radius: 2px 0 0 2px; }
.vol-up { top: 100px; left: -4px; height: 45px; }
.vol-down { top: 155px; left: -4px; height: 45px; }
.power { top: 120px; right: -4px; height: 80px; border-radius: 0 2px 2px 0; }

/* SCREEN */
.screen {
    width: var(--p-width);
    height: var(--p-height);
    background: #fff;
    margin: var(--bezel);
    border-radius: calc(var(--radius) - var(--bezel));
    overflow: hidden;
    position: relative;
    z-index: 1;
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* HOME BAR */
.home-bar {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 130px;
    height: 5px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    z-index: 20;
    pointer-events: none;
}

/* Tambahkan di bagian HEADER css */
.auto-refresh-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    background: #f0f0f0;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    margin-left: 5px;
}

.auto-refresh-label input {
    cursor: pointer;
}