@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --red: #d32f2f;
    --red-light: #ff5252;
    --blue: #1565c0;
    --blue-light: #2979ff;
    --white: #ffffff;
    --bg: #0a0e1a;
    --bg2: #111827;
    --bg3: #1a2035;
    --card: #151d30;
    --border: rgba(255,255,255,0.08);
    --text: #e8eaf6;
    --text2: rgba(255,255,255,0.5);
    --text3: rgba(255,255,255,0.3);
    --gradient: linear-gradient(135deg, var(--red), var(--blue));
}

* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'Inter',sans-serif; background:var(--bg); color:var(--text); min-height:100vh; }
a { color:var(--blue-light); text-decoration:none; }
button { font-family:inherit; cursor:pointer; }
input, textarea { font-family:inherit; }
.hidden { display:none !important; }

/* ===== LAYOUT ===== */
#app { display:flex; min-height:100vh; }

.sidebar {
    width:240px; background:var(--bg2); border-right:1px solid var(--border);
    padding:1.5rem 1rem; display:flex; flex-direction:column; position:fixed;
    top:0; left:0; bottom:0; z-index:100;
}
.sidebar .logo {
    font-size:1.6rem; font-weight:900; background:var(--gradient);
    -webkit-background-clip:text; -webkit-text-fill-color:transparent;
    margin-bottom:2rem; text-align:center; cursor:pointer;
}
.sidebar nav { flex:1; display:flex; flex-direction:column; gap:0.25rem; }
.sidebar nav a, .sidebar nav button {
    display:flex; align-items:center; gap:0.75rem; padding:0.7rem 1rem; border-radius:12px;
    font-size:0.95rem; font-weight:500; color:var(--text); background:none; border:none;
    transition:background 0.2s; text-align:left; width:100%;
}
.sidebar nav a:hover, .sidebar nav button:hover { background:rgba(255,255,255,0.05); }
.sidebar nav a.active { background:rgba(41,121,255,0.15); color:var(--blue-light); }
.sidebar nav .icon { width:22px; text-align:center; font-size:1.1rem; }
.sidebar .user-section { border-top:1px solid var(--border); padding-top:1rem; margin-top:1rem; }
.sidebar .user-card {
    display:flex; align-items:center; gap:0.6rem; padding:0.5rem;
    border-radius:12px; cursor:pointer; transition:background 0.2s;
}
.sidebar .user-card:hover { background:rgba(255,255,255,0.05); }
.sidebar .user-card img { width:36px; height:36px; border-radius:50%; object-fit:cover; }

.main-content { flex:1; margin-left:240px; max-width:680px; padding:0 1rem; margin-right:auto; }
.page-header {
    padding:1.5rem 0 1rem; font-size:1.3rem; font-weight:700;
    display:flex; align-items:center; justify-content:space-between;
}

/* ===== BADGE ===== */
.notif-badge {
    background:var(--red); color:#fff; font-size:0.7rem; font-weight:700;
    padding:2px 6px; border-radius:10px; margin-left:auto; min-width:18px; text-align:center;
}

/* ===== POST CARD ===== */
.post-card {
    background:var(--card); border:1px solid var(--border); border-radius:16px;
    margin-bottom:1rem; overflow:hidden;
}
.post-header {
    display:flex; align-items:center; gap:0.65rem; padding:0.85rem 1rem; cursor:pointer;
}
.post-header img { width:40px; height:40px; border-radius:50%; object-fit:cover; }
.post-header .name { font-weight:600; font-size:0.95rem; }
.post-header .time { font-size:0.75rem; color:var(--text2); }
.post-image { width:100%; max-height:600px; object-fit:cover; display:block; background:#000; }
.post-audio {
    display:flex; align-items:center; gap:0.75rem; padding:0.7rem 1rem;
    background:rgba(255,255,255,0.03);
}
.play-btn {
    width:36px; height:36px; border-radius:50%; background:var(--gradient);
    border:none; color:#fff; font-size:0.9rem; display:flex; align-items:center;
    justify-content:center; flex-shrink:0; cursor:pointer;
}
.audio-wave { flex:1; height:32px; display:flex; align-items:center; gap:2px; }
.audio-wave .bar { width:3px; border-radius:2px; background:rgba(255,255,255,0.3); transition:background 0.2s; }
.audio-wave.playing .bar { background:var(--blue-light); }
.word-badge {
    font-size:0.75rem; color:var(--text2); white-space:nowrap;
    background:rgba(255,255,255,0.06); padding:4px 10px; border-radius:20px;
}
.post-caption { padding:0.5rem 1rem 0.25rem; font-size:0.9rem; line-height:1.5; }
.post-caption strong { cursor:pointer; }
.post-actions {
    display:flex; gap:0; padding:0.25rem 0.5rem; border-top:1px solid var(--border);
}
.post-actions button {
    flex:1; display:flex; align-items:center; justify-content:center; gap:0.4rem;
    padding:0.65rem; background:none; border:none; color:var(--text2);
    font-size:0.85rem; font-weight:500; transition:color 0.2s; cursor:pointer;
}
.post-actions button:hover { color:var(--text); }
.post-actions button.liked { color:var(--red-light); }
.post-actions .count { font-weight:600; }

/* ===== MUTED POST (Discord style) ===== */
.muted-bar {
    padding:0.75rem 1rem; background:rgba(255,255,255,0.03); color:var(--text3);
    font-size:0.8rem; cursor:pointer; text-align:center; transition:background 0.2s;
    border:1px solid var(--border); border-radius:16px; margin-bottom:1rem;
}
.muted-bar:hover { background:rgba(255,255,255,0.06); color:var(--text2); }
.muted-bar .reveal-icon { margin-left:0.5rem; font-size:0.7rem; }

/* ===== COMMENTS ===== */
.comments-section { padding:0 1rem 1rem; }
.comment {
    display:flex; gap:0.5rem; padding:0.5rem 0;
    border-top:1px solid var(--border); font-size:0.85rem;
}
.comment img { width:28px; height:28px; border-radius:50%; flex-shrink:0; object-fit:cover; }
.comment .comment-body { flex:1; }
.comment .comment-body strong { font-weight:600; margin-right:0.3rem; cursor:pointer; }
.comment-input {
    display:flex; gap:0.5rem; padding:0.6rem 1rem; border-top:1px solid var(--border);
}
.comment-input input {
    flex:1; background:rgba(255,255,255,0.05); border:1px solid var(--border);
    border-radius:20px; padding:0.5rem 1rem; color:var(--text); font-size:0.85rem; outline:none;
}
.comment-input input:focus { border-color:var(--blue-light); }
.comment-input button {
    background:var(--gradient); border:none; color:#fff; padding:0.5rem 1rem;
    border-radius:20px; font-weight:600; font-size:0.85rem;
}

/* ===== AUTH ===== */
.auth-overlay {
    position:fixed; inset:0; background:var(--bg); z-index:1000;
    display:flex; align-items:center; justify-content:center;
}
.auth-box {
    background:var(--card); border:1px solid var(--border); border-radius:20px;
    padding:2.5rem; width:100%; max-width:400px;
}
.auth-box .logo {
    font-size:2.5rem; font-weight:900; background:var(--gradient);
    -webkit-background-clip:text; -webkit-text-fill-color:transparent;
    text-align:center; margin-bottom:0.5rem;
}
.auth-box .tagline { text-align:center; color:var(--text2); margin-bottom:2rem; font-style:italic; }
.auth-box h2 { font-size:1.2rem; margin-bottom:1.5rem; text-align:center; }
.form-group { margin-bottom:1rem; }
.form-group label { display:block; font-size:0.8rem; font-weight:500; color:var(--text2); margin-bottom:0.3rem; }
.form-group input {
    width:100%; padding:0.75rem 1rem; border-radius:12px; border:1px solid var(--border);
    background:rgba(255,255,255,0.05); color:var(--text); font-size:0.95rem; outline:none;
}
.form-group input:focus { border-color:var(--blue-light); }
.btn-primary {
    width:100%; padding:0.85rem; border-radius:12px; border:none;
    background:var(--gradient); color:#fff; font-weight:700; font-size:1rem;
    margin-top:0.5rem; transition:opacity 0.2s; cursor:pointer;
}
.btn-primary:hover { opacity:0.9; }
.btn-primary:disabled { opacity:0.5; cursor:not-allowed; }
.btn-small {
    padding:0.4rem 1rem; border-radius:20px; font-weight:600; font-size:0.8rem;
    border:none; cursor:pointer; transition:all 0.2s;
}
.btn-danger { background:rgba(211,47,47,0.2); color:var(--red-light); border:1px solid rgba(211,47,47,0.3); }
.btn-danger:hover { background:rgba(211,47,47,0.3); }
.btn-mute { background:rgba(255,255,255,0.08); color:var(--text2); border:1px solid var(--border); }
.btn-mute:hover { background:rgba(255,255,255,0.12); }
.auth-switch { text-align:center; margin-top:1.5rem; font-size:0.85rem; color:var(--text2); }
.auth-switch a { color:var(--blue-light); cursor:pointer; font-weight:600; }
.auth-error {
    background:rgba(211,47,47,0.15); border:1px solid rgba(211,47,47,0.3);
    padding:0.6rem 1rem; border-radius:10px; font-size:0.85rem; color:#ff8a80;
    margin-bottom:1rem; text-align:center;
}

/* ===== CREATE POST ===== */
.create-post-card {
    background:var(--card); border:1px solid var(--border); border-radius:16px;
    padding:1.25rem; margin-bottom:1rem;
}
.create-post-card .top { display:flex; align-items:center; gap:0.75rem; }
.create-post-card .top img { width:42px; height:42px; border-radius:50%; object-fit:cover; }
.create-post-card .prompt {
    flex:1; padding:0.7rem 1rem; border-radius:20px; background:rgba(255,255,255,0.05);
    border:1px solid var(--border); color:var(--text2); font-size:0.9rem; cursor:pointer;
}
.create-post-card .prompt:hover { border-color:var(--blue-light); }

/* ===== MODALS ===== */
.modal-overlay {
    position:fixed; inset:0; background:rgba(0,0,0,0.7); z-index:500;
    display:flex; align-items:center; justify-content:center; padding:1rem;
}
.modal {
    background:var(--bg2); border:1px solid var(--border); border-radius:20px;
    width:100%; max-width:520px; max-height:90vh; overflow-y:auto;
}
.modal-header {
    display:flex; align-items:center; justify-content:space-between;
    padding:1rem 1.25rem; border-bottom:1px solid var(--border);
}
.modal-header h3 { font-size:1.1rem; }
.modal-close { background:none; border:none; color:var(--text2); font-size:1.5rem; cursor:pointer; }
.modal-body { padding:1.25rem; }
.modal-footer { padding:0 1.25rem 1.25rem; }
.modal-footer .btn-primary { margin-top:0; }

.image-upload {
    border:2px dashed var(--border); border-radius:16px; padding:2rem;
    text-align:center; cursor:pointer; transition:border-color 0.3s; margin-bottom:1rem;
}
.image-upload:hover { border-color:var(--blue-light); }
.image-upload.has-image { padding:0; border:none; }
.image-upload img { width:100%; border-radius:16px; display:block; }
.image-upload .placeholder { color:var(--text2); }
.image-upload .placeholder .icon { font-size:2.5rem; margin-bottom:0.5rem; }

.audio-record {
    display:flex; align-items:center; gap:0.75rem; padding:1rem;
    background:rgba(255,255,255,0.03); border-radius:12px; margin-bottom:1rem;
}
.record-btn {
    width:48px; height:48px; border-radius:50%; border:none;
    background:var(--red); color:#fff; font-size:1.2rem;
    display:flex; align-items:center; justify-content:center; transition:all 0.3s; cursor:pointer;
}
.record-btn.recording { animation:pulse-rec 1s ease-in-out infinite; background:#f44336; }
@keyframes pulse-rec { 0%,100%{transform:scale(1)} 50%{transform:scale(1.1)} }
.audio-record .info { flex:1; }
.audio-record .info .label { font-size:0.85rem; color:var(--text2); }
.audio-record .info .status { font-size:0.8rem; color:var(--text3); margin-top:2px; }
.audio-record audio { max-width:200px; height:32px; }

.caption-textarea {
    width:100%; min-height:80px; padding:0.75rem 1rem; border-radius:12px;
    border:1px solid var(--border); background:rgba(255,255,255,0.05);
    color:var(--text); font-size:0.9rem; resize:vertical; outline:none; margin-bottom:1rem;
}
.caption-textarea:focus { border-color:var(--blue-light); }

/* ===== PROFILE ===== */
.profile-header {
    display:flex; gap:2rem; align-items:center; padding:2rem 0;
    border-bottom:1px solid var(--border); margin-bottom:1rem;
}
.profile-header img { width:120px; height:120px; border-radius:50%; object-fit:cover; }
.profile-info { flex:1; }
.profile-info .username { font-size:1.5rem; font-weight:700; margin-bottom:0.25rem; }
.profile-info .bio { color:var(--text2); font-size:0.9rem; margin:0.75rem 0; }
.profile-stats { display:flex; gap:1.5rem; margin-top:0.75rem; }
.profile-stats .stat { text-align:center; }
.profile-stats .stat .num { font-weight:700; font-size:1.1rem; }
.profile-stats .stat .label { font-size:0.75rem; color:var(--text2); }
.profile-actions { display:flex; gap:0.5rem; margin-top:0.75rem; flex-wrap:wrap; }
.follow-btn {
    padding:0.5rem 1.5rem; border-radius:20px; font-weight:600; font-size:0.9rem;
    border:none; transition:all 0.2s; cursor:pointer;
}
.follow-btn.following { background:rgba(255,255,255,0.1); color:var(--text); }
.follow-btn.not-following { background:var(--gradient); color:#fff; }
.edit-profile-btn {
    padding:0.5rem 1.5rem; border-radius:20px; font-weight:600; font-size:0.9rem;
    border:1px solid var(--border); background:none; color:var(--text); cursor:pointer;
}

/* ===== MESSAGES ===== */
.convo-list-item {
    display:flex; align-items:center; gap:0.75rem; padding:0.85rem 1rem;
    border-bottom:1px solid var(--border); cursor:pointer; transition:background 0.2s;
}
.convo-list-item:hover { background:rgba(255,255,255,0.03); }
.convo-list-item img { width:44px; height:44px; border-radius:50%; object-fit:cover; flex-shrink:0; }
.convo-list-item .convo-info { flex:1; min-width:0; }
.convo-list-item .convo-name { font-weight:600; font-size:0.95rem; }
.convo-list-item .convo-preview {
    font-size:0.8rem; color:var(--text2); white-space:nowrap;
    overflow:hidden; text-overflow:ellipsis;
}
.convo-list-item .convo-time { font-size:0.7rem; color:var(--text3); flex-shrink:0; }

.chat-view { display:flex; flex-direction:column; height:calc(100vh - 60px); }
.chat-header {
    display:flex; align-items:center; gap:0.75rem; padding:1rem;
    border-bottom:1px solid var(--border);
}
.chat-header .back-btn {
    background:none; border:none; color:var(--text2); font-size:1.2rem; cursor:pointer;
    padding:0.25rem;
}
.chat-header img { width:36px; height:36px; border-radius:50%; object-fit:cover; }
.chat-header .chat-name { font-weight:600; }
.chat-messages { flex:1; overflow-y:auto; padding:1rem; display:flex; flex-direction:column; gap:0.5rem; }

.msg-bubble {
    max-width:75%; padding:0.6rem 1rem; border-radius:16px; font-size:0.9rem;
    line-height:1.4; word-wrap:break-word;
}
.msg-bubble img { max-width:100%; border-radius:12px; margin-top:0.25rem; display:block; }
.msg-bubble.mine {
    align-self:flex-end; background:var(--blue); color:#fff;
    border-bottom-right-radius:4px;
}
.msg-bubble.theirs {
    align-self:flex-start; background:var(--bg3); color:var(--text);
    border-bottom-left-radius:4px;
}
.msg-meta { font-size:0.65rem; color:var(--text3); margin-top:2px; }
.msg-sender { font-size:0.75rem; font-weight:600; color:var(--blue-light); margin-bottom:2px; }

.chat-input {
    display:flex; gap:0.5rem; padding:0.75rem 1rem; border-top:1px solid var(--border);
    background:var(--bg2); align-items:center;
}
.chat-input input[type="text"] {
    flex:1; background:rgba(255,255,255,0.05); border:1px solid var(--border);
    border-radius:20px; padding:0.6rem 1rem; color:var(--text); font-size:0.9rem; outline:none;
}
.chat-input input[type="text"]:focus { border-color:var(--blue-light); }
.chat-input .img-btn {
    background:none; border:none; color:var(--text2); font-size:1.3rem; cursor:pointer;
    padding:0.25rem 0.5rem;
}
.chat-input .img-btn:hover { color:var(--text); }
.chat-input .send-btn {
    background:var(--gradient); border:none; color:#fff; padding:0.6rem 1rem;
    border-radius:20px; font-weight:600; font-size:0.85rem; cursor:pointer;
}
.chat-img-preview { padding:0.5rem 1rem; border-top:1px solid var(--border); }
.chat-img-preview img { height:60px; border-radius:8px; }
.chat-img-preview .remove {
    background:var(--red); color:#fff; border:none; border-radius:50%; width:20px; height:20px;
    font-size:0.7rem; cursor:pointer; margin-left:0.5rem; vertical-align:top;
}

/* ===== NOTIFICATIONS ===== */
.notif-item {
    display:flex; align-items:center; gap:0.75rem; padding:0.85rem 1rem;
    border-bottom:1px solid var(--border); cursor:pointer; transition:background 0.2s;
}
.notif-item:hover { background:rgba(255,255,255,0.03); }
.notif-item.unseen { background:rgba(41,121,255,0.05); }
.notif-item img { width:40px; height:40px; border-radius:50%; object-fit:cover; }
.notif-item .notif-text { flex:1; font-size:0.9rem; }
.notif-item .notif-text strong { font-weight:600; }
.notif-item .notif-time { font-size:0.75rem; color:var(--text3); }

/* ===== SEARCH ===== */
.search-bar { padding:1rem 0; position:sticky; top:0; background:var(--bg); z-index:10; }
.search-bar input {
    width:100%; padding:0.75rem 1.25rem; border-radius:30px;
    border:1px solid var(--border); background:var(--card);
    color:var(--text); font-size:0.95rem; outline:none;
}
.search-bar input:focus { border-color:var(--blue-light); }
.search-result {
    display:flex; align-items:center; gap:0.75rem; padding:0.75rem 1rem;
    border-radius:12px; cursor:pointer; transition:background 0.2s;
}
.search-result:hover { background:rgba(255,255,255,0.05); }
.search-result img { width:44px; height:44px; border-radius:50%; object-fit:cover; }

/* ===== SETTINGS ===== */
.settings-section { margin-bottom:2rem; }
.settings-section h3 { font-size:1rem; font-weight:600; margin-bottom:1rem; color:var(--text2); }
.settings-user {
    display:flex; align-items:center; gap:0.75rem; padding:0.6rem 0;
    border-bottom:1px solid var(--border);
}
.settings-user img { width:36px; height:36px; border-radius:50%; object-fit:cover; }
.settings-user .name { flex:1; font-weight:500; }

.empty-state { text-align:center; padding:3rem 1rem; color:var(--text2); }
.empty-state .icon { font-size:3rem; margin-bottom:1rem; opacity:0.5; }
.loading { text-align:center; padding:2rem; color:var(--text2); }

/* ===== MOBILE ===== */
.mobile-nav {
    display:none; position:fixed; bottom:0; left:0; right:0; background:var(--bg2);
    border-top:1px solid var(--border); z-index:100; padding:0.4rem 0;
}
.mobile-nav nav { display:flex; justify-content:space-around; }
.mobile-nav nav a, .mobile-nav nav button {
    display:flex; flex-direction:column; align-items:center; gap:2px;
    font-size:0.65rem; color:var(--text2); padding:0.4rem; background:none; border:none; cursor:pointer;
}
.mobile-nav nav a.active { color:var(--blue-light); }
.mobile-nav nav .icon { font-size:1.3rem; }

@media (max-width:768px) {
    .sidebar { display:none; }
    .main-content { margin-left:0; max-width:100%; padding-bottom:70px; }
    .mobile-nav { display:block; }
    .profile-header { flex-direction:column; text-align:center; gap:1rem; }
    .profile-stats { justify-content:center; }
    .profile-actions { justify-content:center; }
}
