@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg-start: #0f172a;
  --bg-end: #020617;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --glass-bg: rgba(30, 41, 59, 0.4);
  --glass-border: rgba(255, 255, 255, 0.05);
  --accent: #38bdf8;
  --radius: 16px;
  --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: radial-gradient(circle at 20% 20%, var(--bg-start), var(--bg-end));
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 140px;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #1e293b; }
::-webkit-scrollbar-thumb { background: #475569; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; }

.glass-panel {
  backdrop-filter: blur(16px);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* ---------- Full Width Header ---------- */
.header-wrapper {
  width: 100%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 50;
  display: none;
}
@media (min-width: 769px) {
  .header-wrapper { display: block; position: sticky; top: 0; }
}

.header-inner {
  max-width: 640px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between; height: 60px;
}

.header-brand h1 {
  font-size: 1.5rem; font-weight: 700;
  background: linear-gradient(135deg, #e2e8f0, #94a3b8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

.header-search {
  flex: 1; max-width: 320px; margin: 0 16px; position: relative;
}
.header-search .search-input {
  width: 100%; padding: 10px 16px 10px 38px; border-radius: 24px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-primary); font-size: 0.9rem;
}
.header-search .search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-secondary); pointer-events: none;
}

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.header-actions button {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-primary); padding: 8px 14px; border-radius: 24px;
  font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: background var(--transition);
}
.header-actions button:hover { background: rgba(255,255,255,0.15); }
.bell-desktop { position: relative; }
.bell-desktop .badge {
  position: absolute; top: -4px; right: -4px; background: #ef4444; color: white;
  border-radius: 50%; width: 18px; height: 18px; font-size: 0.65rem;
  display: flex; align-items: center; justify-content: center; animation: pulse 1.5s infinite;
}

/* Mobile header */
.mobile-header { text-align: center; padding: 24px 0 8px; display: block; }
.mobile-header h1 {
  font-size: 2rem; font-weight: 700;
  background: linear-gradient(135deg, #e2e8f0, #94a3b8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.mobile-header p { color: #94a3b8; margin-top: 4px; }
@media (min-width: 769px) { .mobile-header { display: none; } }

/* ---------- Main Grid ---------- */
.app-container {
  max-width: 640px; margin: 0 auto; padding: 20px 16px 100px;
  display: grid; grid-template-columns: 1fr; gap: 24px;
}

/* Intro Blurb */
.intro-blurb {
  text-align: center; padding: 16px 20px; border-radius: var(--radius);
  background: rgba(30,41,59,0.3); border: 1px solid var(--glass-border); backdrop-filter: blur(8px);
}
.intro-blurb h3 { font-size: 1.2rem; color: var(--accent); margin-bottom: 6px; font-weight: 600; }
.intro-blurb p { color: #94a3b8; font-size: 0.9rem; line-height: 1.5; }

/* Sorting Tabs */
.sort-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0; }
.sort-tab {
  padding: 8px 18px; border-radius: 24px; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1); color: var(--text-secondary);
  font-size: 0.9rem; font-weight: 500; cursor: pointer; white-space: nowrap; transition: all var(--transition);
}
.sort-tab.active {
  background: var(--accent); color: #0f172a; border-color: var(--accent);
  font-weight: 600; box-shadow: 0 4px 15px rgba(56,189,248,0.3);
}

/* Mobile search */
.search-wrapper { position: relative; display: block; }
@media (min-width: 769px) { .search-wrapper { display: none; } }
.search-input {
  width: 100%; padding: 12px 16px 12px 40px; border-radius: 24px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-primary); font-size: 0.95rem; transition: border var(--transition);
}
.search-input:focus { outline: none; border-color: var(--accent); }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-secondary); }

/* Trending pills */
.trending-topics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.trending-pill {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 20px;
  padding: 6px 14px; font-size: 0.8rem; color: var(--text-secondary); cursor: pointer; transition: all var(--transition);
}
.trending-pill:hover { background: var(--accent); color: #0f172a; border-color: var(--accent); }

/* Vent Form */
.vent-form { display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.vent-form textarea, .vent-form input[type="text"] {
  width: 100%; background: rgba(15,23,42,0.5); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px;
  padding: 16px; color: var(--text-primary); font-family: inherit; font-size: 1rem;
  transition: border var(--transition), box-shadow var(--transition);
}
.vent-form textarea:focus, .vent-form input[type="text"]:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(56,189,248,0.2);
}
.char-counter { text-align: right; font-size: 0.85rem; color: var(--text-secondary); }
.mood-selector { display: flex; flex-wrap: wrap; gap: 8px; }
.mood-btn {
  padding: 8px 14px; border-radius: 20px; font-size: 0.9rem; font-weight: 500;
  color: var(--text-primary); background: rgba(255,255,255,0.05);
  border: 1px solid transparent; cursor: pointer; transition: all var(--transition);
}
.mood-btn.active { border-color: var(--accent); background: rgba(56,189,248,0.15); }
.color-swatches { display: flex; gap: 10px; }
.swatch {
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: transform var(--transition), border var(--transition);
}
.swatch.active { border-color: white; transform: scale(1.2); }

/* Buttons */
.btn-load {
  padding: 10px 24px; font-weight: 600; border-radius: 24px;
  background: rgba(255,255,255,0.1); border: none; color: var(--text-primary);
  cursor: pointer; transition: background var(--transition), box-shadow var(--transition);
}
.btn-load:hover { background: rgba(255,255,255,0.15); }
.btn-submit {
  background: var(--accent) !important; color: #0f172a !important;
  font-weight: 700; box-shadow: 0 4px 15px rgba(56,189,248,0.3);
}
.btn-submit:hover { background: #0ea5e9 !important; box-shadow: 0 6px 20px rgba(56,189,248,0.5); }
.btn-submit:disabled { opacity: 0.6; box-shadow: none; }

/* Feed */
.feed { display: flex; flex-direction: column; gap: 16px; }

/* Vent Card */
.vent-card {
  padding: 18px 20px; border-left: 4px solid var(--card-color, #06b6d4);
  transition: transform var(--transition), box-shadow var(--transition);
  animation: fadeInUp 0.4s ease both;
}
.vent-card:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.4), 0 0 15px rgba(var(--card-rgb), 0.3); }
.vent-message { font-size: 1.05rem; word-wrap: break-word; margin-bottom: 12px; }
.vent-message a.hashtag { color: var(--accent); text-decoration: none; }
.vent-message a.hashtag:hover { text-decoration: underline; }
.vent-meta {
  display: flex; align-items: center; gap: 16px; font-size: 0.85rem;
  color: var(--text-secondary); margin-bottom: 12px; flex-wrap: wrap;
}
.vent-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.vent-actions button {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; padding: 6px 14px; font-size: 0.85rem; color: var(--text-primary);
  cursor: pointer; transition: background var(--transition), box-shadow var(--transition);
}
.vent-actions button:hover { background: rgba(255,255,255,0.1); box-shadow: 0 0 8px rgba(255,255,255,0.1); }
.vent-actions button:disabled { opacity: 0.5; cursor: default; }

/* Delete button */
.delete-btn {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: #fca5a5 !important;
}
.delete-btn:hover { background: rgba(239, 68, 68, 0.3) !important; }

/* Bookmark */
.bookmark-btn.saved { color: var(--accent); }

/* Skeleton */
.skeleton-card {
  padding: 18px 20px; border-radius: var(--radius);
  background: rgba(30,41,59,0.3); border: 1px solid rgba(255,255,255,0.03); overflow: hidden;
}
.skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite;
  border-radius: 6px; margin-bottom: 12px;
}
.skeleton-line.wide { width: 90%; } .skeleton-line.medium { width: 70%; } .skeleton-line.short { width: 40%; }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* Share, Download, Bookmark */
.share-btn, .bookmark-btn, .download-btn {
  background: transparent; border: none; cursor: pointer;
  color: var(--text-secondary); transition: color var(--transition);
}
.share-btn:hover { color: var(--accent); }
.download-btn:hover { color: var(--accent); }
.bookmark-btn:hover { color: var(--accent); }

/* ---------- Mobile Bottom Navigation ---------- */
.bottom-nav, .fab { display: none; }
@media (max-width: 768px) {
  .app-container { padding-bottom: 120px; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 64px;
    background: rgba(15,23,42,0.8); backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.05);
    justify-content: space-between; align-items: center; z-index: 100; padding: 0 8px;
  }
  .nav-item {
    color: var(--text-secondary); display: flex; flex-direction: column; align-items: center;
    font-size: 0.65rem; gap: 2px; background: none; border: none; cursor: pointer;
    position: relative; flex: 1; min-width: 0;
  }
  .nav-item.active { color: var(--accent); }
  .nav-item .badge {
    position: absolute; top: -4px; right: 0; background: #ef4444; color: white;
    border-radius: 50%; width: 16px; height: 16px; font-size: 0.55rem;
    display: flex; align-items: center; justify-content: center; animation: pulse 1.5s infinite;
  }
  .fab {
    display: flex; position: fixed; bottom: 88px; left: 50%; transform: translateX(-50%);
    width: 56px; height: 56px; border-radius: 50%; background: var(--accent); border: none;
    color: #0f172a; font-size: 24px; cursor: pointer;
    box-shadow: 0 6px 20px rgba(56,189,248,0.4); z-index: 101;
    align-items: center; justify-content: center; transition: transform var(--transition);
  }
  .fab:hover { transform: translateX(-50%) scale(1.05); }
  .vent-form.desktop-only { display: none; }
  .form-overlay {
    display: block; position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(15,23,42,0.95); backdrop-filter: blur(20px);
    border-radius: 24px 24px 0 0; padding: 24px 20px 120px; z-index: 110;
    transform: translateY(100%); transition: transform 0.3s ease; max-height: 85vh; overflow-y: auto;
  }
  .form-overlay.active { transform: translateY(0); }
  .form-overlay-close {
    position: absolute; top: 16px; right: 20px; background: none; border: none;
    color: var(--text-primary); font-size: 1.5rem; cursor: pointer; z-index: 5;
  }
}
@media (min-width: 769px) { .form-overlay { display: none; } }

/* ---------- Floating About Box (Desktop) ---------- */
.floating-about {
  position: fixed; right: 20px; top: 120px; width: 240px;
  background: var(--glass-bg); backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3); z-index: 40;
  display: none;
}
@media (min-width: 769px) { .floating-about { display: block; } }
.floating-about h4 { color: var(--accent); font-size: 0.95rem; margin-bottom: 8px; }
.floating-about p { color: #94a3b8; font-size: 0.8rem; line-height: 1.4; }

/* ---------- Premium Footer ---------- */
.site-footer {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8; font-size: 0.75rem; text-align: center; z-index: 999;
  padding: 12px 1rem 14px; line-height: 1.5;
}
.site-footer a { color: var(--accent); text-decoration: none; margin: 0 8px; font-weight: 500; }
.site-footer a:hover { text-decoration: underline; }
.footer-links { display: flex; justify-content: center; gap: 12px; margin-top: 6px; flex-wrap: wrap; }

/* Support Button */
.support-btn {
  position: fixed; bottom: 90px; right: 20px;
  background: #f59e0b; color: #0f172a; border: none;
  padding: 10px 18px; border-radius: 30px; font-weight: 700; font-size: 0.9rem;
  text-decoration: none; cursor: pointer; z-index: 998;
  box-shadow: none; transition: transform 0.2s, box-shadow 0.2s;
}
.support-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(245,158,11,0.3); }

/* SweetAlert2 */
.swal2-popup.glass-panel {
  background: rgba(15,23,42,0.8) !important; backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255,255,255,0.08) !important; border-radius: 20px !important;
  color: var(--text-primary) !important;
}
.swal2-title { color: var(--text-primary) !important; }
.swal2-html-container { color: var(--text-secondary) !important; }
.swal2-confirm {
  background: var(--accent) !important; color: #0f172a !important;
  font-weight: 600 !important; border-radius: 12px !important;
}
.swal2-cancel {
  background: rgba(255,255,255,0.1) !important; color: var(--text-primary) !important;
  border-radius: 12px !important;
}

@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* View Page */
.vent-detail { padding: 24px; }
.replies-section { margin-top: 30px; }
.reply-item {
  padding: 14px 16px; border-radius: 12px;
  background: rgba(255,255,255,0.03); margin-bottom: 12px;
}
.reply-alias { font-weight: 600; margin-bottom: 4px; }
.reply-time { font-size: 0.8rem; color: var(--text-secondary); }