:root {
  --sidebar-bg: #ffffff;
  --preview-bg: #e2e8f0;
  --primary: #2563eb;
  --text: #1e293b;
  --border: #cbd5e1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  height: 100vh;
  overflow: hidden; /* Mencegah scroll body, kita scroll sidebar saja */
}

.app-container {
  display: flex;
  height: 100%;
}

/* Sidebar Styles */
.sidebar {
  width: 350px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  overflow-y: auto;
  flex-shrink: 0;
  z-index: 10;
}

.sidebar-header h2 a {
  text-decoration: none;
  color: var(--primary);
  font-weight: 800;
}

.sidebar-header p {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
}

.controls {
  margin: 2rem 0;
  flex: 1;
}

.control-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text);
}

input[type="text"],
input[type="file"] {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

input[type="range"] {
  width: 100%;
}

.color-picker {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Actions Buttons */
.actions {
  display: flex;
  gap: 10px;
  margin-bottom: 1rem;
}

.btn-action {
  flex: 1;
  padding: 0.8rem;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.btn-action:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.btn-action.primary {
  background: var(--primary);
  color: white;
}
.btn-action.secondary {
  background: var(--text);
  color: white;
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
}
.sidebar-footer a {
  color: #64748b;
  text-decoration: none;
}

/* Preview Area */
.preview-area {
  flex: 1;
  background: var(--preview-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  overflow: auto;
  position: relative;
}

#canvas-wrapper {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  background: white; /* Placeholder background */
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 100%;
  max-height: 100%;
}

canvas {
  max-width: 100%;
  max-height: 90vh;
  display: none; /* Hidden until image loaded */
}

/* --- TAMBAHAN STYLE BARU --- */

/* Style untuk Quick Chips (Template Teks) */
.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover {
  background: #e2e8f0;
  color: var(--primary);
  border-color: var(--primary);
}

/* --- Update Style Toggle --- */
.toggle-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toggle-group {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  transition: 0.2s;
}

.toggle-group:hover {
  border-color: var(--primary);
  background: #f1f5f9;
}

.toggle-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}

.toggle-group label {
  margin: 0;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

/* --- Style untuk Preset Layout Buttons --- */
.preset-container {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.btn-preset {
  flex: 1; /* Agar lebar tombol rata */
  padding: 8px;
  border: 1px solid #cbd5e1;
  background: white;
  color: var(--text);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-preset:hover {
  background: #f8fafc;
  border-color: var(--primary);
}

/* State Aktif (Tombol yang dipilih) */
.btn-preset.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* --- Tambahan Style untuk Tombol Premium --- */
.btn-preset.premium-btn {
  border-color: #f59e0b; /* Warna Amber/Emas */
  color: #b45309;
  background: #fffbeb;
}

.btn-preset.premium-btn:hover {
  background: #fef3c7;
}

.btn-preset.premium-btn.active {
  background: #f59e0b; /* Background Emas saat aktif */
  color: white;
  border-color: #d97706;
}

/* --- Style untuk Wrapper Teks & Tanggal --- */
.text-date-wrapper {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.input-main {
  flex: 2; /* Teks utama lebih lebar */
}

.input-date {
  flex: 1; /* Input tanggal lebih kecil */
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  color: var(--text);
}

/* Responsive Mobile */
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
    overflow: auto;
  }
  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .preview-area {
    min-height: 50vh;
  }
}
