/* CSS RESET & VARIABLES */
:root {
  /* LIGHT MODE (Default) */
  --bg-dark: #f9fafb; 
  --bg-panel: #ffffff; 
  --bg-hover: #f3f4f6;
  --text-main: #111827; 
  --text-muted: #6b7280;
  --accent: #8b5cf6; 
  --accent-glow: rgba(139, 92, 246, 0.1);
  --danger: #ef4444; 
  --success: #10b981;
  --border: rgba(0, 0, 0, 0.1);
  --rad: 16px;
}

[data-theme="dark"] {
  /* DARK MODE */
  --bg-dark: #0a0a0c; 
  --bg-panel: #141418; 
  --bg-hover: #1f1f26;
  --text-main: #f3f4f6; 
  --text-muted: #9ca3af;
  --accent: #8b5cf6; 
  --accent-glow: rgba(139, 92, 246, 0.2);
  --danger: #ef4444; 
  --success: #10b981;
  --border: rgba(255, 255, 255, 0.08);
}
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background: var(--bg-dark); color: var(--text-main); height: 100vh; overflow: hidden; display: flex; }

/* SIDEBAR */
.sidebar { width: 280px; background: var(--bg-panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 24px; }
.logo { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; }
.logo-icon { width: 40px; height: 40px; background: linear-gradient(135deg, var(--accent), #c084fc); border-radius: 12px; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 15px var(--accent-glow); }
.logo-icon svg { width: 22px; height: 22px; fill: white; }
.logo-text { font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 1.4rem; letter-spacing: 0.5px; }

.nav-menu { display: flex; flex-direction: column; gap: 8px; margin-bottom: 40px; }
.nav-item { padding: 14px 16px; border-radius: 12px; cursor: pointer; display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-weight: 500; transition: all 0.2s; border: 1px solid transparent; }
.nav-item:hover { background: rgba(255,255,255,0.03); color: var(--text-main); }
.nav-item.active { background: var(--accent-glow); border-color: rgba(139, 92, 246, 0.3); color: var(--accent); }

.stats-card { background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.stats-label { color: var(--text-muted); font-size: 0.9rem; }
.stats-val { font-family: 'Outfit', sans-serif; font-size: 1.2rem; font-weight: 600; color: var(--text-main); }

/* MAIN CONTENT AREAS */
.content-area { flex: 1; display: flex; flex-direction: column; height: 100vh; position: relative; }
.view-section { display: none; flex-direction: column; height: 100%; animation: fadeIn 0.3s ease; }
.view-section.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- VOICENOTE UI --- */
.vn-header { padding: 30px 40px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.vn-title { font-family: 'Outfit', sans-serif; font-size: 1.8rem; font-weight: 600; }
.vn-body { flex: 1; padding: 40px; overflow-y: auto; display: flex; flex-direction: column; align-items: center; }

.mic-btn { width: 100px; height: 100px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #c084fc); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 30px var(--accent-glow); transition: all 0.3s; margin-bottom: 30px; }
.mic-btn:hover { transform: scale(1.05); }
.mic-btn.recording { animation: pulse 1.5s infinite; background: var(--danger); box-shadow: 0 10px 30px rgba(239, 68, 68, 0.3); }
@keyframes pulse { 0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); } 70% { transform: scale(1.1); box-shadow: 0 0 0 20px rgba(239, 68, 68, 0); } 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
.mic-btn svg { width: 40px; height: 40px; fill: white; }

.status-text { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 40px; min-height: 24px; }

.reminders-list { width: 100%; max-width: 700px; display: flex; flex-direction: column; gap: 16px; }
.reminder-item { background: var(--bg-panel); border: 1px solid var(--border); padding: 20px; border-radius: 12px; display: flex; justify-content: space-between; align-items: center; transition: transform 0.2s; }
.reminder-item:hover { border-color: rgba(255,255,255,0.15); transform: translateY(-2px); }
.reminder-info h3 { font-size: 1.1rem; font-weight: 500; margin-bottom: 6px; }
.reminder-info p { color: var(--text-muted); font-size: 0.9rem; }
.reminder-actions { display: flex; gap: 12px; }
.btn-icon { background: rgba(255,255,255,0.05); border: 1px solid var(--border); color: var(--text-main); width: 36px; height: 36px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.btn-icon:hover { background: rgba(255,255,255,0.1); }
.btn-icon.done:hover { background: rgba(16, 185, 129, 0.2); color: var(--success); border-color: var(--success); }
.btn-icon.delete:hover { background: rgba(239, 68, 68, 0.2); color: var(--danger); border-color: var(--danger); }
.completed { opacity: 0.5; text-decoration: line-through; }

/* --- CHATBOT UI --- */
.chat-area { flex: 1; overflow-y: auto; padding: 40px; display: flex; flex-direction: column; gap: 24px; scroll-behavior: smooth; }
.chat-area::-webkit-scrollbar { width: 6px; } .chat-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
.msg-row { display: flex; width: 100%; }
.msg-row.user { justify-content: flex-end; }
.msg { max-width: 80%; padding: 16px 20px; border-radius: 16px; font-size: 0.95rem; line-height: 1.6; }
.msg.user { background: var(--text-main); color: var(--bg-dark); border-bottom-right-radius: 4px; font-weight: 500; }
.msg.bot { background: var(--bg-panel); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg p:last-child { margin-bottom: 0; }

.msg-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.msg-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.2s;
    padding-left: 8px;
}

.msg-row:hover .msg-actions {
    opacity: 1;
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 1rem;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.action-btn:hover {
    color: var(--text-main);
    background: var(--bg-hover);
}

.chat-input-container { padding: 24px 40px; border-top: 1px solid var(--border); background: var(--bg-dark); }
.chat-input-wrapper { display: flex; align-items: flex-end; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 20px; padding: 8px 12px; transition: border-color 0.2s; }
.chat-input-wrapper:focus-within { border-color: var(--accent); }
.chat-input { flex: 1; background: transparent; border: none; color: var(--text-main); font-size: 0.95rem; padding: 12px; resize: none; outline: none; min-height: 48px; max-height: 150px; }
.send-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); border: none; color: white; display: flex; align-items: center; justify-content: center; cursor: pointer; margin-left: 10px; transition: 0.2s; }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.send-btn:not(:disabled):hover { transform: scale(1.05); box-shadow: 0 4px 15px var(--accent-glow); }
.send-btn svg { width: 20px; height: 20px; fill: white; }

.typing-dot { width: 6px; height: 6px; background: var(--text-muted); border-radius: 50%; animation: pulse-dot 1.4s infinite ease-in-out both; display: inline-block; margin-right: 4px; }
.typing-dot:nth-child(1) { animation-delay: -0.32s; } .typing-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes pulse-dot { 0%, 80%, 100% { transform: scale(0); opacity: 0.3; } 40% { transform: scale(1); opacity: 1; } }

/* Toast */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--success); color: white; padding: 12px 24px; border-radius: 8px; font-weight: 500; opacity: 0; transform: translateY(20px); transition: 0.3s; }
.toast.show { opacity: 1; transform: translateY(0); }
