/* ==========================================================
   Mittar - Core Design Tokens & Glassmorphic Dark System
   ========================================================== */

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

:root {
  --bg-main: #090a0f;
  --bg-surface: #12141d;
  --bg-glass: rgba(18, 20, 29, 0.72);
  --bg-glass-card: rgba(23, 26, 38, 0.65);
  --bg-input: #1a1d2b;
  --bg-hover: #222638;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 242, 254, 0.25);

  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-purple: #7928ca;
  --accent-pink: #ff0080;

  --grad-primary: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  --grad-stories: linear-gradient(135deg, #ff0080, #7928ca, #00f2fe);
  --grad-card-glow: radial-gradient(circle at top right, rgba(0, 242, 254, 0.08), transparent 50%);

  --text-primary: #f5f6fa;
  --text-secondary: #9aa0b4;
  --text-muted: #5e647b;
  --text-accent: #00f2fe;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(0, 242, 254, 0.2);

  --sidebar-width: 260px;
  --rightbar-width: 320px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, textarea {
  font-family: inherit;
}

/* Glassmorphism Classes */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.glass-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
  border-color: rgba(0, 242, 254, 0.3);
  box-shadow: var(--shadow-glow);
}

/* App Layout Grid */
.app-container {
  display: flex;
  max-width: 1360px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Navigation */
.app-sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 28px 12px;
}

.sidebar-logo img {
  height: 38px;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
  flex: 1;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  position: relative;
}

.nav-item a:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-item.active a {
  color: var(--text-primary);
  background: var(--bg-hover);
  font-weight: 600;
  border-left: 3px solid var(--accent-cyan);
}

.nav-item a svg {
  width: 22px;
  height: 22px;
}

.badge {
  background: var(--accent-cyan);
  color: #000;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  margin-left: auto;
}

/* Current User Profile in Sidebar */
.sidebar-user {
  margin-top: auto;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border-color);
  transition: background 0.2s;
}

.sidebar-user:hover {
  background: var(--bg-hover);
}

.sidebar-user img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-cyan);
}

.sidebar-user-info {
  flex: 1;
  overflow: hidden;
}

.sidebar-user-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.sidebar-user-handle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Main Content Area */
.app-main {
  flex: 1;
  max-width: 680px;
  min-height: 100vh;
  border-right: 1px solid var(--border-color);
  padding: 24px 20px 80px 20px;
}

/* Rightbar / Trending / Suggestions */
.app-rightbar {
  width: var(--rightbar-width);
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

/* Search Bar */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.15);
}

.search-box svg {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  width: 18px;
  height: 18px;
}

/* Primary Gradient Buttons */
.btn-primary {
  background: var(--grad-primary);
  color: #000;
  font-weight: 700;
  border: none;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(0, 242, 254, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 9px 20px;
  border-radius: var(--radius-full);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-outline:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.05);
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-icon:hover {
  color: var(--accent-cyan);
  background: var(--bg-hover);
}

/* Stories Tray */
.stories-tray {
  display: flex;
  gap: 14px;
  padding-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.stories-tray::-webkit-scrollbar {
  display: none;
}

.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
  width: 72px;
}

.story-avatar-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  padding: 3px;
  background: var(--grad-stories);
  position: relative;
  transition: transform 0.2s;
}

.story-item:hover .story-avatar-wrap {
  transform: scale(1.05);
}

.story-avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg-main);
}

.story-add-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  background: var(--accent-cyan);
  color: #000;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  border: 2px solid var(--bg-main);
}

.story-username {
  font-size: 0.76rem;
  color: var(--text-secondary);
  max-width: 68px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Post Creator Box */
.post-create-card {
  padding: 18px;
  margin-bottom: 24px;
}

.post-create-top {
  display: flex;
  gap: 14px;
}

.post-create-top img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.post-create-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 1.05rem;
  resize: none;
  min-height: 70px;
}

.post-preview-img-container {
  position: relative;
  margin-top: 12px;
  display: none;
}

.post-preview-img-container img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.post-preview-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
}

.post-create-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.post-create-actions {
  display: flex;
  gap: 10px;
}

/* Post Feed Card */
.post-card {
  padding: 20px;
  margin-bottom: 20px;
}

.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.post-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.post-user-info {
  flex: 1;
}

.post-user-name {
  font-weight: 700;
  font-size: 0.98rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.verified-icon {
  color: var(--accent-cyan);
  width: 16px;
  height: 16px;
}

.post-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.post-content {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 14px;
  word-break: break-word;
}

.post-media {
  margin-bottom: 14px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.post-media img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  display: block;
}

.post-actions {
  display: flex;
  gap: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.post-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
}

.post-action-btn:hover {
  color: var(--accent-cyan);
}

.post-action-btn.liked {
  color: var(--accent-pink);
}

.post-action-btn.liked svg {
  fill: var(--accent-pink);
}

/* Comments Section */
.comments-container {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  display: none;
}

.comment-input-box {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.comment-input-box input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
}

.comment-item {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.comment-item img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.comment-bubble {
  background: var(--bg-hover);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  flex: 1;
}

.comment-author {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 2px;
}

.comment-text {
  font-size: 0.88rem;
  color: var(--text-primary);
}

/* Rightbar Widgets */
.widget-card {
  padding: 18px;
}

.widget-title {
  font-size: 1.05rem;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.suggested-user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.suggested-user-item img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.suggested-user-info {
  flex: 1;
  overflow: hidden;
}

.suggested-user-name {
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggested-user-handle {
  font-size: 0.78rem;
  color: var(--text-muted);
}
