/* CSS Variables */
:root {
  --primary-color: #025c68;
  --primary-color-light: rgba(107, 78, 255, 0.1);
  --success-color-alt: #4ade80; 
  --pin-color: #f59e0b; 
  --sidebar-bg: #000000;
  --main-bg: #13133b;
  --card-bg: #000835;
  --text-color: #F8F8F2;
  --text-color-secondary: #BD93F9;
  --text-color-muted: #6272A4;
  --border-color: #44475A;
  --error-color: #FF5555;
  --success-color: #fa5050;
  --sidebar-width: 450px;
  --header-height: 90px;
  
  /* --- VARIABEL BARU UNTUK EFEK NEON --- */
  --neon-blue: #00ffff;
  --neon-blue-glow: rgba(0, 255, 255, 0.7);
}

[data-theme="light"] {
  --primary-color: #007bff;
  --primary-color-light: rgba(0, 123, 255, 0.1);
  --success-color-alt: #28a745;
  --pin-color: #ffc107;
  --sidebar-bg: #ffffff;
  --main-bg: #f4f7fc;
  --card-bg: #ffffff;
  --text-color: #212529;
  --text-color-secondary: #0056b3;
  --text-color-muted: #6c757d;
  --border-color: #dee2e6;
  
  /* --- Warna neon untuk tema terang --- */
  --neon-blue: #007bff;
  --neon-blue-glow: rgba(0, 123, 255, 0.7);
}

/* Base Styles */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: var(--main-bg); color: var(--text-color); display: flex; transition: background-color 0.3s, color 0.3s; }

/* --- Transisi Halus untuk Semua Ikon --- */
i, [class^="fa-"], [class*=" fa-"] {
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

/* Sidebar */
.sidebar { width: var(--sidebar-width); height: 100vh; background-color: var(--sidebar-bg); position: fixed; top: 0; left: 0; display: flex; flex-direction: column; padding: 20px 15px; border-right: 1px solid var(--border-color); transition: background-color 0.3s; z-index: 100; }
.sidebar-header { padding: 10px 15px; margin-bottom: 20px; display: flex; justify-content: center; }
.user-profile { display: flex; flex-direction: column; align-items: center; gap: 12px; cursor: pointer; padding: 10px; border-radius: 8px; transition: background-color 0.2s; text-align: center; }
.user-profile:hover { background-color: var(--main-bg); }
.user-profile img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid var(--primary-color); }
.user-info span { display: block; font-weight: 600; font-size: 18px; }
.user-info small { font-size: 13px; color: var(--text-color-muted); }

.sidebar-menu { flex-grow: 1; overflow-y: auto; }
.menu-header { font-size: 12px; font-weight: 600; color: var(--text-color-muted); text-transform: uppercase; letter-spacing: 1px; padding: 0 15px 10px 15px; }
#menuList { display: flex; flex-direction: column; gap: 5px; }

.sidebar-link { display: flex; align-items: center; justify-content: space-between; padding: 12px 15px; border-radius: 8px; color: var(--text-color-muted); text-decoration: none; font-weight: 500; transition: all 0.2s ease-in-out; position: relative; cursor: pointer; }
.menu-item-main { display: flex; align-items: center; }
.menu-item-main i { width: 20px; margin-right: 15px; font-size: 16px; text-align: center; }
.menu-item-main span {
    font-size: 16px; 
    letter-spacing: 2px;
}

.sidebar-link:hover { background-color: var(--primary-color-light); }
.sidebar-link.active { background-color: var(--primary-color); color: #fff; box-shadow: 0 4px 10px rgba(107, 78, 255, 0.3); }
.menu-actions { margin-left: auto; display: flex; gap: 5px; }
.menu-btn { background: none; border: none; color: inherit; cursor: pointer; opacity: 0; transition: opacity 0.2s; padding: 5px; font-size: 14px; }
.sidebar-link:hover .menu-btn { opacity: 0.6; }
.menu-btn:hover { opacity: 1 !important; }
.menu-btn.pin-btn .fa-solid { color: var(--pin-color); }
.sidebar-link.active .menu-btn { opacity: 0.8; }
.sidebar-link.active .menu-btn:hover { opacity: 1; }

.add-menu-btn { margin-top: 8px; border: 1px dashed var(--border-color); justify-content: center; color: var(--text-color-muted); }
.add-menu-btn:hover { border-style: solid; }
.sidebar-footer { padding-top: 20px; border-top: 1px solid var(--border-color); }

.logout-btn {
  background-color: var(--error-color);
  color: #fff;
  justify-content: center;
  animation: blinkRed 2.5s ease-in-out infinite;
}
.logout-btn:hover {
  background-color: #ff7777;
  color: #fff;
}

/* Main Content */
.main-content { flex: 1; margin-left: var(--sidebar-width); padding: 0 30px; }
.header { height: var(--header-height); display: flex; justify-content: space-between; align-items: center; }
.header-title h2 { font-size: 24px; font-weight: 700; color: var(--text-color); margin: 0; letter-spacing: 2px; }
.header-title p { font-size: 14px; color: var(--text-color-muted); margin: 0; }
.header-actions { display: flex; align-items: center; gap: 15px; }
.action-btn { background: var(--card-bg); border: 1px solid var(--border-color); color: var(--text-color-muted); width: 40px; height: 40px; border-radius: 50%; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease-in-out; }
.add-memo-btn-main { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }
.search-container { position: relative; display: flex; align-items: center; }
.search-container i { position: absolute; left: 15px; color: var(--text-color-muted); }
.search-box { width: 250px; padding: 10px 15px 10px 40px; border-radius: 20px; border: 1px solid var(--border-color); background-color: var(--card-bg); color: var(--text-color); transition: all 0.2s ease-in-out; }
.search-box:focus { outline: none; border-color: var(--primary-color); width: 300px; }

/* Konten Kartu Memo */
.content-body { padding: 10px 0; background: none; border: none; }
#memoContainer { display: flex; flex-direction: column; gap: 20px; }
.memo-item { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; transition: all 0.3s; }
.memo-item:hover { box-shadow: 0 5px 15px rgba(0,0,0,0.2); border-color: var(--primary-color); }
.memo-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid var(--border-color); }
.memo-title { font-weight: 700; color: var(--success-color-alt); font-size: 1.1rem; }
.memo-actions { display: flex; gap: 10px; }
.memo-action-btn { background: none; border: none; cursor: pointer; color: var(--text-color-muted); font-size: 16px; padding: 5px; border-radius: 4px; transition: all 0.2s; }
.memo-body { padding: 20px; }
.copy-container { display: flex; align-items: flex-start; gap: 15px; }
.copy-btn { background: var(--success-color-alt); border: none; color: #1A1C23; border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; transition: all 0.3s; flex-shrink: 0; }
.copy-btn:hover { opacity: 0.8; }
.memo-desc { color: var(--text-color); line-height: 1.6; }
.memo-footer { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; border-top: 1px solid var(--border-color); font-size: 12px; color: var(--text-color-muted); }
.memo-empty { text-align:center; padding:50px; color:var(--text-color-muted); background-color: var(--card-bg); border-radius: 8px; }

/* Modal dan lain-lain */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.7); backdrop-filter: blur(5px); display: flex; justify-content: center; align-items: center; z-index: 1000; opacity: 0; visibility: hidden; transition: all 0.3s; }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content { background-color: var(--card-bg); border: 1px solid var(--border-color); width: 90%; max-width: 500px; /* Lebar disesuaikan */ border-radius: 8px; box-shadow: 0 5px 20px rgba(0,0,0,0.2); transform: translateY(-20px); transition: all 0.3s; }
.modal-overlay.active .modal-content { transform: translateY(0); }
.modal-header, .modal-body, .modal-footer { padding: 20px; }
.modal-header { border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.modal-footer { border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 10px; }
.modal-title { font-weight: 600; font-size: 18px; }
.form-group { margin-bottom: 15px; }
.form-label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--text-color-muted); }
.form-input { width: 100%; padding: 10px; border-radius: 6px; background-color: var(--main-bg); border: 1px solid var(--border-color); color: var(--text-color); }
.form-input:focus { outline: none; border-color: var(--primary-color); background-color: var(--card-bg); }
.form-textarea { min-height: 120px; resize: vertical; }
#rumusResult { font-family: 'Courier New', Courier, monospace; line-height: 1.6; background-color: var(--main-bg); }
.btn { padding: 10px 20px; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; }
.btn-primary { background-color: var(--primary-color); color: #fff; }
.btn-secondary { background-color: var(--border-color); color: var(--text-color); }

/* Styles for input with icon button */
.input-with-icon { position: relative; display: flex; align-items: center; }
.input-with-icon .form-input { padding-right: 40px; }
.input-icon-btn { position: absolute; right: 1px; top: 1px; bottom: 1px; width: 38px; background: none; border: none; color: var(--text-color-muted); cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; transition: color 0.2s; }

.profile-modal { position: fixed; top: 140px; left: calc(var(--sidebar-width) + 15px); background-color: var(--sidebar-bg); border: 1px solid var(--border-color); box-shadow: 0 10px 30px rgba(0,0,0,0.2); z-index: 1001; border-radius: 8px; overflow: hidden; display: none; }
.profile-modal.active { display: block; }
.profile-modal-content { width: 220px; }
.profile-modal-body { padding: 10px 0; }
.profile-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; border-bottom: 1px solid var(--border-color); }
.profile-modal-header span { font-weight: 600; color: var(--text-color); }
.profile-modal .close-btn { background: none; border: none; color: var(--text-color-muted); cursor: pointer; font-size: 20px; padding: 0 5px; }
.profile-option-btn { display: block; width: 100%; padding: 12px 15px; background: none; border: none; text-align: left; color: var(--text-color); cursor: pointer; font-size: 14px; transition: background-color 0.2s, color 0.2s; }
.profile-option-btn:hover { background-color: var(--primary-color-light); color: var(--neon-blue); }

/* Notifikasi */
.notification { position: fixed; background: var(--success-color); color: #111; font-weight: 600; right: 30px; bottom: 30px; z-index: 1100; padding: 12px 20px; border-radius: 6px; box-shadow: 0 3px 10px rgba(0,0,0,0.2); display: flex; align-items: center; gap: 10px; transform: translateX(calc(100% + 40px)); transition: transform 0.4s ease-in-out; }
.notification.show { transform: translateX(0); }
.notification.error { background-color: var(--error-color); color: #fff; }

@keyframes blinkRed {
  0%, 100% { background-color: var(--error-color); box-shadow: 0 0 4px rgba(255, 85, 85, 0.5); }
  50% { background-color: #ff7777; box-shadow: 0 0 12px rgba(255, 85, 85, 0.8); }
}

/* --- EFEK NEON UNTUK SEMUA IKON SAAT HOVER --- */

/* Ini adalah selector gabungan untuk semua ikon yang ingin diberi efek */
.sidebar-link:hover .menu-item-main i,
.menu-btn:hover,
.action-btn:hover,
.memo-action-btn:hover,
.input-icon-btn:hover,
.close-btn:hover,
.profile-option-btn:hover i,
.add-menu-btn:hover i,
.copy-btn:hover i {
  color: var(--neon-blue);
  text-shadow: 0 0 5px var(--neon-blue), 
               0 0 10px var(--neon-blue-glow);
}

/* Penyesuaian khusus untuk beberapa tombol agar lebih konsisten */

.action-btn:hover,
.add-menu-btn:hover {
  border-color: var(--neon-blue);
}

.close-btn { transition: transform 0.3s ease; }
.close-btn:hover {
  background: none; /* Hapus background merah agar efek neon terlihat jelas */
  transform: rotate(90deg);
}

/* Efek khusus untuk ikon di dalam tombol logout agar tidak bentrok dengan animasi merah */
.logout-btn:hover i {
  color: #fff; /* Biarkan warna ikon putih */
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.7); /* Beri efek glow putih */
}