body {
  font-family: sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

header {
  background: #f0f0f0;
  width: 100%;
  text-align: center;
  padding: 1rem 0;
}

.twibbon-app {
  margin: 5rem auto;
	padding: 2rem;
  width: 600px;
  box-sizing: border-box; 
}

.canvas-container {
    /* Pastikan container kanvas mengisi lebar twibbon-app */
    width: 100%;
    margin-bottom: 0.5rem; 
}

.canvas-sizer {
    width: 100%;
    padding-bottom: 100%; 
    position: relative;
    overflow: hidden;
}

.canvas-wrapper {
    position: absolute; 
    top: 0;
    left: 0;
    width: 100%; 
    height: 100%;
    
    display: flex;
    justify-content: center;
    align-items: center;
    
    cursor: pointer;
    
    border: 1px solid #ccc; 
    box-sizing: border-box; 
}

canvas {
  width: 100%; 
  height: 100%; 
  display: block;
  border: none; 
}

/* STYLE UNTUK DROP AREA/OVERLAY */
.drop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    box-sizing: border-box; 
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 1.2rem;
    text-align: center;
    
    border: 3px dashed transparent; 
    transition: opacity 0.3s, background-color 0.2s;
    z-index: 10;
}

/* KELAS: Untuk menampilkan border dotted/dashed saat siap unggah */
.drop-ready {
    border: 3px dashed #999; 
}

/* Visual Feedback saat file diseret */
.drag-over {
    border: 3px dashed #1e90ff; 
    background-color: rgba(173, 216, 230, 0.7); 
}

/* Kelas untuk menonaktifkan drop area (setelah gambar diunggah) */
.drop-disabled {
    opacity: 0;
    pointer-events: none; 
}

.drop:hover {
  background-color: bisque;
}

img {
  width: 100%;
  height: auto;
}

/* --- Pengaturan Tombol (Menggunakan Flexbox) --- */
.controls {
  margin-top: 1rem;
  display: flex; 
  gap: 0.5rem;   
  width: 100%;  
}

.controls button {
  margin: 0; 
  padding: 0; 
  font-size: 1rem;
}

/* 1. Tombol Twibbon: fleksibel, mengisi sisa ruang */
#btnTwibbon {
  flex-grow: 1; 
  padding: 0.5rem 1rem; 
}

/* 2 & 3. Tombol Unduh & Bagikan: 40x40 persegi */
#btnDownload, #btnShare {
  width: 40px; 
  min-width: 40px; 
  height: 40px; 
  flex-shrink: 0; 
  
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem; 
}

/* ALERT dinamis tanpa geser layout */
#alert {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  backdrop-filter: blur(6px);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 9999;
  border: 1px solid rgba(255, 255, 255, 0.25);
	white-space: nowrap;
	text-overflow: ellipsis;
	overflow: hidden;
	max-width: 90vw;
}

/* efek muncul */
#alert.show {
  opacity: 1;
}

/* Warna teks dinamis */
#alert.info { color: #d9edf7; }       /* biru lembut */
#alert.success { color: #dff0d8; }    /* hijau terang */
#alert.warning { color: #fcf8e3; }    /* kuning */
#alert.error { color: #f2dede; }      /* merah */

@media (max-width: 700px) {
	.twibbon-app {
      margin: 0 auto;
      width: auto;
    }
  }
