:root {
  --accent: #7C3AED;
  --accent2: #C026D3;
  --bg: #08080F;
  --bg2: #0F0F1A;
  --bg3: #16162A;
  --border: #1E1E35;
  --text: #F0F0FF;
  --muted: #7070A0;
  --dim: #35354A;
  --safe-top: env(safe-area-inset-top, 20px);
  --safe-bot: env(safe-area-inset-bottom, 20px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body, html { width: 100%; height: 100%; background: var(--bg); color: var(--text); font-family: 'DM Sans', sans-serif; overflow: hidden; }

/* LAYOUT */
#app { width: 100%; height: 100%; position: relative; }
.screen { position: absolute; inset: 0; display: none; flex-direction: column; background: var(--bg); }
.screen.active { display: flex; }
.scroll-area { flex: 1; overflow-y: auto; padding: 20px; padding-bottom: 100px; }

/* TYPOGRAPHY */
.page-title { font-family: 'Syne', sans-serif; margin-top: 40px; font-weight: 800; }
.subtitle { color: var(--muted); margin-bottom: 20px; }
.small-text { font-size: 11px; color: var(--muted); }

/* AUTH SCREEN */
#auth-screen { justify-content: center; padding: 40px; background: radial-gradient(circle at top right, #1e0b3b, var(--bg)); }
.auth-header { text-align: center; margin-bottom: 40px; }
.logo-icon { width: 70px; height: 70px; background: linear-gradient(135deg, var(--accent), var(--accent2)); border-radius: 20px; display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 800; margin: 0 auto 15px; font-family: 'Syne'; box-shadow: 0 10px 30px rgba(124, 58, 237, 0.4); }
.logo-text { font-family: 'Syne'; font-size: 28px; letter-spacing: 4px; font-weight: 800; }

.auth-card { background: var(--bg2); border: 1px solid var(--border); padding: 25px; border-radius: 24px; }
.tabs { display: flex; background: var(--bg); padding: 5px; border-radius: 12px; margin-bottom: 25px; }
.tab-btn { flex: 1; padding: 10px; border: none; background: none; color: var(--muted); font-weight: 700; border-radius: 8px; cursor: pointer; transition: 0.2s; }
.tab-btn.active { background: var(--accent); color: white; }

.input-group { margin-bottom: 15px; }
.input-group label { display: block; font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 5px; letter-spacing: 1px; }
.input-group input { width: 100%; background: var(--bg3); border: 1px solid var(--border); padding: 14px; border-radius: 12px; color: white; outline: none; }
.main-btn { width: 100%; padding: 16px; background: var(--accent); border: none; border-radius: 12px; color: white; font-weight: 700; font-family: 'Syne'; cursor: pointer; margin-top: 10px; }
#auth-msg { text-align: center; font-size: 12px; margin-top: 15px; color: #ff4d4d; min-height: 15px; }

/* COMPONENTS */
.post-card { background: var(--bg2); border: 1px solid var(--border); padding: 15px; border-radius: 16px; margin-bottom: 12px; }
.gradient-card { background: linear-gradient(135deg, #1e1e35, #08080f); margin-top: 20px; }
.user-tag { color: var(--accent2); font-weight: 700; font-size: 13px; font-family: 'Syne'; }
.post-content { margin-top: 5px; font-size: 14px; line-height: 1.4; }

/* PROGRESS BAR */
.progress-bar-bg { height: 6px; background: var(--bg); border-radius: 3px; margin: 10px 0; }
.progress-bar-fill { width: 30%; height: 100%; background: var(--accent); border-radius: 3px; }

/* FAB BUTTON */
.fab-btn { position: fixed; bottom: 90px; right: 20px; width: 56px; height: 56px; border-radius: 28px; background: var(--accent); border: none; color: white; font-size: 24px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); z-index: 100; cursor: pointer; }

/* CHAT */
.ai-header { padding: 50px 20px 15px; border-bottom: 1px solid var(--border); }
.chat-area { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.chat-bubble { padding: 12px 16px; border-radius: 16px; max-width: 85%; line-height: 1.4; font-size: 14px; }
.chat-bubble.ai { background: var(--bg3); align-self: flex-start; border-bottom-left-radius: 4px; border: 1px solid var(--border); }
.chat-bubble.user { background: var(--accent); align-self: flex-end; border-bottom-right-radius: 4px; }
.input-area { padding: 15px; background: var(--bg2); display: flex; gap: 10px; border-top: 1px solid var(--border); padding-bottom: calc(70px + var(--safe-bot)); }
.input-area input { flex: 1; background: var(--bg); border: 1px solid var(--border); color: white; padding: 12px; border-radius: 12px; outline: none; }
.input-area button { background: var(--accent); border: none; color: white; padding: 0 20px; border-radius: 12px; font-weight: 700; cursor: pointer; }

/* NAV */
#nav { position: fixed; bottom: 0; width: 100%; height: calc(65px + var(--safe-bot)); background: rgba(15, 15, 26, 0.9); backdrop-filter: blur(20px); border-top: 1px solid var(--border); display: none; justify-content: space-around; align-items: center; padding-bottom: var(--safe-bot); z-index: 1000; }
.nav-item { display: flex; flex-direction: column; align-items: center; color: var(--muted); font-size: 10px; font-weight: 700; cursor: pointer; }
.nav-item.active { color: var(--accent); }
.nav-icon { font-size: 22px; margin-bottom: 4px; }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 2000; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal-content { background: var(--bg2); width: 100%; max-width: 400px; padding: 20px; border-radius: 20px; border: 1px solid var(--border); }
.modal-content textarea { width: 100%; height: 100px; background: var(--bg); border: 1px solid var(--border); color: white; padding: 10px; border-radius: 10px; margin: 15px 0; outline: none; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions button { flex: 1; padding: 12px; border-radius: 10px; border: none; background: var(--bg3); color: white; cursor: pointer; }
.modal-actions button.primary { background: var(--accent); }
