@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; -webkit-tap-highlight-color: transparent; }

body {
  background: #020617; color: #e2e8f0; height: 100vh; overflow: hidden; display: flex;
}

/* --- TOAST NOTIFICATIONS --- */
#toastContainer {
  position: fixed; top: 20px; right: 20px; z-index: 1000;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: #1e293b; color: white; padding: 12px 20px; border-radius: 8px;
  border-left: 4px solid #3b82f6; box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  font-size: 14px; animation: slideIn 0.3s ease-out; display: flex; align-items: center; gap: 10px;
}
.toast.success { border-color: #22c55e; }
.toast.error { border-color: #ef4444; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* --- AUTH --- */
.auth-container { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at top left, #1e1b4b, #020617); padding: 20px; }
.glass-card { background: rgba(255, 255, 255, 0.03); backdrop-filter: blur(10px); padding: 30px; border-radius: 20px; border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 0 30px rgba(59, 130, 246, 0.2); text-align: center; width: 100%; max-width: 350px; }
.glass-card h1 span { color: #3b82f6; text-shadow: 0 0 10px #3b82f6; }
.glass-card p { color: #94a3b8; margin-bottom: 25px; font-size: 14px; }
.auth-footer { margin-top: 15px; font-size: 13px; color: #94a3b8; }
.auth-footer a { color: #3b82f6; cursor: pointer; text-decoration: none; margin: 0 5px; }
.auth-footer a:hover { text-decoration: underline; }

input { width: 100%; padding: 14px; margin: 8px 0; background: rgba(0, 0, 0, 0.3); border: 1px solid #334155; border-radius: 8px; color: white; outline: none; transition: 0.3s; }
input:focus { border-color: #3b82f6; }

/* --- LAYOUT --- */
main { display: flex; width: 100%; height: 100%; position: relative; }
.hidden { display: none !important; }
.mobile-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 90; opacity: 0; pointer-events: none; transition: 0.3s; }
.mobile-overlay.show { opacity: 1; pointer-events: auto; }

/* --- SIDEBAR --- */
.sidebar { width: 280px; background: #0f172a; border-right: 1px solid #1e293b; display: flex; flex-direction: column; padding: 20px; transition: transform 0.3s; z-index: 100; }
.sidebar-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.brand span { color: #ef4444; }
.btn-create { width: 100%; padding: 12px; background: linear-gradient(90deg, #3b82f6, #2563eb); border: none; border-radius: 8px; color: white; font-weight: 600; cursor: pointer; margin-bottom: 20px; }
.inbox-list-label { font-size: 12px; color: #64748b; margin-bottom: 10px; font-weight: 600; }
#inboxList { list-style: none; flex: 1; overflow-y: auto; }
#inboxList li { padding: 12px; margin-bottom: 8px; border-radius: 8px; cursor: pointer; color: #94a3b8; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#inboxList li:hover { background: rgba(255,255,255,0.05); color: white; }
#inboxList li.active { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #ef4444; font-weight: 600; }
.sidebar-footer { margin-top: auto; padding-top: 20px; border-top: 1px solid #1e293b; }
.btn-logout { background: none; border: none; color: #64748b; cursor: pointer; }

/* --- CONTENT --- */
.content { flex: 1; display: flex; flex-direction: column; background: #020617; width: 100%; }
header { padding: 15px 20px; border-bottom: 1px solid #1e293b; display: flex; justify-content: space-between; align-items: center; background: rgba(15, 23, 42, 0.8); height: 70px; }
.header-left { display: flex; align-items: center; overflow: hidden; }
.current-info { overflow: hidden; }
.label { font-size: 10px; color: #3b82f6; font-weight: 800; display: block; }
.address-row { display: flex; align-items: center; gap: 8px; }
h2 { font-size: 16px; color: white; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Copy Button */
.btn-icon-only { background: none; border: none; color: #64748b; cursor: pointer; padding: 5px; font-size: 16px; transition: 0.2s; }
.btn-icon-only:hover { color: #3b82f6; transform: scale(1.1); }
.btn-icon-only:active { transform: scale(0.9); }

/* Toolbar & Messages */
.toolbar { padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; background: #0f172a; border-bottom: 1px solid #1e293b; }
.toolbar-btns { display: flex; gap: 8px; }
.btn-primary { background: #3b82f6; color: white; padding: 10px; border-radius:6px; width:100%; cursor:pointer; border:none;}
.btn-secondary { background: transparent; border: 1px solid #334155; color: #94a3b8; padding: 10px; border-radius:6px; width:100%; cursor:pointer;}
.btn-danger { background: #ef4444; color: white; padding: 8px 12px; border-radius:6px; cursor:pointer; border:none;}
.btn-danger-outline { background: transparent; border: 1px solid #ef4444; color: #ef4444; padding: 8px 12px; border-radius:6px; cursor:pointer; font-size: 12px; }
.btn-refresh { background: #1e293b; color: white; padding: 8px 12px; border:none; border-radius:6px; cursor:pointer; }
.check-group { display: flex; align-items: center; gap: 8px; color: #94a3b8; font-size: 14px; }
input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: #3b82f6; }

.message-list { flex: 1; overflow-y: auto; padding: 15px; }
.message-list li { background: #0f172a; border: 1px solid #1e293b; border-radius: 12px; padding: 15px; margin-bottom: 15px; list-style: none; position: relative; }
.msg-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.msg-title { font-size: 15px; font-weight: 700; color: #f8fafc; padding-right: 25px; word-break: break-word; }
.msg-from { font-size: 12px; color: #3b82f6; margin-top: 4px; word-break: break-all; }
.msg-body { background: #020617; padding: 12px; border-radius: 8px; font-family: monospace; font-size: 13px; color: #cbd5e1; border-left: 3px solid #ef4444; white-space: pre-wrap; word-break: break-word; }
.msg-checkbox { position: absolute; top: 15px; right: 15px; width: 18px; height: 18px; }
.empty { text-align: center; color: #475569; margin-top: 50px; background: none !important; border: none !important; }

/* Modals */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.8); display: none; align-items: center; justify-content: center; z-index: 300; backdrop-filter: blur(5px); padding: 20px; }
.modal.show { display: flex; }
.modal-box { background: #1e293b; padding: 25px; border-radius: 16px; width: 100%; max-width: 400px; border: 1px solid #334155; }
.modal-box h3 { color: white; margin-bottom: 15px; }
.modal-box .text-red { color: #ef4444; }
.modal-box .input-group { display: flex; align-items: center; gap: 5px; background: #020617; padding-right: 10px; border-radius: 8px; margin-bottom: 20px; border: 1px solid #334155; flex-wrap: wrap; }
.modal-box .input-group input { flex: 1; min-width: 120px; }
.modal-box .actions { display: flex; gap: 10px; justify-content: flex-end; }
.btn-text { background: none; border: none; color: #94a3b8; cursor: pointer; }
.mobile-menu-btn, .mobile-close-btn { display: none; background: none; border: none; color: white; font-size: 20px; cursor: pointer; }

@media (max-width: 768px) {
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; transform: translateX(-100%); width: 80%; max-width: 300px; box-shadow: 10px 0 30px rgba(0,0,0,0.5); }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu-btn, .mobile-close-btn { display: block; }
  .desktop-text { display: none; }
  h2 { max-width: 180px; }
}