/* ============ CSS Variables ============ */
:root {
  --bg-color: #1c1917;
  --surface-color: #292524;
  --surface-hover: #3d3835;
  --border-color: #44403c;
  --text-color: #fafaf9;
  --text-muted: #a8a29e;
  --text-dim: #78716c;
  
  --primary-color: #f97316;
  --primary-hover: #ea580c;
  --success-color: #22c55e;
  --danger-color: #ef4444;
  --warning-color: #eab308;
  
  --soup-color: #ef4444;
  --salad-color: #22c55e;
  --sandwich-color: #f97316;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --header-height: 60px;
  --sidebar-width: 260px;
}

/* ============ Reset & Base ============ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

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

/* ============ Buttons ============ */
.btn-primary {
  background: var(--primary-color);
  color: white;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: var(--surface-hover);
  color: var(--text-color);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: var(--border-color);
}

.btn-danger {
  background: var(--danger-color);
  color: white;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-text {
  color: var(--primary-color);
  padding: 5px 10px;
  font-size: 14px;
}

.btn-text:hover {
  text-decoration: underline;
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-large {
  padding: 14px 24px;
  font-size: 16px;
}

.btn-icon {
  margin-right: 8px;
}

/* ============ Modal Base ============ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
}

.modal-container {
  position: relative;
  background: var(--surface-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-hover);
  border-radius: 50%;
  font-size: 18px;
  z-index: 10;
  transition: background 0.2s;
}

.modal-close:hover {
  background: var(--border-color);
}

/* Login Modal */
#login-modal {
  background: rgba(0, 0, 0, 0.9);
}

#login-modal .modal-content {
  background: var(--surface-color);
  padding: 48px;
  border-radius: var(--radius-xl);
  text-align: center;
  width: 90%;
  max-width: 420px;
}

.modal-emoji {
  font-size: 64px;
  margin-bottom: 16px;
}

#login-modal h2 {
  font-size: 28px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--soup-color), var(--salad-color), var(--sandwich-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#login-modal p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

#login-modal input {
  width: 100%;
  padding: 14px 18px;
  font-size: 16px;
  background: var(--bg-color);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-color);
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

#login-modal input:focus {
  outline: none;
  border-color: var(--primary-color);
}

#login-modal .btn-primary {
  width: 100%;
  padding: 14px;
  font-size: 16px;
}

.modal-hint {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 16px;
}

/* Login Footer */
.login-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-dim);
}

.login-footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.login-footer a:hover {
  color: var(--primary-color);
}

.footer-divider {
  margin: 0 8px;
}

/* Legal Modals */
.legal-modal-container {
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  padding: 32px;
  overflow-y: auto;
}

.legal-content h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.legal-content h3 {
  font-size: 16px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 8px;
  color: var(--text-color);
}

.legal-content p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.legal-content ul {
  margin: 12px 0;
  padding-left: 24px;
}

.legal-content li {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.legal-updated {
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
}

/* Google Sign-In Button */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  background: #fff;
  color: #1f1f1f;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.btn-google:hover {
  background: #f7f7f7;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.google-icon {
  flex-shrink: 0;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-dim);
  font-size: 13px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.auth-error {
  color: var(--danger-color);
  font-size: 14px;
  margin-top: 16px;
  padding: 10px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: var(--radius-sm);
}

#google-login-section.hidden,
#login-divider.hidden {
  display: none;
}

/* ============ Header ============ */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, var(--soup-color), var(--salad-color), var(--sandwich-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Online Users */
.online-users {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 14px;
  position: relative;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  transition: background 0.2s;
}

.online-users:hover {
  background: var(--surface-hover);
}

.online-dot {
  width: 8px;
  height: 8px;
  background: var(--success-color);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.online-tooltip {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  min-width: 180px;
  max-height: 250px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  z-index: 200;
}

.online-users:hover .online-tooltip {
  display: block;
}

.online-user-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-color);
}

/* Notifications */
.notifications {
  position: relative;
}

#notifications-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  font-size: 20px;
  cursor: pointer;
  transition: background 0.2s;
}

#notifications-btn:hover {
  background: var(--surface-hover);
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  background: var(--danger-color);
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.notifications-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 320px;
  max-height: 400px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  z-index: 200;
}

.notifications-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.notifications-header h4 {
  font-size: 15px;
}

.notifications-list {
  max-height: 340px;
  overflow-y: auto;
}

.notification-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s;
}

.notification-item:hover {
  background: var(--surface-hover);
}

.notification-item.unread {
  background: rgba(249, 115, 22, 0.1);
}

.notification-avatar {
  font-size: 24px;
}

.notification-content {
  flex: 1;
  font-size: 14px;
}

.notification-content strong {
  color: var(--text-color);
}

.notification-time {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* User Menu */
.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
}

.user-menu:hover {
  background: var(--surface-hover);
}

.user-avatar {
  font-size: 24px;
}

.user-name {
  font-weight: 500;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  min-width: 220px;
}

.display-name-section {
  padding: 12px 16px;
}

.display-name-section label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.display-name-edit {
  display: flex;
  gap: 8px;
}

.display-name-edit input {
  flex: 1;
  padding: 8px 10px;
  font-size: 14px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-color);
}

.display-name-edit input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

.user-dropdown button {
  display: block;
  width: 100%;
  padding: 12px 20px;
  text-align: left;
  font-size: 14px;
  transition: background 0.2s;
}

.user-dropdown button:hover {
  background: var(--surface-hover);
}

/* ============ Main Layout ============ */
#main {
  display: flex;
  padding-top: var(--header-height);
  min-height: 100vh;
}

/* Sidebars */
.sidebar {
  width: var(--sidebar-width);
  padding: 20px;
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  overflow-y: auto;
}

.sidebar-left {
  left: 0;
  border-right: 1px solid var(--border-color);
}

.sidebar-right {
  right: 0;
  border-left: 1px solid var(--border-color);
}

.sidebar-nav {
  margin-top: 24px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  border-radius: var(--radius-md);
  transition: background 0.2s;
  margin-bottom: 4px;
}

.nav-item:hover {
  background: var(--surface-hover);
}

.nav-item.active {
  background: var(--surface-hover);
  color: var(--primary-color);
}

.nav-item span {
  font-size: 18px;
}

/* Sidebar Sections */
.sidebar-section {
  margin-bottom: 28px;
}

.sidebar-section h3 {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mini-post-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mini-post-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: var(--surface-hover);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s;
}

.mini-post-item:hover {
  background: var(--border-color);
}

.mini-post-image {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.mini-post-info {
  flex: 1;
  min-width: 0;
}

.mini-post-title {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-post-meta {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.activity-item {
  padding: 10px;
  background: var(--surface-hover);
  border-radius: var(--radius-md);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.activity-item:hover {
  background: var(--border-color);
}

.activity-user {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.activity-text {
  color: var(--text-muted);
}

/* ============ Feed ============ */
.feed {
  flex: 1;
  margin-left: var(--sidebar-width);
  margin-right: var(--sidebar-width);
  padding: 24px 40px;
  min-width: 0;
}

.feed-header {
  margin-bottom: 24px;
}

.feed-header h2 {
  font-size: 28px;
  font-weight: 700;
}

.posts-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 900px;
}

.load-more-container {
  text-align: center;
  padding: 20px;
}

.loading-indicator {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
}

.spinner {
  display: inline-block;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
}

/* ============ Post Card ============ */
.post-card {
  background: var(--surface-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: box-shadow 0.2s;
}

.post-card:hover {
  box-shadow: var(--shadow-md);
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.post-avatar {
  font-size: 32px;
}

.post-author-info {
  display: flex;
  flex-direction: column;
}

.post-author-name {
  font-weight: 600;
  font-size: 15px;
}

.post-author-name:hover {
  color: var(--primary-color);
}

.post-time {
  font-size: 13px;
  color: var(--text-dim);
}

.post-time .edited {
  color: var(--text-dim);
  font-style: italic;
}

.post-actions-menu {
  position: relative;
}

.post-actions-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 18px;
  transition: background 0.2s;
}

.post-actions-btn:hover {
  background: var(--surface-hover);
}

.post-actions-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  min-width: 140px;
}

.post-actions-dropdown button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  font-size: 14px;
  transition: background 0.2s;
}

.post-actions-dropdown button:hover {
  background: var(--surface-hover);
}

.post-actions-dropdown .delete-btn {
  color: var(--danger-color);
}

.post-image-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-color);
}

.post-image {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  display: block;
}

.post-content {
  padding: 20px;
}

.post-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.post-description {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.post-classification {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.classification-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface-hover);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
}

.classification-badge.soup {
  background: rgba(239, 68, 68, 0.2);
  color: var(--soup-color);
}

.classification-badge.salad {
  background: rgba(34, 197, 94, 0.2);
  color: var(--salad-color);
}

.classification-badge.sandwich {
  background: rgba(249, 115, 22, 0.2);
  color: var(--sandwich-color);
}

.post-score {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.score-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-item .label {
  font-size: 14px;
  color: var(--text-muted);
}

.score-item .value {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
}

.score-item .community {
  color: var(--success-color);
}

.post-reactions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.reaction-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface-hover);
  border-radius: 24px;
  font-size: 16px;
  transition: background 0.2s, transform 0.1s;
}

.reaction-btn:hover {
  background: var(--border-color);
  transform: scale(1.05);
}

.reaction-btn.active {
  background: rgba(249, 115, 22, 0.2);
  outline: 2px solid var(--primary-color);
}

.reaction-btn .count {
  color: var(--text-muted);
  font-size: 13px;
}

.add-reaction-btn {
  padding: 4px 8px;
  background: var(--surface-hover);
  border-radius: 16px;
  font-size: 12px;
  opacity: 0.6;
  transition: background 0.2s, opacity 0.2s;
}

.add-reaction-btn:hover {
  background: var(--border-color);
  opacity: 1;
}

.reaction-picker {
  display: none;
  position: absolute;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 50;
}

.reaction-picker.open {
  display: flex;
  gap: 4px;
}

.reaction-picker-btn {
  font-size: 20px;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background 0.2s, transform 0.1s;
}

.reaction-picker-btn:hover {
  background: var(--surface-hover);
  transform: scale(1.2);
}

/* Reaction tooltip */
.reaction-btn {
  position: relative;
}

.reaction-btn[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 12px;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: var(--shadow-md);
  z-index: 100;
  margin-bottom: 4px;
  pointer-events: none;
}

.reaction-btn[data-tooltip]:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--border-color);
  z-index: 101;
  margin-bottom: -8px;
}

.post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
}

.post-comments-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 15px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  transition: background 0.2s, color 0.2s;
}

.post-comments-link:hover {
  background: var(--surface-hover);
  color: var(--text-color);
}

.post-view-details {
  color: var(--primary-color);
  font-size: 15px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  background: rgba(249, 115, 22, 0.1);
  transition: background 0.2s;
}

.post-view-details:hover {
  background: rgba(249, 115, 22, 0.2);
}

/* ============ Post Detail Modal ============ */
.post-modal-container {
  width: 95%;
  max-width: 1100px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.post-detail {
  display: flex;
  height: 100%;
  overflow: hidden;
}

.post-detail-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
}

.post-detail-image {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  background: var(--bg-color);
}

.post-detail-content {
  padding: 20px;
}

.post-detail-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}

.post-detail-description {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.post-detail-sliders {
  margin-top: 20px;
}

.slider-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.slider-section-title {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.classification-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.post-detail-right {
  width: 380px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.comments-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.comments-header h3 {
  font-size: 16px;
}

.comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.comment-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-item:hover .comment-actions {
  opacity: 1;
}

.comment-avatar-col {
  flex-shrink: 0;
}

.comment-avatar {
  font-size: 20px;
}

.comment-content {
  flex: 1;
  min-width: 0;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.comment-author {
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.comment-author:hover {
  color: var(--primary-color);
}

.comment-time {
  font-size: 11px;
  color: var(--text-dim);
}

.comment-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.15s;
}

.comment-action-btn {
  padding: 2px 6px;
  font-size: 11px;
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
}

.comment-action-btn:hover {
  background: var(--surface-hover);
  color: var(--text-color);
}

.comment-text {
  font-size: 14px;
  line-height: 1.4;
  margin: 0 0 4px 0;
}

.comment-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.comment-reactions .reaction-btn {
  padding: 3px 8px;
  font-size: 13px;
  gap: 4px;
}

.comment-reactions .reaction-btn .count {
  font-size: 11px;
}

.comment-reactions .add-reaction-btn {
  padding: 2px 6px;
  font-size: 10px;
}

.comment-reactions .reaction-picker-btn {
  font-size: 16px;
  padding: 4px;
}

.comment-input-container {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
}

.comment-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-color);
  font-size: 14px;
  resize: none;
}

.comment-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.comment-submit-btn {
  padding: 12px 20px;
}

/* ============ Create Modal ============ */
.create-modal-container {
  width: 95%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.create-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.create-modal-header h2 {
  font-size: 20px;
}

.create-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.image-upload-section {
  margin-bottom: 24px;
}

.image-preview-container {
  position: relative;
}

.image-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: var(--bg-color);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.image-dropzone:hover,
.image-dropzone.dragover {
  border-color: var(--primary-color);
  background: rgba(249, 115, 22, 0.05);
}

.dropzone-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.dropzone-text {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

#image-preview {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: var(--radius-lg);
  background: var(--bg-color);
}

.btn-remove-image {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--surface-color);
  padding: 8px 12px;
}

.form-section {
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-color);
  font-size: 15px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

.sliders-section {
  margin-bottom: 24px;
}

.sliders-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.slider-tab {
  flex: 1;
  padding: 12px 16px;
  background: var(--surface-hover);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.slider-tab:hover {
  background: var(--border-color);
}

.slider-tab.active {
  background: var(--primary-color);
  color: white;
}

.sliders-panel {
  padding: 16px;
  background: var(--bg-color);
  border-radius: var(--radius-md);
}

.panel-description {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.classification-result {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--surface-color);
  border-radius: var(--radius-md);
}

.result-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  border-radius: var(--radius-sm);
}

.result-item.soup {
  background: rgba(239, 68, 68, 0.15);
  color: var(--soup-color);
}

.result-item.salad {
  background: rgba(34, 197, 94, 0.15);
  color: var(--salad-color);
}

.result-item.sandwich {
  background: rgba(249, 115, 22, 0.15);
  color: var(--sandwich-color);
}

.result-item .pct {
  font-size: 20px;
  font-weight: 700;
}

.overall-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  background: var(--surface-color);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.overall-score .score-label {
  font-size: 14px;
  color: var(--text-muted);
}

.overall-score .score-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary-color);
}

.overall-score .score-max {
  font-size: 16px;
  color: var(--text-dim);
}

/* Star Rating Picker */
.star-rating-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  background: var(--surface-color);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.star-rating-label {
  font-size: 14px;
  color: var(--text-muted);
}

.star-picker {
  display: flex;
  gap: 4px;
}

.star-btn {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--border-color);
  transition: all 0.15s ease;
  padding: 4px;
  line-height: 1;
}

.star-btn:hover {
  transform: scale(1.2);
}

.star-btn.active {
  color: #ffc107;
  text-shadow: 0 0 8px rgba(255, 193, 7, 0.5);
}

.star-rating-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-color);
  min-width: 40px;
}

.sliders-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.slider-label .name {
  font-weight: 500;
}

.slider-label .value {
  color: var(--primary-color);
  font-weight: 600;
}

.slider-range {
  font-size: 11px;
  color: var(--text-dim);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary-color);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--primary-color);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.create-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

/* ============ Profile Modal ============ */
.profile-modal-container {
  width: 95%;
  max-width: 700px;
  max-height: 90vh;
}

.profile-content {
  padding: 24px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.profile-avatar {
  font-size: 64px;
}

.profile-info h2 {
  font-size: 24px;
  margin-bottom: 4px;
}

.profile-joined {
  font-size: 14px;
  color: var(--text-muted);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface-hover);
  padding: 16px;
  border-radius: var(--radius-md);
  text-align: center;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color);
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.profile-classification {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: var(--surface-hover);
  border-radius: var(--radius-md);
  margin-bottom: 32px;
}

.profile-classification .label {
  font-size: 14px;
  color: var(--text-muted);
}

.profile-classification .type {
  font-size: 20px;
  font-weight: 600;
}

.profile-classification .type.soup { color: var(--soup-color); }
.profile-classification .type.salad { color: var(--salad-color); }
.profile-classification .type.sandwich { color: var(--sandwich-color); }

.profile-posts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.profile-posts-header h3 {
  font-size: 18px;
}

.profile-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.profile-post-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
}

.profile-post-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.profile-post-item:hover img {
  transform: scale(1.05);
}

.profile-post-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.profile-post-item:hover .profile-post-overlay {
  opacity: 1;
}

.profile-post-overlay span {
  font-size: 14px;
  font-weight: 600;
}

/* ============ Toast ============ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.success {
  border-color: var(--success-color);
}

.toast.error {
  border-color: var(--danger-color);
}

.toast-icon {
  font-size: 20px;
}

.toast-message {
  font-size: 14px;
}

/* ============ Mobile Bottom Navigation ============ */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--surface-color);
  border-top: 1px solid var(--border-color);
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  color: var(--text-muted);
  transition: color 0.2s;
}

.mobile-nav-item.active {
  color: var(--primary-color);
}

.mobile-nav-icon {
  font-size: 20px;
}

.mobile-nav-add {
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
  margin-top: -20px;
  box-shadow: var(--shadow-md);
}

.mobile-nav-label {
  font-size: 11px;
  font-weight: 500;
}

/* ============ Responsive ============ */
@media (max-width: 1200px) {
  .sidebar-right {
    display: none;
  }
  
  .feed {
    padding-right: 24px;
    margin-right: 0;
  }
}

@media (max-width: 900px) {
  .sidebar-left {
    display: none;
  }
  
  .mobile-nav {
    display: flex;
  }
  
  #main {
    padding-bottom: 80px; /* Space for mobile nav */
  }
  
  .feed {
    padding: 16px;
    margin-left: 0;
    margin-right: 0;
  }
  
  .post-content {
    padding: 16px;
  }
  
  /* Header adjustments */
  #header {
    padding: 0 12px;
  }
  
  .logo {
    font-size: 18px;
  }
  
  .header-right {
    gap: 8px;
  }
  
  .online-users {
    display: none; /* Hide on mobile - takes too much space */
  }
  
  .user-name {
    display: none; /* Just show avatar on mobile */
  }
  
  .user-menu {
    padding: 8px;
  }
  
  /* Post cards */
  .post-card {
    border-radius: 0;
    margin: 0 -16px;
    border-left: none;
    border-right: none;
  }
  
  .post-card + .post-card {
    margin-top: 8px;
  }
}

@media (max-width: 600px) {
  /* Full screen modals */
  .modal-container {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  
  .post-modal-container {
    width: 100%;
    max-width: 100%;
  }
  
  .create-modal-container {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  
  .profile-modal-container {
    width: 100%;
    max-width: 100%;
  }
  
  .post-detail {
    flex-direction: column;
  }
  
  .post-detail-left {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    max-height: 50vh;
  }
  
  .post-detail-right {
    width: 100%;
  }
  
  .sliders-grid {
    grid-template-columns: 1fr;
  }
  
  .profile-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .profile-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .post-score {
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .post-footer {
    flex-direction: column;
    gap: 12px;
  }
  
  .post-footer > * {
    width: 100%;
    justify-content: center;
  }
  
  /* Feed header */
  .feed-header h2 {
    font-size: 18px;
  }
  
  /* Login modal */
  #login-modal .modal-content {
    padding: 32px 24px;
    width: 100%;
    max-width: 100%;
    height: 100%;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  /* Touch-friendly inputs */
  input, textarea, button {
    font-size: 16px; /* Prevents iOS zoom on focus */
  }
  
  /* Dropdown adjustments */
  .user-dropdown {
    right: -8px;
    min-width: 200px;
  }
  
  .notifications-dropdown {
    right: -40px;
    width: calc(100vw - 24px);
    max-width: 360px;
  }
  
  /* Reaction picker */
  .reaction-picker {
    left: 50%;
    transform: translateX(-50%);
    right: auto;
  }
  
  /* Comment section */
  .comment-input-container {
    padding: 12px;
  }
  
  #comment-input {
    font-size: 16px;
  }
}
