/* Clavic App - Shared Styles */
/* Mobile-first, clean modern design */

/* CSS Variables for Light/Dark Mode */
:root {
  /* Spacing System */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-base: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  
  /* Type Scale */
  --font-size-hero: 32px;
  --font-size-h1: 24px;
  --font-size-h2: 20px;
  --font-size-h3: 18px;
  --font-size-body: 14px;
  --font-size-caption: 12px;
  
  /* Font Weights */
  --font-weight-bold: 700;
  --font-weight-semibold: 600;
  --font-weight-medium: 500;
  --font-weight-regular: 400;
  
  /* Light mode colors */
  --bg-primary: #ffffff;
  --bg-secondary: #fafafa;
  --bg-tertiary: #f3f4f6;
  --text-primary: #262626;
  --text-secondary: #111827;
  --text-tertiary: #6b7280;
  --text-muted: #9ca3af;
  --border-color: var(--border-color);
  --border-color: var(--border-light);
  --shadow-color: rgba(15, 23, 42, 0.06);
  --card-bg: #ffffff;
  --nav-bg: #ffffff;
  --input-bg: #ffffff;
  --input-border-color: var(--border-color);
  --accent-blue: #1d4ed8;
  --accent-blue-hover: #1e40af;
  --overlay-bg: rgba(0, 0, 0, 0.8);
  --modal-bg: #ffffff;
}

[data-theme="dark"] {
  /* Dark mode colors - pure black */
  --bg-primary: #000000;
  --bg-secondary: #000000;
  --bg-tertiary: #000000;
  --text-primary: #ffffff;
  --text-secondary: #ffffff;
  --text-tertiary: #cccccc;
  --text-muted: #999999;
  --border-color: #333333;
  --border-light: #333333;
  --shadow-color: rgba(0, 0, 0, 0.8);
  --card-bg: #000000;
  --nav-bg: #000000;
  --input-bg: #000000;
  --input-border: #333333;
  --accent-blue: #1e40af;
  --accent-blue-hover: #1e40af;
  --overlay-bg: rgba(0, 0, 0, 0.9);
  --modal-bg: #000000;
}

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

/* Hide all scrollbars globally while keeping scroll functionality */
* {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

*::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* Ensure no horizontal overflow */
* {
  max-width: 100%;
}

img, video, iframe {
  max-width: 100%;
  height: auto;
}

html {
  overflow-x: hidden;
  height: 100%;
  overflow-y: auto;
  /* Hide scrollbar */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  background: var(--bg-primary);
  background-attachment: fixed;
}

html::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  background: var(--bg-primary);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height for mobile */
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  overflow-y: auto;
  transition: background-color 0.3s ease, color 0.3s ease;
  /* Hide scrollbar */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  /* Prevent zoom on input focus */
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

/* Apply flex layout to start page, rate pages, and auth page for footer positioning */
body.start-page,
body:has(.feed-page-wrapper),
body.auth-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Start page and rate pages - no scroll on desktop */
@media (min-width: 769px) {
  body.start-page,
  body:has(.feed-page-wrapper) {
    height: 100vh;
    overflow: hidden;
  }

  body.start-page .landing,
  body:has(.feed-page-wrapper) .feed-page-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
}

body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

body::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

body.profile-page {
  background: var(--bg-primary);
}

body.auth-page #authNav {
  display: none !important;
}

/* Containers */
.page-wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
  margin-top: 60px;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.feed-page-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: calc(100vh - 60px - 50px);
  padding-top: 4px;
  padding-bottom: 0;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  box-sizing: border-box;
  margin-top: 15px;
}

.feed-container-centered {
  max-width: 500px;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  padding: 0px 16px 0px 16px;
}

@media (min-width: 768px) {
  .feed-container-centered {
    max-width: 900px;
    width: 100%;
    padding: 0 32px;
  }

  .feed-page-wrapper {
    padding-top: 40px;
    align-items: center;
  }
}

@media (min-width: 1024px) {
  .feed-container-centered {
    padding: 0 48px;
  }
}

@media (min-width: 1024px) {
  .feed-page-wrapper {
    padding-top: 60px;
  }
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  border: none;
  margin-bottom: 0;
  transition: background-color 0.3s ease;
}

/* Buttons */
.btn-primary {
  background: var(--accent-blue);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  display: inline-block;
}

.btn-primary:hover {
  background: var(--accent-blue-hover);
  color: #ffffff !important;
}

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

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  text-decoration: none;
  display: inline-block;
}

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

.btn-small {
  padding: 8px 16px;
  font-size: 14px;
}

/* Header/Navigation */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--nav-bg);
  border-bottom: none;
  z-index: 10;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  overflow-x: hidden;
  transition: background-color 0.3s ease;
}

.top-nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0px 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .top-nav-inner {
    padding-top: 8px;
  }

  .nav-links {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
  }
}

.nav-brand {
  font-size: 40px;
  font-weight: 800;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: -0.5px;
  transition: transform 0.2s ease;
  display: inline-block;
}

.nav-brand:hover {
  transform: scale(1.05);
  color: var(--text-secondary) !important;
}

@media (min-width: 768px) {
  .nav-brand {
    font-size: 32px;
  }
}

@media (max-width: 768px) {
  .top-nav-inner {
    padding-top: 6px;
  }

  .nav-brand {
    font-size: 26px;
  }

  /* Prevent scrolling on start page mobile - but allow footer to be visible */
  body.start-page {
    overflow: hidden;
    min-height: 100vh;
    width: 100%;
  }

  /* Prevent scrolling on rate pages */
  body:has(.feed-page-wrapper) {
    overflow: hidden;
    height: 100vh;
    position: fixed;
    width: 100%;
  }

  /* General mobile size reductions */
  .page-wrapper {
    padding: 12px;
    margin-top: 56px;
  }

  .feed-page-wrapper {
    padding-top: 4px;
  }
}

.nav-links {
  display: flex;
  flex-direction: row;
  gap: 8px;
  font-size: 16px;
  align-items: center;
  flex-wrap: nowrap;
}

.nav-link-button {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

.nav-link-button:hover {
  color: var(--accent-blue);
  background: rgba(30, 64, 175, 0.1);
}

.nav-notification-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s;
  padding: 0;
  margin-right: 8px;
}

.nav-notification-btn:hover {
  background: rgba(30, 64, 175, 0.1);
  color: var(--accent-blue);
}

.nav-notification-btn svg {
  width: 24px;
  height: 24px;
}

.nav-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s;
  padding: 0;
  margin-left: -8px; /* Reduced gap from notification button */
  margin-right: 8px; /* Space before profile picture */
  order: 998; /* Just before profile picture */
}

.nav-theme-toggle:hover {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  transform: scale(1.1);
}

.nav-theme-toggle i {
  font-size: 18px; /* Bigger icon */
}

/* Hide theme toggle on mobile when user is logged in (it's in settings) */
@media (max-width: 768px) {
  .nav-theme-toggle {
    display: none !important;
  }
  
  /* Show theme toggle on mobile when user is NOT logged in */
  body:not(.user-logged-in) .nav-theme-toggle {
    display: flex !important;
  }
}

.nav-home-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: none;
  background: none;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s;
  padding: 0;
  margin-right: 8px;
}

.nav-home-btn:hover {
  background: transparent;
  color: var(--accent-blue);
}

.nav-home-btn i {
  font-size: 20px;
}

.mobile-notification-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
}

.mobile-notification-btn:hover {
  background: rgba(30, 64, 175, 0.1);
  color: var(--accent-blue);
}

.mobile-notification-btn svg {
  width: 24px;
  height: 24px;
}

.mobile-home-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border: none;
  border-color: var(--border-color);
  background: none;
  cursor: pointer;
  color: #6b7280;
  text-decoration: none;
  border-radius: 50%;
  transition: all 0.2s;
  margin: 8px auto;
}

.mobile-home-btn {
  font-size: 20px;
  line-height: 1;
}

.mobile-home-btn i {
  font-size: 20px;
}

.mobile-home-btn:hover {
  background: rgba(30, 64, 175, 0.1);
  color: var(--accent-blue);
}

.mobile-home-btn.active {
  color: var(--accent-blue);
}

.mobile-home-btn.active i {
  color: var(--accent-blue);
}

.mobile-logout-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: none;
  border: none;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  text-align: left;
  border-color: var(--border-color);
  margin-top: 8px;
  padding-top: 16px;
}

.mobile-logout-btn:hover {
  color: #ef4444;
  background: #fef2f2;
}

.mobile-logout-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-profile-picture {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 36px !important;
  height: 36px !important;
  border-radius: 50%;
  overflow: hidden;
  text-decoration: none;
  transition: all 0.2s;
  border: none !important;
  order: 999; /* Ensure it's always last (very right) */
  margin-left: 0; /* Remove any left margin */
  outline: none !important;
  padding: 0 !important;
  background: none !important;
  color: inherit !important;
  font-size: 0 !important;
  box-shadow: none !important;
}

.nav-profile-picture:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-profile-picture.active {
  box-shadow: 0 0 0 2px #1e40af;
}

.nav-profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}


.mobile-profile-picture {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  text-decoration: none;
  margin: 0;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  flex-shrink: 0;
}

.mobile-profile-picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.nav-menu-btn {
  display: none;
  font-size: 35px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px 8px;
  transition: color 0.3s ease;
}

/* Overlay for mobile menu */
.nav-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 8;
}

.nav-menu-overlay.active {
  display: block;
}

/* Dropdown panel (mobile only) */
.nav-menu-panel {
  display: none;
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  overflow-x: hidden;
  border-bottom: none;
  background: var(--card-bg);
  z-index: 9;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  padding-top: 20px;
  box-shadow: 0 4px 6px var(--shadow-color);
  transition: background-color 0.3s ease;
}

.nav-menu-panel-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 8px 16px 12px;
}

.nav-menu-panel a,
.nav-menu-panel button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 16px 0;
  border: none;
  border-color: var(--border-color);
  background: none;
  font-size: 18px;
  cursor: pointer;
  color: #6b7280;
  text-decoration: none;
  font-weight: 600;
}

.nav-menu-panel #mobileProfileNav {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-color: var(--border-color);
}

.nav-menu-panel #mobileProfileNav .mobile-notification-btn,
.nav-menu-panel #mobileProfileNav .mobile-profile-picture {
  display: flex;
  width: auto;
  padding: 0;
  border-bottom: none;
  margin: 0;
}

.nav-menu-panel a:last-child,
.nav-menu-panel button:last-child {
  border-bottom: none;
}

.nav-menu-panel a:hover,
.nav-menu-panel button:hover {
  color: #1e40af;
}

/* Legacy header styles for compatibility */
.header {
  position: sticky;
  top: 0;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border-color);
  z-index: 10;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 32px;
  font-weight: 800;
  color: #111827;
  text-decoration: none;
  letter-spacing: -0.5px;
}


.nav-links span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Ensure profile nav is always last */
#profileNav {
  order: 999;
  margin-left: 0;
}

/* Ensure theme toggle is just before profile nav when logged in */
#navThemeToggle {
  order: 998;
}

.nav-link {
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s, transform 0.2s ease;
  padding: 8px 16px;
  border-radius: 8px;
  display: inline-block;
}

.nav-link:hover {
  color: var(--accent-blue);
  background: transparent;
  transform: scale(1.05);
}

.nav-link.active {
  color: var(--accent-blue);
  background: transparent;
}

.nav-link.nav-profile-picture {
  padding: 0 !important;
  font-size: 0 !important;
  color: transparent !important;
}

.nav-link.nav-profile-picture:hover {
  color: transparent !important;
  background: transparent !important;
}

.nav-link.nav-profile-picture.active {
  color: transparent !important;
  background: transparent !important;
}

.nav-link-profile {
  display: inline-block;
  text-decoration: none;
}

.header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: transform 0.2s;
  display: block;
  overflow: hidden;
}

.header-avatar:hover {
  transform: scale(1.05);
}

.header-avatar-placeholder {
  background: #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Ccircle cx='18' cy='18' r='18' fill='%23d1d5db'/%3E%3Ccircle cx='18' cy='13.5' r='5.4' fill='%239ca3af'/%3E%3Cpath d='M9 28.5 Q9 22.5 18 22.5 Q27 22.5 27 28.5 L27 30 L9 30 Z' fill='%239ca3af'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

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

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--input-border);
  border-radius: 12px;
  font-size: 16px;
  background: var(--input-bg);
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.3s ease, color 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--input-border);
  border-radius: 12px;
  font-size: 16px;
  background: var(--input-bg);
  color: var(--text-primary);
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.3s ease, color 0.3s ease;
}

.form-textarea:focus {
  outline: none;
  border-color: #1e40af;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.error-message {
  color: #dc2626;
  font-size: 14px;
  margin-top: 8px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-color: var(--border-color);
}

.tab {
  padding: 12px 24px;
  background: none;
  border: none;
  font-size: 16px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s;
}

.tab:hover {
  color: #1e40af;
}

.tab.active {
  color: #1e40af;
  border-bottom-color: #1e40af;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Sliders */
.slider-group {
  margin: 12px 0;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 17px;
  font-weight: 600;
  color: #374151;
}

.slider-value {
  color: #1e40af;
  font-weight: 600;
  font-size: 17px;
}

.slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e5e7eb;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1e40af;
  cursor: pointer;
  transition: transform 0.2s;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1e40af;
  cursor: pointer;
  border: none;
  transition: transform 0.2s;
}

.slider::-moz-range-thumb:hover {
  transform: scale(1.1);
}

/* Post Cards */
.post-card {
  margin-top: 24px;
  margin-bottom: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

@media (max-width: 768px) {
  .post-card {
    margin-top: 0px;
  }
}

.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  margin-bottom: 12px;
  position: relative;
  box-shadow: none;
}

@media (max-width: 768px) {
  .post-header {
    margin-top: 0px;
  }
}

.post-header .avatar {
  position: relative;
}

.post-header-link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s;
  cursor: pointer;
  box-shadow: none;
}

.post-header-link:hover {
  opacity: 0.7;
  box-shadow: none;
}

.avatar {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50%;
  background: #1e40af;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  box-shadow: none !important;
  font-size: 16px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  outline: 13px solid #fff;
  transition: outline-color 0.3s ease;
  /* Ensure size never changes across devices */
  min-width: 40px !important;
  max-width: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
}

.post-header .avatar {
  position: relative;
}

.post-meta {
  flex: 1;
}

.post-username {
  font-weight: 600;
  color: #1f2937;
  font-size: 18px !important;
  display: flex;
  align-items: center;
  gap: 8px;
  /* Ensure size never changes across devices */
}

.post-username-link {
  color: #1e40af;
  text-decoration: none;
  transition: color 0.2s;
}

.post-username-link:hover {
  color: #1e40af;
  text-decoration: underline;
}

.post-edit-delete {
  display: flex;
  gap: 8px;
  margin-left: auto;
  position: relative;
  z-index: 10;
}

.post-edit-btn,
.post-delete-btn {
  background: transparent;
  border-color: var(--border-color);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 16px;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}

.post-edit-btn:hover {
  background: var(--bg-tertiary);
  border-color: #d1d5db;
  color: #1e40af;
}

.post-delete-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

.post-type-time {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.post-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

@media (min-width: 1024px) {
  .post-content-wrapper {
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
  }
}

.post-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.3;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 0px;
  /* Ensure aspect ratio is always maintained */
  min-height: 0;
  max-height: none;
}

@media (min-width: 1024px) {
  .post-image-wrapper {
    flex: 0 0 auto;
    width: 50%;
    max-width: 50%;
  }
}

.post-image {
  width: 100%;
  height: 100%;
  margin-bottom: 0;
  object-fit: cover;
}

.post-comments-toggle {
  position: absolute;
  bottom: 16px;
  right: 16px;
  min-width: 32px;
  height: 32px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(20px);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  gap: 4px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
  .post-comments-toggle {
    top: 16px;
    bottom: auto;
    min-width: 42px;
    height: 42px;
    border-radius: 21px;
    padding: 0 14px;
    font-size: 12px;
    gap: 5px;
  }
}

.post-comments-toggle:hover {
  transform: scale(1.1);
}

.post-comments-toggle:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.post-comments-toggle svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: white;
}

@media (min-width: 768px) {
  .post-comments-toggle svg {
    width: 14px;
    height: 14px;
  }
}

.toggle-text {
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  color: white;
  background: #1e40af;
  padding: 2px 5px;
  border-radius: 10px;
  margin-left: 2px;
  transition: all 0.2s ease;
}

.post-comments-toggle:hover .toggle-text {
  background: #1e40af;
  transform: scale(1.05);
}

.comment-count {
  font-size: 9px;
  font-weight: 600;
  margin-left: 2px;
  background: #1e40af;
  color: white;
  padding: 2px 5px;
  border-radius: 8px;
}

.comments-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.85) 70%, transparent 100%);
  backdrop-filter: blur(10px);
  border-radius: 0 0 12px 12px;
  padding: 20px;
  max-height: 60%;
  display: none;
  flex-direction: column;
  z-index: 20;
}

.comments-overlay.active {
  display: flex;
}

.comments-overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.comments-overlay-header h3 {
  color: white;
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.comments-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
  line-height: 1;
  padding: 0;
}

.comments-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.comments-overlay .comments-list {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 16px;
  max-height: 300px;
}

.comments-overlay .comments-list {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.comments-overlay .comments-list::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.comments-overlay .comment {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 8px;
}

.comments-overlay .comment-author {
  color: white;
}

.comments-overlay .comment-content {
  color: rgba(255, 255, 255, 0.9);
}

.comments-overlay .comment-form {
  margin-top: 0;
}

.comments-overlay .comment-input {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
}

.comments-overlay .comment-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.comments-overlay .comment-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.post-rating-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 768px) {
  .post-rating-wrapper {
    margin-bottom: 10px;
  }
}

@media (min-width: 1024px) {
  .post-rating-wrapper {
    flex: 1;
    min-width: 0;
    width: auto;
  }
}

.post-comments-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-modal-right-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 1024px) {
  .post-modal-right-section {
    flex: 1;
    min-width: 0;
    width: auto;
  }
  
  .post-comments-wrapper {
    flex: 1;
    min-width: 0;
    width: 100%;
  }
}

.post-caption {
  color: #374151;
  margin-bottom: 12px;
  line-height: 1.5;
}

/* Comments */
.comments-section {
  margin-top: 0px;
  padding-top: 10px;
  padding-right: 0px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.comments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0px;
  margin-top: -10px;
  padding-bottom: 8px;
  padding-right: 20px;
  border-color: var(--border-light);
}

.comments-title-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comments-title {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin: 0;
  letter-spacing: -0.02em;
}

.comments-title-count {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  line-height: 1;
}

.comments-close-x {
  background: rgba(0, 0, 0, 0.08);
  border: none;
  color: #000;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  display: flex;
  margin-right: -20px;
  transition: all 0.2s ease;
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

[data-theme="dark"] .comments-close-x {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.comments-close-x svg {
  width: 20px;
  height: 20px;
  stroke: #000000 !important;
  transition: transform 0.2s ease;
}

[data-theme="dark"] .comments-close-x svg {
  stroke: #ffffff !important;
}

.comments-close-x:hover {
  background: rgba(0, 0, 0, 0.15);
}

.comments-close-x:hover svg {
  transform: rotate(90deg);
  stroke: #000000 !important;
}

[data-theme="dark"] .comments-close-x:hover {
  background: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .comments-close-x:hover svg {
  stroke: #ffffff !important;
}

.comments-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 8px;
  padding-top: 0;
  margin-top: -20px;
  scrollbar-width: thin;
  scrollbar-color: #e5e7eb transparent;
}

.comments-list:has(.empty-state-text) {
  overflow-y: hidden;
}

.comments-list .empty-state-text {
  margin-top: -18px;
}

.comments-list::-webkit-scrollbar {
  width: 4px;
}

.comments-list::-webkit-scrollbar-track {
  background: transparent;
}

.comments-list::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 2px;
}

.comments-list::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.comment-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  transition: opacity 0.2s ease;
}

.comment-item:hover {
  opacity: 0.8;
}

.comment-avatar-link {
  text-decoration: none;
  flex-shrink: 0;
  display: block;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.comment-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-avatar-initials {
  font-size: 12px;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.comment-content-wrapper {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.comment-header {
  margin-bottom: 1px;
}

.comment-username-link {
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
}

.comment-username-link:hover {
  color: var(--text-primary) !important;
  text-decoration: none !important;
}

.comment-username {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.comment-text-content {
  color: var(--text-primary);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  margin-bottom: 2px;
}

.comment-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
}

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

.comment-reply-btn {
  background: none;
  border: none;
  color: #000000;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.comment-form {
  display: flex;
  gap: 10px;
  margin-top: auto;
  margin-bottom: 10px;
  margin-left: 7px;
  margin-right: 7px;
  align-items: center;
  position: relative;
  background: transparent;
  padding-top: 16px;
  z-index: 5;
}

@media (max-width: 768px) {
  .comment-form {
    margin-bottom: 20px;
  }
}

.comment-input {
  flex: 1;
  padding: 14px 50px 16px 20px;
  border: 1px solid transparent;
  border-radius: 30px;
  font-size: 16px;
  background: rgb(21, 20, 39);
  backdrop-filter: blur(20px);
  color: white;
  transition: none;
  font-family: inherit;
  -webkit-text-size-adjust: 100%;
}

.comment-input:focus {
  outline: none !important;
  background: rgb(21, 20, 39) !important;
  border: 1px solid transparent !important;
  backdrop-filter: blur(20px) !important;
  box-shadow: none !important;
  transform: none !important;
}

@media (min-width: 768px) {
  .comment-form {
    margin-left: -4px;
    width: calc(100% + 20px);
  }
  
  .comment-input {
    flex: 1;
    min-width: 0;
  }
}

.comment-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.comment-send-btn {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 35px;
  background: rgb(59, 59, 80);
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 30px;
  transition: all 0.2s ease;
  z-index: 1;
}

@media (min-width: 768px) {
  .comment-send-btn {
    right: 7.5px;
    top: 41px;
  }
}

.comment-send-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-50%) scale(1.1);
}

.comment-send-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.comment-send-btn svg {
  width: 20px;
  height: 20px;
}

.post-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-color: var(--border-light);
}

.post-counter {
  text-align: center;
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
  margin-bottom: 4px;
}

.btn-next-post {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  background: #1e40af;
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

@media (max-width: 768px) {
  .btn-next-post {
    margin-bottom: 0px;
  }
}

.btn-next-post:hover {
  background: #1e40af;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

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

/* Completion Message */
.completion-message {
  margin: 60px auto;
  max-width: 500px;
  text-align: center;
  padding: 40px 20px;
}

.completion-message-content {
  background: none;
  border: none;
  padding: 0;
  box-shadow: none;
}

.completion-message-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  color: #1e40af;
  opacity: 0.9;
}

.completion-message-content h2 {
  font-size: 32px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 12px 0;
  letter-spacing: -0.5px;
}

.completion-message-content p {
  font-size: 18px;
  color: #6b7280;
  margin: 0;
  font-weight: 400;
}

/* Landing Page */
.landing {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px 0px;
  margin-top: 60px;
  box-sizing: border-box;
  background: var(--card-bg);
  transition: background-color 0.3s ease;
  width: 100%;
  max-width: 100vw;
}

/* Start page - flex layout for footer positioning */
body.start-page .landing {
  flex: 1;
}

/* Desktop - ensure landing fits without scroll */
@media (min-width: 769px) {
  body.start-page .landing {
    min-height: calc(100vh - 60px - 140px); /* Account for header and footer */
    padding-bottom: 20px;
  }
}

/* Profile Page - Instagram/TikTok Style Redesign */
.profile-page-wrapper {
  padding-top: 20px;
  padding-bottom: 40px;
  margin-top: 60px;
  min-height: calc(100vh - 100px);
  display: flex;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  overflow-x: hidden;
  justify-content: center;
  align-items: flex-start;
}

.profile-container {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  padding: 0;
}

.profile-logout-section {
  margin-top: 48px;
  padding-top: 32px;
  border-color: var(--border-color);
  text-align: center;
}

.profile-logout-btn {
  padding: 12px 32px;
  font-size: 14px;
  font-weight: 600;
  color: #ef4444;
  border-color: #ef4444;
}

.profile-logout-btn:hover {
  background: #fee2e2;
  border-color: #dc2626;
  color: #dc2626;
}

.logout-btn:hover {
  color: #1e40af;
  background: rgba(37, 99, 235, 0.1);
  border-radius: 8px;
}

/* Profile Hero Section */
.profile-hero {
  margin-top: 40px;
  margin-bottom: 32px;
}

.profile-avatar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  position: relative;
}

.profile-avatar-container {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-container .avatar-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1e40af;
  color: #fff;
  font-weight: 600;
  font-size: 24px;
}

.profile-info-column {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.profile-username-section {
  margin-bottom: 0;
  margin-top: 8px;
  width: 100%;
}

.profile-username-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

.profile-username {
  font-size: 20px;
  font-weight: 600;
  color: #111827;
  margin: 0; /* Remove bottom margin */
  flex: 1;
  min-width: 0;
}

.profile-settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s ease;
  padding: 0;
  flex-shrink: 0;
  margin-left: auto; /* Push to the right */
  order: 999; /* Ensure it's always last */
  text-decoration: none;
}

.profile-settings-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transform: scale(1.05);
}

[data-theme="dark"] .profile-settings-btn {
  color: var(--text-primary);
}

[data-theme="dark"] .profile-settings-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

.profile-settings-btn i {
  font-size: 22px; /* Bigger icon */
}

.profile-display-name {
  font-size: 14px;
  color: #6b7280;
  margin-top: -25px; /* Remove top margin to bring closer to username */
  font-weight: 400;
}

/* Profile Settings Menu */
.profile-settings-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  margin: 0;
}

.profile-settings-menu[style*="flex"] {
  display: flex;
}

.profile-settings-menu-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
}

/* Dark mode overlay - use white filter like other modals */
[data-theme="dark"] .profile-settings-menu-overlay {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
}

.profile-settings-menu-content {
  position: relative;
  background: var(--card-bg);
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1;
  margin: 0 auto;
  transform: none;
}

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

.profile-settings-menu-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0;
}

.profile-settings-menu-close {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.profile-settings-menu-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.profile-settings-menu-close svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.5;
}

.profile-settings-menu-body {
  padding: 20px;
}

.profile-settings-section {
  margin-bottom: 20px;
}

.profile-settings-section:last-child {
  margin-bottom: 0;
}

.profile-settings-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 16px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-settings-item {
  margin-bottom: 20px;
}

.profile-settings-item:last-child {
  margin-bottom: 0;
}

.profile-settings-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  margin-bottom: 4px;
}

.profile-settings-switch input[type="checkbox"] {
  display: none;
}

.profile-settings-switch-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: #d1d5db;
  border-radius: 12px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.profile-settings-switch-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  top: 2px;
  left: 2px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.profile-settings-switch input[type="checkbox"]:checked + .profile-settings-switch-slider {
  background: #2563eb;
}

.profile-settings-switch input[type="checkbox"]:checked + .profile-settings-switch-slider::before {
  transform: translateX(20px);
}

.profile-settings-switch-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  flex: 1;
}

.profile-settings-description {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 0 56px;
  line-height: 1.4;
}

.profile-settings-divider {
  height: 1px;
  background: var(--border-color);
  margin: 24px 0;
}

.profile-settings-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 4px;
  font-family: inherit;
  opacity: 0.7;
}

.profile-settings-action-btn:last-child {
  margin-bottom: 0;
}

.profile-settings-action-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  opacity: 1;
}

.profile-settings-action-btn i {
  font-size: 14px;
  width: 16px;
}

.profile-settings-delete-btn {
  color: var(--text-muted);
  opacity: 0.6;
}

.profile-settings-delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  opacity: 1;
}

.profile-settings-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-settings-link {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.profile-settings-link:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-light);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px var(--shadow-color);
}

[data-theme="dark"] .profile-settings-link {
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-color);
}

[data-theme="dark"] .profile-settings-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-light);
}

/* Dark mode for settings menu */
[data-theme="dark"] .profile-settings-menu-overlay {
  background: rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .profile-settings-menu-close {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-tertiary);
}

[data-theme="dark"] .profile-settings-menu-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

[data-theme="dark"] .profile-settings-switch-slider {
  background: #4b5563;
}

[data-theme="dark"] .profile-settings-switch input[type="checkbox"]:checked + .profile-settings-switch-slider {
  background: #2563eb;
}

/* Settings Modal */
.settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease-out;
}

.settings-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

[data-theme="dark"] .settings-modal-overlay {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.settings-modal-content {
  position: relative;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1;
  margin: 0 auto;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  animation: slideUp 0.2s ease-out;
  border: 1px solid var(--border-color);
}

[data-theme="dark"] .settings-modal-content {
  background: #000000 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3) !important;
}

.settings-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  gap: 16px;
  position: sticky;
  top: 0;
  background: var(--card-bg);
  z-index: 10;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .settings-modal-header {
  background: #000000 !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

.settings-modal-header-left {
  flex: 1;
}

.settings-modal-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-modal-close {
  background: rgba(0, 0, 0, 0.08);
  border: none;
  font-size: 24px;
  color: #000;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

[data-theme="dark"] .settings-modal-close {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.settings-modal-close svg {
  width: 20px;
  height: 20px;
  stroke: #000000 !important;
  transition: transform 0.2s ease;
}

[data-theme="dark"] .settings-modal-close svg {
  stroke: #ffffff !important;
}

.settings-modal-close:hover {
  background: rgba(0, 0, 0, 0.15);
  transform: scale(1.1);
}

.settings-modal-close:hover svg {
  transform: rotate(90deg);
  stroke: #000000 !important;
}

[data-theme="dark"] .settings-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .settings-modal-close:hover svg {
  stroke: #ffffff !important;
}

.settings-modal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.3px;
  line-height: 1.3;
}

.settings-modal-save-btn {
  display: none !important;
  align-items: center;
  justify-content: center;
  padding: 10px 32px;
  background: var(--accent-blue);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 120px;
}

.settings-modal-save-btn[style*="flex"],
.settings-modal-save-btn.show {
  display: flex !important;
}

.settings-modal-save-btn:hover {
  background: var(--accent-blue-hover);
}

.settings-modal-save-btn:active {
  transform: scale(0.98);
}

.settings-modal-save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.settings-modal-body {
  padding: 20px 24px 24px;
  background: var(--card-bg);
}

[data-theme="dark"] .settings-modal-body {
  background: #000000 !important;
}

.settings-modal-section {
  margin-bottom: 32px;
  background: var(--bg-primary);
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--border-color);
}

.settings-modal-section:last-child {
  margin-bottom: 0;
}

/* Light mode specific styles for better visibility */
body:not([data-theme="dark"]) .settings-modal-section {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

body:not([data-theme="dark"]) .settings-modal-content {
  background: #ffffff;
  border: 1px solid #d1d5db;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
}

body:not([data-theme="dark"]) .settings-modal-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

body:not([data-theme="dark"]) .settings-modal-body {
  background: #ffffff;
}

body:not([data-theme="dark"]) .settings-modal-section-title {
  color: #6b7280;
}

body:not([data-theme="dark"]) .settings-modal-item {
  border-bottom-color: #e5e7eb;
}

[data-theme="dark"] .settings-modal-section {
  background: #000000 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .settings-modal-body {
  background: #000000 !important;
}

[data-theme="dark"] .settings-modal-title {
  color: #ffffff !important;
}

[data-theme="dark"] .settings-modal-body {
  background: #000000 !important;
}

.settings-modal-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 16px 0;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

[data-theme="dark"] .settings-modal-section-title {
  color: #999999 !important;
  opacity: 0.8;
}

.settings-modal-item {
  margin-bottom: 0;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s ease;
}

.settings-modal-item:first-child {
  padding-top: 0;
}

.settings-modal-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

[data-theme="dark"] .settings-modal-item {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

body:not([data-theme="dark"]) .settings-modal-item {
  border-bottom-color: #e5e7eb;
}

.settings-modal-item-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.settings-modal-item-text {
  flex: 1;
}

.settings-modal-item-label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.4;
}

[data-theme="dark"] .settings-modal-item-label {
  color: #ffffff !important;
}

.settings-modal-item-description {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
  font-weight: 400;
}

[data-theme="dark"] .settings-modal-item-description {
  color: #999999 !important;
  opacity: 0.8;
}

.settings-modal-switch {
  position: relative;
  display: inline-block;
  width: 51px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
}

.settings-modal-switch input[type="checkbox"] {
  display: none;
}

.settings-modal-switch-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(120, 120, 128, 0.16);
  border-radius: 13px;
  transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.settings-modal-switch-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  top: 2px;
  left: 2px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 3px 1px rgba(0, 0, 0, 0.06);
}

.settings-modal-switch input[type="checkbox"]:checked + .settings-modal-switch-slider {
  background-color: #2563eb;
}

.settings-modal-switch input[type="checkbox"]:checked + .settings-modal-switch-slider::before {
  transform: translateX(25px);
}

[data-theme="dark"] .settings-modal-switch-slider {
  background-color: rgba(120, 120, 128, 0.32);
}

[data-theme="dark"] .settings-modal-switch input[type="checkbox"]:checked + .settings-modal-switch-slider {
  background-color: #2563eb;
}

.settings-modal-appearance-toggle {
  display: flex;
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  width: 100%;
  position: relative;
}

body:not([data-theme="dark"]) .settings-modal-appearance-toggle {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}

.settings-modal-appearance-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.settings-modal-appearance-option i {
  font-size: 16px;
}

.settings-modal-appearance-option:hover {
  color: var(--text-primary);
}

body:not([data-theme="dark"]) .settings-modal-appearance-option:hover {
  color: #111827 !important;
}

.settings-modal-appearance-option.active {
  background: var(--card-bg);
  color: var(--text-primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

body:not([data-theme="dark"]) .settings-modal-appearance-option.active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .settings-modal-appearance-toggle {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .settings-modal-appearance-option {
  color: #999999 !important;
}

[data-theme="dark"] .settings-modal-appearance-option:hover {
  color: #ffffff !important;
}

[data-theme="dark"] .settings-modal-appearance-option.active {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .settings-modal-appearance-option.active:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
  cursor: default !important;
}

/* Light button hover in dark mode - make text white */
[data-theme="dark"] #settingsModalLightMode:hover {
  color: #ffffff !important;
}

.settings-modal-links {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.settings-modal-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 400;
  transition: all 0.15s ease;
  border-bottom: 1px solid var(--border-color);
  background: transparent;
}

.settings-modal-link:last-child {
  border-bottom: none;
}

.settings-modal-link::after {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--text-muted);
  border-top: 1.5px solid var(--text-muted);
  transform: rotate(45deg);
  transition: all 0.15s ease;
  opacity: 0.6;
  flex-shrink: 0;
}

.settings-modal-link:hover {
  color: var(--text-primary);
}

.settings-modal-link:hover::after {
  opacity: 1;
  border-color: var(--text-primary);
  transform: rotate(45deg) translateX(2px);
}

[data-theme="dark"] .settings-modal-link {
  color: var(--text-primary);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .settings-modal-link:hover {
  color: var(--text-primary);
}

.settings-modal-account-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border: none;
  border-bottom: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  margin-bottom: 0;
}

.settings-modal-account-toggle:hover {
  color: var(--text-primary);
}

[data-theme="dark"] .settings-modal-account-toggle {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.settings-modal-account-toggle.active .settings-modal-account-arrow {
  transform: rotate(180deg);
}

.settings-modal-account-arrow {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
  stroke: currentColor;
  stroke-width: 2;
  opacity: 0.5;
}

.settings-modal-account-toggle:hover .settings-modal-account-arrow {
  opacity: 1;
}

.settings-modal-account-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-top: 0;
  padding-left: 0;
}

.settings-modal-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  text-align: left;
  margin-bottom: 8px;
}

.settings-modal-action-btn:last-child {
  margin-bottom: 0;
}

body:not([data-theme="dark"]) .settings-modal-action-btn {
  border: 1px solid #e5e7eb;
}

body:not([data-theme="dark"]) .settings-modal-action-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

[data-theme="dark"] .settings-modal-action-btn {
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .settings-modal-action-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.settings-modal-action-btn i {
  font-size: 16px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.7;
}

.settings-modal-action-btn:hover i {
  opacity: 1;
}

/* Logout button - same style as rate button (.btn-next-post) */
#settingsModalLogoutBtn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* Light mode */
body:not([data-theme="dark"]) #settingsModalLogoutBtn {
  background: transparent;
  color: #000000;
  border: 0.5px solid #000000;
}

body:not([data-theme="dark"]) #settingsModalLogoutBtn:hover {
  background: #000000;
  color: white;
  border: 0.5px solid #000000;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body:not([data-theme="dark"]) #settingsModalLogoutBtn:active {
  transform: translateY(0);
}

/* Dark mode */
[data-theme="dark"] #settingsModalLogoutBtn {
  background: transparent !important;
  color: white !important;
  border: 0.5px solid white !important;
}

[data-theme="dark"] #settingsModalLogoutBtn:hover {
  background: white !important;
  color: #111827 !important;
  border: 0.5px solid white !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] #settingsModalLogoutBtn:active {
  transform: translateY(0);
}

/* Delete account button - same style as logout button but red */
.settings-modal-delete-btn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* Light mode */
body:not([data-theme="dark"]) .settings-modal-delete-btn {
  background: transparent;
  color: #ef4444;
  border: 0.5px solid #ef4444;
}

body:not([data-theme="dark"]) .settings-modal-delete-btn:hover {
  background: #ef4444;
  color: white;
  border: 0.5px solid #ef4444;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

body:not([data-theme="dark"]) .settings-modal-delete-btn:active {
  transform: translateY(0);
}

/* Dark mode */
[data-theme="dark"] .settings-modal-delete-btn {
  background: transparent;
  color: #ef4444;
  border: 0.5px solid #ef4444;
}

[data-theme="dark"] .settings-modal-delete-btn:hover {
  background: #ef4444 !important;
  color: white !important;
  border: 0.5px solid #ef4444 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .settings-modal-delete-btn:active {
  transform: translateY(0);
}

@media (max-width: 768px) {
  .settings-modal {
    padding: 0;
  }
  
  .settings-modal-content {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    height: 100vh;
  }
  
  .settings-modal-header {
    padding: 20px;
  }
  
  .settings-modal-body {
    padding: 20px;
  }
}

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

.settings-header-title-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.settings-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s ease;
  padding: 0;
  text-decoration: none;
  flex-shrink: 0;
}

.settings-back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

[data-theme="dark"] .settings-back-btn {
  color: #ffffff;
}

[data-theme="dark"] .settings-back-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.settings-back-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2.5;
}

.settings-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.5px;
}

@media (max-width: 768px) {
  .settings-title {
    font-size: 28px;
  }
}

.settings-save-btn {
  display: none !important;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  background: var(--accent-blue);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}

.settings-save-btn[style*="flex"],
.settings-save-btn.show {
  display: flex !important;
}

.settings-save-btn:hover {
  background: var(--accent-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(30, 64, 175, 0.3);
}

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

.settings-save-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 768px) {
  .settings-save-btn {
    padding: 8px 20px;
    font-size: 14px;
  }
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 28px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.settings-section:hover {
  border-color: var(--border-light);
  box-shadow: 0 2px 8px var(--shadow-color);
}

.settings-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 24px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 13px;
}

@media (max-width: 768px) {
  .settings-section {
    padding: 20px;
    border-radius: 12px;
  }
}

.settings-item {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.settings-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.settings-item-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.settings-item-text {
  flex: 1;
}

.settings-item-label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.settings-item-description {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.settings-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.settings-switch input[type="checkbox"] {
  display: none;
}

.settings-switch-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: #d1d5db;
  border-radius: 12px;
  transition: all 0.3s ease;
  flex-shrink: 0;
  margin-top: 2px;
}

.settings-switch-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  top: 2px;
  left: 2px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.settings-switch input[type="checkbox"]:checked + .settings-switch-slider {
  background: #2563eb;
}

.settings-switch input[type="checkbox"]:checked + .settings-switch-slider::before {
  transform: translateX(20px);
}

.settings-switch-content {
  flex: 1;
}

.settings-switch-label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.settings-switch-description {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

/* New settings item structure */
.settings-item-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.settings-item-text {
  flex: 1;
}

.settings-item-label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.settings-item-description {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.settings-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-link {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  margin-bottom: 8px;
}

.settings-link:last-child {
  margin-bottom: 0;
}

.settings-link:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-light);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px var(--shadow-color);
}

.settings-account-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  margin-bottom: 16px;
}

.settings-account-toggle:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-light);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px var(--shadow-color);
}

.settings-account-toggle.active .settings-account-arrow {
  transform: rotate(180deg);
}

.settings-account-arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
  stroke: currentColor;
  stroke-width: 2;
}

.settings-account-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  padding-left: 4px;
}

[data-theme="dark"] .settings-account-toggle {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-color);
}

[data-theme="dark"] .settings-account-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-light);
}

.settings-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 14px 0;
  border: none;
  border-bottom: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  text-align: left;
}

.settings-action-btn:last-child {
  border-bottom: none;
}

.settings-action-btn:hover {
  color: var(--text-primary);
}

[data-theme="dark"] .settings-action-btn {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.settings-action-btn i {
  font-size: 16px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.settings-delete-btn {
  color: var(--text-primary);
}

.settings-delete-btn:hover {
  color: #ef4444;
}

[data-theme="dark"] .settings-delete-btn:hover {
  color: #f87171;
}

/* Dark mode for settings page */
[data-theme="dark"] .settings-header {
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .settings-switch-slider {
  background: #4b5563;
}

[data-theme="dark"] .settings-switch input[type="checkbox"]:checked + .settings-switch-slider {
  background: #2563eb;
}

[data-theme="dark"] .settings-section {
  background: var(--card-bg);
  border-color: var(--border-color);
}

[data-theme="dark"] .settings-section:hover {
  border-color: var(--border-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .settings-link {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-color);
  color: var(--text-tertiary);
}

[data-theme="dark"] .settings-link:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-light);
  color: var(--text-primary);
}

[data-theme="dark"] .settings-subsection-toggle {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-color);
  color: var(--text-tertiary);
}

[data-theme="dark"] .settings-subsection-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-light);
  color: var(--text-primary);
}

.profile-stats-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
  color: #111827;
}

.stat-item {
  display: inline-flex;
  align-items: center;
}

.stat-item strong {
  font-weight: 600;
  color: #111827;
}

.stat-separator {
  color: #9ca3af;
}

.profile-bio-section {
  margin-bottom: 16px;
}

.profile-bio-text {
  font-size: 14px;
  color: #111827;
  line-height: 1.5;
  margin: 0;
}

.profile-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  width: 100%;
}

.btn-edit-profile {
  display: inline-block;
  padding: 8px 16px;
  background: var(--card-bg);
  color: var(--text-secondary);
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
  font-family: inherit;
}

.btn-edit-profile:hover {
  background: var(--bg-tertiary);
  border-color: #d1d5db;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--card-bg);
  color: var(--text-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 25px;
}

.btn-logout:hover {
  background: var(--bg-tertiary);
  border-color: #d1d5db;
  color: #111827;
}

.btn-logout svg {
  width: 18px;
  height: 18px;
}

.btn-logout span {
  display: none;
}

@media (min-width: 768px) {
  .btn-logout span {
    display: inline;
  }
}

/* Score Highlight Card */
.score-card {
  background: var(--card-bg);
  border: 1px solid #d1d5db;
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 32px;
  box-shadow: 0 10px 30px var(--shadow-color);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.score-box {
  text-align: center;
  padding: 16px 20px;
  border: none;
}

.score-box:last-child,
.score-box:nth-child(2) {
  border: none;
}

.score-box:nth-child(1),
.score-box:nth-child(2) {
  border: none;
  padding-bottom: 20px;
}

.score-box:nth-child(3),
.score-box:nth-child(4) {
  padding-top: 20px;
}

.score-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.2;
  padding: 0 4px;
  transition: color 0.3s ease;
}

.score-label {
  font-size: 12px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
}

/* Profile Tabs */
.profile-tabs {
  display: flex;
  border-bottom: 1px solid #d1d5db;
  margin-bottom: 24px;
  gap: 0;
  transition: border-color 0.3s ease;
}

.profile-tab {
  flex: 1;
  padding: 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-tertiary);
  transition: all 0.2s, color 0.3s ease;
  margin-bottom: -1px;
}

.profile-tab:hover {
  color: #111827;
  background: transparent;
}

.profile-tab.active {
  color: #1e40af;
  border-bottom-color: #1e40af;
}

.tab-text {
  display: inline;
}

/* Current Images Section */
.current-images-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.current-image-card {
  background: var(--card-bg);
  border: 1px solid #d1d5db;
  border-radius: 18px;
  padding: 24px 0;
  box-shadow: 0 10px 30px var(--shadow-color);
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.current-image-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 24px;
}

/* Add margin-top only when no image is uploaded (upload area is visible) */
.current-image-card:has(.current-image-container[style*="display: none"]) .current-image-header,
.current-image-card:not(:has(.current-image-container img)) .current-image-header {
  margin-top: 10px;
}

.current-image-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.current-image-header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.current-image-upload-header-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 2px solid #1e40af;
  background: #1e40af;
  color: #fff;
  cursor: pointer;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.current-image-upload-header-btn:hover {
  background: #1e40af;
  border-color: #1e40af;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.current-image-upload-header-btn svg {
  width: 18px;
  height: 18px;
}

.current-image-menu-wrapper {
  position: relative;
  display: none;
}

.current-image-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: #6b7280;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.current-image-menu-btn:hover {
  background: var(--bg-tertiary);
  color: #111827;
}

.current-image-menu-btn i {
  font-size: 16px;
}

.current-image-menu-dropdown {
  position: absolute;
  top: 40px;
  right: 0;
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--shadow-color);
  min-width: 140px;
  z-index: 100;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.current-image-menu-item {
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  color: #111827;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s;
  font-family: inherit;
}

.current-image-menu-item:hover {
  background: var(--bg-tertiary);
}

.current-image-menu-item i {
  font-size: 14px;
  color: #ef4444;
  width: 16px;
}

.current-image-menu-item span {
  flex: 1;
}

.current-image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  padding: 0;
}

.current-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  min-width: 100%;
  min-height: 100%;
}

.current-image-container .no-image {
  color: #9ca3af;
  font-size: 14px;
  text-align: center;
  padding: 0px;
}

.current-image-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(37, 99, 235, 0.9);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.current-image-badge.physique {
  background: rgba(37, 99, 235, 0.9);
}

.current-image-upload-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 24px;
}

.current-image-upload-area {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.3;
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  background: var(--bg-tertiary);
  transition: all 0.3s ease;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
}

.current-image-upload-area:hover {
  border-color: #1e40af;
  background: #f0f4ff;
}

.current-image-upload-area.dragover {
  border-color: #1e40af;
  background: #eff6ff;
  transform: scale(1.01);
}

.current-image-upload-content {
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.current-image-upload-icon {
  color: #6b7280;
  margin-bottom: 4px;
}

.current-image-upload-area:hover .current-image-upload-icon {
  color: #1e40af;
}

.current-image-upload-text {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
  margin: 0;
}

.current-image-upload-hint {
  font-size: 12px;
  color: #9ca3af;
  margin: 0;
}

.current-image-upload-preview {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-tertiary);
  border-radius: 12px;
  overflow: hidden;
}

.current-image-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.current-image-upload-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
  padding: 0;
}

.current-image-upload-remove svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.current-image-upload-remove:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

/* Loading Spinner */
.loading-spinner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.loading-spinner.hidden {
  display: none;
}

.spinner-gear {
  color: #1e40af;
  animation: spin 1s linear infinite;
}

.spinner-gear-small {
  width: 20px;
  height: 20px;
  color: #1e40af;
  animation: spin 1s linear infinite;
}

.spinner-gear-white {
  color: white;
  animation: spin 1s linear infinite;
}

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

.loading-spinner-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.loading-spinner-inline .spinner-gear-small {
  width: 16px;
  height: 16px;
}

.current-image-update-btn {
  width: calc(100% - 48px);
  margin: 0 24px;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
}

/* Posts Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  margin-bottom: 40px;
}

.post-grid-item {
  position: relative;
  aspect-ratio: 1 / 1.3;
  overflow: hidden;
  background: var(--bg-tertiary);
  cursor: pointer;
  transition: opacity 0.2s;
}

.post-grid-item:hover {
  opacity: 0.9;
}

.post-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-grid-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.post-grid-overlay.face {
  background: rgba(37, 99, 235, 0.8);
}

.post-grid-overlay.physique {
  background: rgba(16, 185, 129, 0.8);
}

.post-grid-overlay.legacy {
  background: rgba(107, 114, 128, 0.8);
}

.post-grid-item.legacy {
  opacity: 0.7;
}

.post-grid-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  z-index: 10;
}

.post-grid-menu-wrapper {
  position: relative;
}

.post-grid-menu-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
  padding: 0;
}

.post-grid-menu-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.05);
}

.post-grid-menu-btn i {
  font-size: 12px;
}

.post-grid-menu-dropdown {
  position: absolute;
  top: 36px;
  right: 0;
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--shadow-color);
  min-width: 140px;
  z-index: 100;
  overflow: hidden;
  border: 1px solid #d1d5db;
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.post-grid-menu-item {
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 14px;
  transition: color 0.3s ease;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s;
  font-family: inherit;
}

.post-grid-menu-item:hover {
  background: var(--bg-tertiary);
}

.post-grid-menu-item i {
  font-size: 14px;
  color: #ef4444;
  width: 16px;
}

.post-grid-menu-item span {
  flex: 1;
}

/* Post Modal */
.post-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.score-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.post-modal-content {
  background: var(--modal-bg);
  border-radius: 18px;
  max-width: 550px;
  width: 60%;
  max-height: 140vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px var(--shadow-color);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

@media (min-width: 1024px) {
  .post-modal-content {
    max-width: 900px;
    width: 80%;
  }
}

.score-modal-content {
  background: var(--modal-bg);
  border-radius: 18px;
  max-width: 910px;
  width: 65%;
  max-height: 180vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px var(--shadow-color);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

@media (min-width: 768px) {
  .score-modal-content {
    max-width: 1040px;
    width: 85%;
    max-height: 180vh;
  }
}

@media (max-width: 768px) {
  .post-modal-content,
  .score-modal-content {
    width: 95%;
    max-width: 95%;
    max-height: 95vh;
  }

  .score-modal-header {
    margin-top: 40px;
  }

  .score-modal-side-image {
    display: none;
  }

  .score-modal-header-top {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    margin-bottom: 0 !important;
  }

  .score-modal-avatar {
    grid-column: 1 !important;
    justify-self: center !important;
    width: 90px;
    height: 90px;
  }

  .score-modal-username {
    margin-top: 20px;
    margin-bottom: -10px;
  }

  /* Fix scoreboard separator lines alignment on mobile */
  .score-modal-card {
    padding: 20px 16px !important;
    gap: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: repeat(2, 1fr) !important;
  }

  .score-modal-card .score-box {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px 12px !important;
    position: relative !important;
    min-height: 0 !important;
    border: none !important;
  }
}

.post-modal-close,
.score-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.08);
  color: #000;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s ease;
  padding: 0;
}

[data-theme="dark"] .post-modal-close,
[data-theme="dark"] .score-modal-close {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.post-modal-close svg,
.score-modal-close svg {
  width: 20px;
  height: 20px;
  stroke: #000000 !important;
  transition: transform 0.2s ease;
}

[data-theme="dark"] .post-modal-close svg,
[data-theme="dark"] .score-modal-close svg {
  stroke: #ffffff !important;
}

.post-modal-close:hover,
.score-modal-close:hover {
  background: rgba(0, 0, 0, 0.15);
  transform: scale(1.1);
}

[data-theme="dark"] .post-modal-close:hover,
[data-theme="dark"] .score-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.post-modal-close:hover svg,
.score-modal-close:hover svg {
  transform: rotate(90deg);
  stroke: #000000 !important;
}

[data-theme="dark"] .post-modal-close:hover svg,
[data-theme="dark"] .score-modal-close:hover svg {
  stroke: #ffffff !important;
}

.post-modal-body,
.score-modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}


/* Comments Modal Styles */
.comments-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  width: 100%;
}

.comments-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.comments-modal-count {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 4px 10px;
  border-radius: 12px;
}

.comments-modal-list {
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  align-items: flex-start;
}

.comments-modal-list .comment-item {
  padding: 12px 0;
  width: 100%;
}

.comments-modal-list .comment-item:not(:last-child) {
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 16px;
}

.post-modal-comments-section .comments-modal-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
}

.post-modal-comments-section .comments-modal-list {
  max-height: 40vh;
}

@media (min-width: 1024px) {
  .post-modal-comments-section .comments-modal-list {
    max-height: 60vh;
  }
}

.score-modal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
  width: 100%;
}

.score-modal-header-top {
  display: grid;
  grid-template-columns: 140px 1fr 140px;
  align-items: center;
  justify-items: center;
  gap: 40px;
  margin-bottom: -20px;
  width: 100%;
  position: relative;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.score-modal-side-image {
  width: 140px;
  height: 185px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  margin-bottom: -30px;
}

.score-modal-facecard {
  grid-column: 1;
  justify-self: start;
}

.score-modal-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  justify-self: center;
}

.score-modal-physique {
  grid-column: 3;
  justify-self: end;
}

.score-modal-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.score-modal-avatar .avatar-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 32px;
  font-weight: 600;
}

.score-modal-username {
  font-size: 26px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  position: relative;
  z-index: 10;
}

@media (min-width: 769px) {
  /* Increase spacing between avatar and username on desktop when side images are missing */
  .score-modal-header.no-side-images .score-modal-username {
    margin-top: 18px;
  }
  
  .score-modal-header.no-side-images .score-modal-header-top {
    margin-bottom: 0;
  }
}

.score-modal-card {
  width: 100%;
  margin: 0;
}


.post-modal-info {
  margin-bottom: 16px;
  width: 100%;
  text-align: left;
}

.post-modal-scores {
  display: flex;
  gap: 24px;
  margin-bottom: 0;
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: 12px;
  width: 100%;
  justify-content: center;
}

.post-modal-score-item {
  flex: 1;
  text-align: center;
}

.post-modal-score-value {
  font-size: 26px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}

.post-modal-score-label {
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
}

/* Desktop Styles */
@media (min-width: 768px) {
  .profile-container {
    max-width: 880px;
    margin: 0 auto;
    padding: 0;
  }

  .profile-avatar-container {
    width: 96px;
    height: 96px;
  }

  .profile-avatar-container .avatar-initials {
    font-size: 36px;
  }

  .profile-username {
    font-size: 28px;
  }

  .profile-display-name {
    font-size: 16px;
  }

  .profile-stats-row {
    font-size: 16px;
  }

  .profile-bio-text {
    font-size: 16px;
  }

  .score-card {
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
  }

  .score-box {
    border: none;
    padding: 24px 28px;
  }

  .score-box:last-child {
    border: none;
  }

  .score-box:nth-child(1),
  .score-box:nth-child(2) {
    border: none;
    padding-bottom: 24px;
  }

  .score-box:nth-child(3),
  .score-box:nth-child(4) {
    padding-top: 24px;
  }

  .score-value {
    font-size: 40px;
    line-height: 1.2;
    padding: 0 6px;
  }

  .score-label {
    font-size: 13px;
  }

  .current-images-section {
    grid-template-columns: repeat(2, 1fr);
  }

  .current-image-container {
    padding: 0 !important;
    overflow: hidden !important;
  }

  .current-image-container img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block !important;
    min-width: 100% !important;
    min-height: 100% !important;
  }

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

.profile-header-section {
  display: flex;
  align-items: center;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid #efefef; /* Light separator */
}

.profile-avatar-display {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #e0e0e0; /* Placeholder background */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

.profile-avatar-display img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-display .avatar-placeholder-svg {
  width: 60%;
  height: 60%;
  fill: #9e9e9e; /* Placeholder icon color */
}

.profile-info-display {
  flex: 1;
  min-width: 0;
}

.profile-username-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.profile-username-display {
  font-size: 28px;
  font-weight: 300;
  color: #262626;
  margin: 0;
}

.edit-profile-button {
  padding: 8px 24px;
  border: 1px solid #dbdbdb;
  border-radius: 4px;
  background: var(--card-bg);
  color: #262626;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}

.edit-profile-button:hover {
  background: #f0f0f0;
}

.profile-email-display {
  font-size: 14px;
  color: #8e8e8e;
  margin: 0 0 16px 0;
}

.profile-bio-display {
  font-size: 16px;
  color: #262626;
  line-height: 1.6;
  margin: 0;
  white-space: pre-wrap;
}

.profile-images-section {
  display: flex;
  flex-direction: column;
  gap: 60px;
}

.profile-image-category {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.category-title {
  font-size: 20px;
  font-weight: 600;
  color: #262626;
  margin: 0;
}

.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.bio-section-inline {
  margin-top: 20px;
}

.bio-label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.bio-textarea-inline {
  width: 100%;
  padding: 10px 14px;
  border-color: var(--border-color);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  margin-bottom: 10px;
}

.bio-textarea-inline:focus {
  outline: none;
  border-color: #1e40af;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.profile-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.file-input-hidden {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
}

.edit-profile-upload-area {
  position: relative;
  margin-top: 8px;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  background: var(--bg-tertiary);
  transition: all 0.3s ease;
  cursor: pointer;
  overflow: hidden;
}

.edit-profile-upload-area:hover {
  border-color: #1e40af;
  background: #f0f4ff;
}

.edit-profile-upload-area.dragover {
  border-color: #1e40af;
  background: #eff6ff;
  transform: scale(1.02);
}

.edit-profile-upload-content {
  padding: 12px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.edit-profile-upload-icon {
  color: #6b7280;
  margin-bottom: 0;
  width: 18px;
  height: 18px;
}

.edit-profile-upload-area:hover .edit-profile-upload-icon {
  color: #1e40af;
}

.edit-profile-upload-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
}

.edit-profile-upload-main {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}

.edit-profile-upload-sub {
  font-size: 11px;
  color: #6b7280;
}

.edit-profile-upload-hint {
  font-size: 10px;
  color: #9ca3af;
  margin: 0;
  margin-top: 1px;
}

.edit-profile-upload-preview {
  position: relative;
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
}

.edit-profile-upload-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.edit-profile-upload-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
}

.edit-profile-upload-remove:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.upload-button-label {
  display: inline-block;
  cursor: pointer;
}

.upload-button {
  display: inline-block;
  padding: 10px 20px;
  background: var(--bg-tertiary);
  color: #374151;
  border-color: var(--border-color);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.upload-button:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
  transform: translateY(-1px);
}

.upload-button-primary {
  display: inline-block;
  padding: 12px 24px;
  background: linear-gradient(135deg, #1e40af 0%, #1e40af 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
  width: 100%;
}

.upload-button-primary:hover {
  background: linear-gradient(135deg, #1e40af 0%, #1e40af 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

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

.profile-avatar-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-info {
  flex: 1;
}

.profile-username {
  font-size: 32px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 8px;
}

.profile-email {
  font-size: 16px;
  color: #6b7280;
}

.section-title-small {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 16px;
}

.bio-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bio-textarea {
  width: 100%;
  padding: 12px 16px;
  border-color: var(--border-color);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
}

.bio-textarea:focus {
  outline: none;
  border-color: #1e40af;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.image-upload-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.current-image-container {
  min-height: 200px;
  border: none;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-tertiary);
}

.profile-image-preview {
  max-width: 100%;
  max-height: 400px;
  border-radius: 12px;
  object-fit: contain;
}

.image-caption {
  margin-top: 12px;
  color: #6b7280;
  font-size: 14px;
  text-align: center;
}

.no-image-text {
  color: #9ca3af;
  font-size: 15px;
}


/* Old footer styles removed - using new minimal footer */

.footer-content {
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
}

.footer-text {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

.landing-content {
  text-align: center;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  margin-bottom: 200px;
  padding-top: var(--spacing-lg); /* 24px from top nav */
}

.landing-phrase {
  font-size: var(--font-size-hero);
  font-weight: var(--font-weight-bold);
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm); /* 8-12px to subline */
  line-height: 1.15;
  letter-spacing: -0.3px;
}

.rate-based-on {
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
  color: var(--text-tertiary);
  margin-bottom: var(--spacing-md); /* 12-16px to buttons */
  text-align: center;
}

.landing-indicator {
  font-size: var(--font-size-caption);
  color: var(--text-muted);
  margin-top: var(--spacing-base); /* 16-20px from buttons */
  margin-bottom: var(--spacing-sm);
  font-weight: var(--font-weight-regular);
  text-align: center;
}

.landing-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md); /* 12px between buttons */
  align-items: center;
}

.landing-button {
  padding: var(--spacing-base) var(--spacing-xl);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.landing-button-primary {
  background: var(--accent-blue);
  color: #ffffff;
  border: 1px solid var(--accent-blue);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.landing-button-secondary {
  background: var(--card-bg);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px var(--shadow-color);
}

.landing-button:hover {
  background: #1e40af;
  border-color: #1e40af;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.landing-button:active {
  background: #1e40af;
  border-color: #1e40af;
  color: #ffffff;
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

/* Facecard button - constantly blue, scales up on hover/click */
#facecardButton {
  background: #1e40af;
  border: 1px solid #1e3a8a;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2);
  transform: scale(1);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

#facecardButton:hover {
  background: #1e40af;
  border-color: #1e40af;
  color: #ffffff;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

#facecardButton:active {
  background: #1e40af;
  border-color: #1e40af;
  color: #ffffff;
  transform: scale(1.02);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

/* Facecard button turns white when physique is hovered */
#facecardButton.physique-hovered {
  background: var(--card-bg);
  border-color: #d1d3d7;
  color: var(--text-secondary);
  box-shadow: 0 1px 3px var(--shadow-color);
}

/* Physique button - scales up on hover/click (same as facecard) */
#physiqueButton {
  border: 1px solid #d1d3d7;
  transform: scale(1);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

#physiqueButton:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  border-color: #1e40af;
}

#physiqueButton:active {
  transform: scale(1.02);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.landing-info {
  margin-top: 56px;
  padding-top: 48px;
  border-color: var(--border-color);
  text-align: left;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.info-item {
  font-size: 15px;
  color: #4b5563;
  margin-bottom: 14px;
  line-height: 1.7;
  padding-left: 8px;
  border-color: var(--border-color);
  padding-left: 16px;
}

.info-item:last-child {
  margin-bottom: 0;
}

.info-item strong {
  color: #111827;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}


/* Auth Page */
.auth-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 0; /* Allow flex shrinking */
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  overflow-x: hidden;
  padding: 30px 20px 20px 20px;
  margin-top: 10px;
  gap: 24px;
}

.pre-auth-page .auth-container {
  justify-content: flex-start;
  min-height: calc(100vh - 60px);
  padding-top: 80px;
}

/* Center vertically when showing forgot/reset password forms */
.auth-container.auth-centered {
  justify-content: flex-start;
  margin-top: 120px;
  padding-top: 80px;
  padding-bottom: 20px;
}

.auth-wrapper {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auth-back-button {
  color: #6b7280;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
  margin-top: 0;
  margin-bottom: 0;
  display: inline-block;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  text-align: left;
  font-family: inherit;
  align-self: flex-start;
}

.auth-back-button:hover {
  color: #374151;
  text-decoration: underline;
}

[data-theme="dark"] .auth-back-button {
  color: var(--text-primary);
  opacity: 0.8;
}

[data-theme="dark"] .auth-back-button:hover {
  color: var(--accent-blue);
  opacity: 1;
}

.auth-header {
  text-align: center;
  width: 100%;
  margin-top: 20px;
  margin-bottom: 24px;
}

.auth-title {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 10px;
  line-height: 1.2;
  letter-spacing: -0.3px;
}

.auth-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 4px 0;
  line-height: 1.5;
  font-weight: 400;
  margin-bottom: -25px;
}

.auth-card {
  width: 100%;
  border: none;
  border-radius: 12px;
  background: var(--card-bg);
  padding: 0;
  box-shadow: none;
  transition: background-color 0.3s ease;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
  border-bottom: 2px solid var(--border-color);
  position: relative;
}

.auth-tab {
  flex: 1;
  padding: 14px 20px;
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-tertiary);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.3s ease;
  font-family: inherit;
  position: relative;
}

.auth-tab:hover {
  color: var(--text-secondary);
}

.auth-tab.active {
  color: #1e40af; /* Darker blue */
  font-weight: 600;
  border-bottom-color: #1e40af;
}

.auth-tab.active:hover {
  color: #2563eb; /* Lighter on hover */
  border-bottom-color: #2563eb;
}

.auth-tab-content {
  display: none;
}

.auth-tab-content.active {
  display: block;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-form-group:last-of-type {
  margin-bottom: 0;
}

.auth-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin: 0;
}

.auth-form-input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  font-size: 16px;
  background: var(--card-bg);
  color: #111827;
  transition: all 0.2s ease;
  font-family: inherit;
  -webkit-appearance: none;
  -webkit-text-size-adjust: 100%;
  appearance: none;
  outline: none;
}

.auth-form-input:hover {
  border-color: #9ca3af;
}

.auth-form-input:focus {
  border-color: #1e40af;
  border-width: 2px;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.auth-form-input::placeholder {
  color: #9ca3af;
}

.password-requirements {
  margin-top: 8px;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  transition: background-color 0.3s ease;
  margin-bottom: -25px;
}

.password-requirement {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6b7280;
  transition: color 0.2s ease;
}

.password-requirement i {
  font-size: 12px;
  width: 14px;
  text-align: center;
}

.auth-error-message {
  color: #ef4444;
  font-size: 13px;
  margin-top: -4px;
  margin-bottom: 4px;
  min-height: 18px;
  line-height: 1.4;
}

.auth-submit-btn {
  width: 100%;
  padding: 14px 24px;
  background: #1e40af;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  margin-top: -20px;
  margin-bottom: 2px;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.auth-submit-btn:hover {
  background: #1e40af;
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

.auth-submit-btn:active {
  background: #1e40af;
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.auth-footer-text {
  text-align: center;
  margin-top: 24px;
  padding-top: 0;
}

.auth-footer-text p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.auth-footer-text a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.auth-footer-text a:hover {
  color: var(--accent-blue);
}

[data-theme="dark"] .auth-footer-text a {
  color: var(--text-primary);
}

[data-theme="dark"] .auth-footer-text a:hover {
  color: var(--accent-blue);
}

.auth-policy-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-sm);
}

.auth-policy-links a {
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: var(--font-size-caption);
  padding: var(--spacing-xs) var(--spacing-sm);
  transition: color 0.2s ease;
}

.auth-policy-links a:hover {
  color: var(--text-secondary);
  text-decoration: underline;
}

.auth-policy-links span {
  color: var(--text-muted);
  margin: 0 var(--spacing-xs);
}

/* Forgot Password Link */
.forgot-password-link {
  font-size: 13px;
  color: #2563eb; /* Darker blue */
  text-decoration: none;
  margin-top: 4px;
  align-self: flex-end;
  transition: color 0.2s ease;
}

.forgot-password-link:hover {
  color: #1d4ed8; /* Darker on hover */
  text-decoration: underline;
}

/* Forgot Password Form */
.forgot-password-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.forgot-password-back {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.forgot-password-back:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.forgot-password-back svg {
  width: 20px;
  height: 20px;
}

.forgot-password-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.forgot-password-description {
  font-size: 13px;
  color: var(--text-tertiary);
  margin: 4px 0 0 0;
  line-height: 1.5;
}

.auth-success-message {
  color: #10b981;
  font-size: 13px;
  margin-top: -4px;
  margin-bottom: 4px;
  min-height: 18px;
  line-height: 1.4;
  padding: 12px;
  background: #ecfdf5;
  border-radius: 8px;
  border: 1px solid #a7f3d0;
}

/* Password Reset Form */
.password-reset-header {
  margin-bottom: 24px;
  position: relative;
}

.password-reset-back {
  position: absolute;
  left: 0;
  top: 0;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.password-reset-back:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.password-reset-back svg {
  width: 20px;
  height: 20px;
}

.password-reset-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  text-align: center;
}

.password-reset-description {
  font-size: 14px;
  color: var(--text-tertiary);
  margin: 0;
  line-height: 1.5;
  text-align: center;
}

/* Dark mode styles */
[data-theme="dark"] .forgot-password-link {
  color: #3b82f6; /* Medium blue for dark mode */
}

[data-theme="dark"] .forgot-password-link:hover {
  color: #2563eb; /* Darker on hover */
}

[data-theme="dark"] .forgot-password-back {
  color: var(--text-tertiary);
}

[data-theme="dark"] .forgot-password-back:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

[data-theme="dark"] .password-reset-back {
  color: var(--text-tertiary);
}

[data-theme="dark"] .password-reset-back:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

[data-theme="dark"] .forgot-password-title,
[data-theme="dark"] .password-reset-title {
  color: var(--text-primary);
}

[data-theme="dark"] .forgot-password-description,
[data-theme="dark"] .password-reset-description {
  color: var(--text-muted);
}

[data-theme="dark"] .auth-success-message {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

@media (min-width: 768px) {
  .auth-container {
    padding: 40px 20px;
    padding-top: 50px;
  }

  .auth-wrapper {
    max-width: 440px;
    gap: 32px;
  }

  .auth-header {
    margin-bottom: 12px;
  }

  .auth-title {
    font-size: 36px;
  }

  .auth-subtitle {
    font-size: 17px;
  }

  .auth-card {
    padding: 0;
  }

  .auth-tabs {
    margin-bottom: 20px;
  }

  .auth-tab {
    padding: 16px 24px;
    font-size: 17px;
  }

  .auth-form {
    gap: 24px;
  }

  .auth-form-input {
    padding: 16px 18px;
    font-size: 16px;
  }

  .auth-submit-btn {
    padding: 16px 24px;
    font-size: 17px;
  }
}

@media (max-width: 767px) {
  .auth-container {
    padding: 20px 16px;
    padding-top: 20px;
    min-height: calc(100vh - 56px);
    margin-top: 36px;
  }

  .pre-auth-page .auth-container {
    padding-top: 120px;
  }

  .auth-wrapper {
    gap: 20px;
  }

  .auth-title {
    font-size: 32px;
  }

  .auth-subtitle {
    font-size: 16px;
  }

  .auth-tabs {
    margin-bottom: 28px;
  }

  .auth-tab {
    padding: 12px 16px;
    font-size: 15px;
  }

  .auth-form {
    gap: 18px;
  }

  .auth-form-input {
    padding: 13px 16px;
    font-size: 16px;
  }

  .auth-submit-btn {
    padding: 13px 24px;
    font-size: 15px;
  }

  .auth-footer-text {
    font-size: 12px;
    margin-top: 24px; /* More margin above on mobile */
  }

  .auth-page-header {
    margin-bottom: 20px;
  }
}

/* Pre-Auth Page Styles */
.pre-auth-page .auth-header {
  margin-top: 0;
  margin-bottom: 0;
}

.pre-auth-page .auth-title {
  margin-bottom: 10px;
}

.pre-auth-page .auth-subtitle {
  margin-bottom: 0;
  margin-top: 10px;
}

.pre-auth-content {
  width: 100%;
}

.pre-auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  margin-top: 32px;
  margin-bottom: 0;
}

.pre-auth-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  text-decoration: none;
}

.pre-auth-btn:hover {
  background: var(--bg-secondary);
  border-color: #d1d5db;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

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

.pre-auth-btn-google {
  background: var(--bg-primary);
  border-color: #e5e7eb;
}

.pre-auth-btn-google svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.pre-auth-btn-email {
  background: var(--bg-primary);
  border-color: #e5e7eb;
}

.pre-auth-btn-email i {
  font-size: 18px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.pre-auth-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 0;
}

.pre-auth-footer p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.pre-auth-footer a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.pre-auth-footer a:hover {
  color: var(--accent-blue);
}

/* Dark mode for pre-auth */
[data-theme="dark"] .pre-auth-btn {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .pre-auth-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-light);
}

[data-theme="dark"] .pre-auth-footer a {
  color: var(--text-primary);
}

[data-theme="dark"] .pre-auth-footer a:hover {
  color: var(--accent-blue);
}

/* Skeleton Loading State */
.pre-auth-skeleton {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.skeleton-title,
.skeleton-subtitle,
.skeleton-button,
.skeleton-footer {
  background: linear-gradient(
    90deg,
    var(--bg-secondary) 0%,
    var(--bg-tertiary) 50%,
    var(--bg-secondary) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}

.skeleton-title {
  height: 36px;
  width: 60%;
  margin: 0 auto;
}

.skeleton-subtitle {
  height: 20px;
  width: 50%;
  margin: 0 auto 32px;
}

.skeleton-button {
  height: 50px;
  width: 100%;
}

.skeleton-footer {
  height: 16px;
  width: 70%;
  margin: 24px auto 0;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

[data-theme="dark"] .skeleton-title,
[data-theme="dark"] .skeleton-subtitle,
[data-theme="dark"] .skeleton-button,
[data-theme="dark"] .skeleton-footer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 100%
  );
  background-size: 200% 100%;
}

@media (min-width: 768px) {
  .pre-auth-page .auth-header {
    margin-top: 60px;
  }

  .pre-auth-buttons {
    gap: 14px;
  }

  .pre-auth-btn {
    padding: 16px 24px;
    font-size: 16px;
  }
}

.form-hint {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
  line-height: 1.4;
}

/* Feed Page */

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

.new-post-card {
  margin-bottom: 32px;
}

.new-post-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #1f2937;
}

/* Responsive - Desktop */
@media (min-width: 768px) {
  .page-wrapper {
    padding: 24px;
  }

  .landing {
    padding: 120px 20px 60px;
    min-height: calc(100vh - 180px);
    margin-top: 70px;
  }

  .footer {
    padding: 4px 20px;
  }

  .landing-phrase {
    font-size: 80px;
    margin-bottom: 44px;
    letter-spacing: -0.5px;
  }

  .rate-based-on {
    font-size: 22px;
    margin-bottom: 30px;
  }

  .landing-buttons {
    flex-direction: row;
    justify-content: center;
    gap: 20px;
  }
}

/* iPad-specific styles - make content smaller */
@media (min-width: 768px) and (max-width: 1023px) {
  .landing-phrase {
    font-size: 48px !important;
    margin-bottom: 24px !important;
    letter-spacing: -0.4px !important;
  }

  .rate-based-on {
    font-size: 16px !important;
    margin-bottom: 20px !important;
  }

  .landing-button {
    padding: 14px 48px !important;
    font-size: 15px !important;
    max-width: 360px !important;
  }

  .landing-indicator {
    font-size: 13px !important;
    margin-top: 12px !important;
  }

  .landing-content {
    max-width: 560px !important;
    padding-top: 32px !important;
  }

  .landing-button {
    padding: 18px 72px;
    max-width: 300px;
    font-size: 18px;
  }

  .landing-info {
    margin-top: 64px;
    padding-top: 56px;
  }

  .landing-info {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }

  .card {
    padding: 24px;
  }

  .header {
    padding: 20px 24px;
  }

  .logo {
    font-size: 36px;
  }


  .profile-header-section {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .profile-info-display {
    text-align: center;
  }

  .profile-username-row {
    justify-content: center;
  }

  .profile-main-container {
    padding: 20px;
  }

  .edit-profile-header {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }
}

/* Image Carousel */
.image-carousel-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.plus-button-label {
  display: inline-block;
  cursor: pointer;
  align-self: flex-start;
}

.plus-button-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0066cc; /* Instagram blue */
  color: #fff;
  font-size: 20px;
  line-height: 1;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.plus-button-small:hover {
  background: #007acc;
}

.plus-button-label-small {
  display: inline-block;
  cursor: pointer;
}

.image-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.image-carousel::-webkit-scrollbar {
  display: none;
}

.carousel-image-item {
  position: relative;
  flex: 0 0 auto;
  width: 160px; /* Smaller thumbnail size */
  height: 160px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #efefef;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.carousel-image-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.carousel-image-item.current {
  border: 2px solid #0066cc;
}

.carousel-image-item.legacy {
  opacity: 0.7;
}

.carousel-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-image-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #0066cc; /* Blue for current */
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.carousel-image-badge.legacy {
  background: #8e8e8e; /* Grey for legacy */
}

.carousel-image-delete {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
  opacity: 0;
}

.carousel-image-item:hover .carousel-image-delete {
  opacity: 1;
}

.carousel-image-delete:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.carousel-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  color: #8e8e8e;
  font-size: 14px;
  border: 2px dashed #dbdbdb;
  border-radius: 8px;
  background: var(--bg-secondary);
}

/* Edit Profile Page */
.edit-profile-wrapper {
  padding-top: 80px;
  padding-bottom: 40px;
  min-height: calc(100vh - 120px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.edit-profile-container {
  width: 100%;
  max-width: 600px;
  background: var(--card-bg);
  border-radius: 3px;
  border: 1px solid #dbdbdb;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.edit-profile-header {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid #efefef;
}

.back-button {
  color: #6b7280;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
  margin-top: 20px;
  display: inline-block;
}

.back-button:hover {
  color: #374151;
  text-decoration: underline;
}

.edit-profile-title {
  font-size: 28px;
  font-weight: 600;
  color: #262626;
  margin: 0;
}

.edit-profile-card {
  background: var(--card-bg);
  border-radius: 3px;
  padding: 0;
  border: 1px solid #dbdbdb;
}

.edit-section {
  margin-bottom: 32px;
}

.edit-section:last-child {
  margin-bottom: 0;
}

.edit-avatar-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.edit-avatar-large {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
}

.edit-avatar-button {
  padding: 10px 24px;
  border: 1px solid #dbdbdb;
  border-radius: 4px;
  background: var(--card-bg);
  color: #262626;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
}

.edit-avatar-button:hover {
  background: #f0f0f0;
}

.edit-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #262626;
  margin-bottom: 8px;
}

.edit-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dbdbdb;
  border-radius: 4px;
  font-size: 14px;
  color: #262626;
  background: var(--bg-secondary);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.edit-input:focus {
  outline: none;
  border-color: #a8a8a8;
  box-shadow: 0 0 0 1px #a8a8a8;
}

.edit-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dbdbdb;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  background: var(--bg-secondary);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.edit-textarea:focus {
  outline: none;
  border-color: #a8a8a8;
  box-shadow: 0 0 0 1px #a8a8a8;
}

.save-profile-button {
  background: #0066cc;
  color: #fff;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.save-profile-button:hover {
  background: #007acc;
}

.success-message {
  color: #0066cc;
  font-size: 14px;
  margin-top: 12px;
  text-align: center;
}

/* Loading states */
.loading {
  text-align: center;
  padding: 40px;
  color: #6b7280;
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
}

.empty-state-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #374151;
}

.empty-state-text {
  font-size: 14px;
}


/* Edit Profile Modal */
.edit-profile-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  margin: 0;
}

.edit-profile-modal[style*="flex"],
.edit-profile-modal.show {
  display: flex;
}

.edit-profile-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(3px);
}

.edit-profile-modal-content {
  position: relative;
  background: var(--card-bg);
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
  max-width: 450px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1;
  margin: 0 auto;
  transform: none;
}

.edit-profile-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-color: var(--border-color);
}

.edit-profile-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.edit-profile-modal-close {
  background: rgba(0, 0, 0, 0.08);
  border: none;
  font-size: 24px;
  color: #000;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

[data-theme="dark"] .edit-profile-modal-close {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.edit-profile-modal-close svg {
  width: 20px;
  height: 20px;
  stroke: #000000 !important;
  transition: transform 0.2s ease;
}

[data-theme="dark"] .edit-profile-modal-close svg {
  stroke: #ffffff !important;
}

.edit-profile-modal-close:hover {
  background: rgba(0, 0, 0, 0.15);
  transform: scale(1.1);
}

.edit-profile-modal-close:hover svg {
  transform: rotate(90deg);
  stroke: #000000 !important;
}

[data-theme="dark"] .edit-profile-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .edit-profile-modal-close:hover svg {
  stroke: #ffffff !important;
}

.edit-profile-modal-body {
  padding: 20px;
}

.edit-profile-avatar-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.edit-profile-avatar-wrapper {
  position: relative;
  display: inline-block;
}

.edit-profile-avatar-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.edit-profile-avatar-upload-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1e40af;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.2s;
}

.edit-profile-avatar-upload-btn:hover {
  background: #1e40af;
  transform: scale(1.05);
}

.edit-profile-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.edit-profile-avatar-circle .avatar-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1e40af;
  color: #fff;
  font-weight: 600;
  font-size: 24px;
}

.edit-profile-field {
  margin-bottom: 20px;
}

.edit-profile-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #111827;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.edit-profile-input,
.edit-profile-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #111827;
  background: var(--card-bg);
  transition: all 0.2s ease;
  box-sizing: border-box;
  outline: none;
}

.edit-profile-input:hover,
.edit-profile-textarea:hover {
  border-color: #9ca3af;
}

.edit-profile-input:focus,
.edit-profile-textarea:focus {
  border-color: #1e40af;
  border-width: 2px;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.edit-profile-textarea {
  min-height: 80px;
  resize: vertical;
}

/* Toggle Switch Styles */
.edit-profile-advanced-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  background: transparent;
  border: none;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  margin-top: 8px;
}

.edit-profile-advanced-toggle:hover {
  color: #1e40af;
}

.edit-profile-advanced-toggle.active .advanced-settings-arrow {
  transform: rotate(180deg);
}

.advanced-settings-arrow {
  transition: transform 0.3s ease;
  color: #6b7280;
  flex-shrink: 0;
  margin-left: 8px;
}

.edit-profile-advanced-content {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  border-color: var(--border-color);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.edit-profile-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.edit-profile-toggle-label-group {
  flex: 1;
}

.edit-profile-toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.edit-profile-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.edit-profile-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.3s;
  border-radius: 24px;
}

.edit-profile-toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.edit-profile-toggle-switch input:checked + .edit-profile-toggle-slider {
  background-color: #1e40af;
}

.edit-profile-toggle-switch input:checked + .edit-profile-toggle-slider:before {
  transform: translateX(20px);
}

.edit-profile-toggle-switch input:focus + .edit-profile-toggle-slider {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.edit-profile-toggle-switch input:disabled + .edit-profile-toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Logout Button in Edit Profile Modal */
.edit-profile-logout-section {
  margin-top: 24px;
  padding-top: 24px;
  border-color: var(--border-color);
}

.edit-profile-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  background: #fef2f2;
  color: #ef4444;
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.edit-profile-logout-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

.edit-profile-logout-btn svg {
  flex-shrink: 0;
}

.edit-profile-logout-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Delete Account Button */
.edit-profile-delete-account-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  background: transparent;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.edit-profile-delete-account-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15);
}

.edit-profile-delete-account-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Delete Account Confirmation Modal - ChatGPT Style */
.delete-account-confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.delete-account-confirm-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.delete-account-confirm-modal-content {
  position: relative;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 440px;
  width: 100%;
  padding: 24px;
  z-index: 1;
  transition: background-color 0.3s ease;
  animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.delete-account-confirm-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  line-height: 1.4;
  transition: color 0.3s ease;
}

.delete-account-confirm-modal-message {
  font-size: 14px;
  color: var(--text-tertiary);
  margin: 0 0 8px 0;
  line-height: 1.5;
  transition: color 0.3s ease;
}

.delete-account-confirm-modal-submessage {
  font-size: 14px;
  color: var(--text-primary);
  margin: 0 0 16px 0;
  line-height: 1.5;
  font-weight: 500;
  transition: color 0.3s ease;
}

.delete-account-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.delete-account-email-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--input-bg);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.delete-account-email-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.delete-account-error {
  color: #ef4444;
  font-size: 13px;
  margin-top: -8px;
}

[data-theme="dark"] .delete-account-email-input {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .delete-account-email-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.2);
}

.delete-account-confirm-modal-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 24px;
}

.delete-account-confirm-btn-cancel,
.delete-account-confirm-btn-confirm {
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  border: none;
  min-width: 100px;
}

.delete-account-confirm-btn-cancel {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.delete-account-confirm-btn-cancel:hover {
  background: var(--border-light);
}

.delete-account-confirm-btn-confirm {
  background: #ef4444;
  color: #ffffff;
}

.delete-account-confirm-btn-confirm:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.delete-account-confirm-btn-confirm:active {
  transform: translateY(0);
}

.delete-account-confirm-btn-confirm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Logout Confirmation Modal - ChatGPT Style */
.logout-confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease-out;
}

.logout-confirm-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.logout-confirm-modal-content {
  position: relative;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 440px;
  width: 100%;
  padding: 24px;
  z-index: 1;
  transition: background-color 0.3s ease;
  animation: slideUp 0.2s ease-out;
}

.logout-confirm-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  line-height: 1.4;
  transition: color 0.3s ease;
}

.logout-confirm-modal-message {
  font-size: 14px;
  color: var(--text-tertiary);
  margin: 0 0 24px 0;
  line-height: 1.5;
  transition: color 0.3s ease;
}

.logout-confirm-modal-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 24px;
}

.logout-confirm-btn-cancel,
.logout-confirm-btn-confirm {
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  border: none;
  min-width: 100px;
}

.logout-confirm-btn-cancel {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.logout-confirm-btn-cancel:hover {
  background: var(--border-light);
}

.logout-confirm-btn-confirm {
  background: var(--accent-blue);
  color: #ffffff;
}

.logout-confirm-btn-confirm:hover {
  background: var(--accent-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

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

/* Unsaved Changes Confirmation Modal */
.unsaved-changes-confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.unsaved-changes-confirm-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(4px);
}

[data-theme="dark"] .unsaved-changes-confirm-modal-overlay {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
}

.unsaved-changes-confirm-modal-content {
  position: relative;
  background: var(--card-bg);
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
  max-width: 400px;
  width: 100%;
  padding: 24px;
  z-index: 1;
  transition: background-color 0.3s ease;
}

.unsaved-changes-confirm-modal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px 0;
  transition: color 0.3s ease;
}

.unsaved-changes-confirm-modal-message {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 24px 0;
  line-height: 1.6;
  transition: color 0.3s ease;
}

.unsaved-changes-confirm-modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.unsaved-changes-confirm-btn-cancel,
.unsaved-changes-confirm-btn-save {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: inherit;
}

.unsaved-changes-confirm-btn-cancel {
  background: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.unsaved-changes-confirm-btn-cancel:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-light);
}

.unsaved-changes-confirm-btn-save {
  background: var(--accent-blue);
  color: #ffffff;
}

.unsaved-changes-confirm-btn-save:hover {
  background: var(--accent-blue-hover);
}

.unsaved-changes-confirm-btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

[data-theme="dark"] .unsaved-changes-confirm-modal-content {
  background: var(--card-bg);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .unsaved-changes-confirm-modal-title {
  color: var(--text-primary);
}

[data-theme="dark"] .unsaved-changes-confirm-modal-message {
  color: var(--text-tertiary);
}

[data-theme="dark"] .unsaved-changes-confirm-btn-cancel {
  background: var(--card-bg);
  color: var(--text-primary);
  border-color: var(--border-color);
}

[data-theme="dark"] .unsaved-changes-confirm-btn-cancel:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-light);
}

.edit-profile-helper {
  font-size: 12px;
  color: #6b7280;
  margin: 6px 0 0 0;
}

.edit-profile-helper-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.edit-profile-counter {
  font-size: 12px;
  color: #6b7280;
}

.edit-profile-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #ef4444;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
  display: none;
}

.edit-profile-error.show {
  display: block;
}

.edit-profile-buttons {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.edit-profile-btn-cancel,
.edit-profile-btn-save {
  flex: 1;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.edit-profile-btn-cancel {
  background: var(--bg-tertiary);
  color: #111827;
  border: 1px solid var(--border-color);
}

.edit-profile-btn-cancel:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.edit-profile-btn-save {
  background: #1e40af;
  color: #fff;
}

.edit-profile-btn-save:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.edit-profile-btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .edit-profile-buttons {
    flex-direction: column;
  }

  .edit-profile-btn-cancel,
  .edit-profile-btn-save {
    width: 100%;
  }
}

/* Mobile breakpoint - show nav links directly */
@media (max-width: 768px) {
  .nav-links {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
  }

  .nav-menu-btn {
    display: none;
  }

  .landing {
    margin-top: 0px;
    padding: 60px 20px 10px 20px;
    min-height: calc(100vh - 56px - 80px); /* Account for header and footer */
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  
  /* Start page - ensure footer is visible */
  body.start-page .landing {
    flex: 1;
    min-height: auto;
    padding-top: 100px;
    padding-bottom: 20px;
  }

  .landing-content {
    max-width: 100%;
    padding: 0 8px;
  }

  .landing-phrase {
    font-size: 40px !important;
    margin-bottom: 16px !important;
    line-height: 1.2 !important;
  }

  .rate-based-on {
    font-size: 16px !important;
    margin-bottom: 16px !important;
  }

  .landing-button {
    padding: 14px 40px !important;
    font-size: 14px !important;
    max-width: 320px !important;
    border-radius: 10px !important;
  }

  .landing-indicator {
    margin-bottom: 4px !important;
    font-size: 12px !important;
    margin-top: 6px !important;
  }

  .profile-page-wrapper {
    margin-top: 36px !important;
    padding-top: 10px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .profile-container {
    padding: 0 8px !important;
  }

  .profile-hero {
    margin-top: 36px !important;
    margin-bottom: 24px !important;
  }

  .profile-avatar-row {
    gap: 16px !important;
    margin-bottom: 16px !important;
  }

  .profile-avatar-container {
    width: 80px !important;
    height: 80px !important;
  }

  .profile-avatar-container .avatar-initials {
    font-size: 32px !important;
  }

  .profile-username {
    font-size: 24px !important;
  }

  .profile-display-name {
    font-size: 15px !important;
  }

  .profile-bio-text {
    font-size: 13px !important;
  }

  .score-card {
    padding: 20px 16px !important;
    margin-bottom: 24px !important;
    gap: 16px !important;
  }

  .score-box {
    padding: 12px 8px !important;
  }

  .score-box:nth-child(1),
  .score-box:nth-child(2) {
    padding-bottom: 16px !important;
  }

  .score-box:nth-child(3),
  .score-box:nth-child(4) {
    padding-top: 16px !important;
  }

  .score-value {
    font-size: 32px !important;
    margin-bottom: 6px !important;
  }

  .score-label {
    font-size: 11px !important;
    font-weight: 600 !important;
  }

  .btn-edit-profile {
    padding: 7px 14px !important;
    font-size: 13px !important;
  }

  .current-images-section {
    gap: 16px !important;
    margin-bottom: 24px !important;
  }

  .current-image-card {
    margin-bottom: 16px !important;
    padding: 16px !important;
    border-radius: 12px !important;
  }

  .current-image-header {
    padding: 0 !important;
    margin-bottom: 12px !important;
  }

  .current-image-title {
    font-size: 16px !important;
    font-weight: 700 !important;
  }

  .current-image-header-actions {
    gap: 8px !important;
  }

  .current-image-menu-btn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px !important;
  }

  .current-image-menu-btn i {
    font-size: 16px !important;
  }

  .current-image-upload-header-btn {
    padding: 8px 14px !important;
    font-size: 13px !important;
    border-radius: 8px !important;
    gap: 4px !important;
  }

  .current-image-upload-header-btn svg {
    width: 14px !important;
    height: 14px !important;
  }

  .current-image-container {
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 12px !important;
    aspect-ratio: 1 / 1.3 !important;
    width: 100% !important;
    overflow: hidden !important;
  }

  .current-image-container img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block !important;
    min-width: 100% !important;
    min-height: 100% !important;
  }

  .current-image-upload-wrapper {
    padding: 0 !important;
    gap: 12px !important;
  }

  .current-image-upload-area {
    border-radius: 12px !important;
    border-width: 2px !important;
  }

  .current-image-update-btn {
    width: 100% !important;
    margin: 0 !important;
    padding: 12px !important;
    font-size: 14px !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
  }

  .footer {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    padding: 8px 16px;
    margin-top: 0 !important;
  }

  .start-page .footer {
    margin-top: 10px !important;
  }

  body:has(.auth-container) .footer {
    margin-top: 0 !important;
  }

  .profile-page .footer {
    margin-top: 0 !important;
  }

  .footer-text {
    font-size: 12px !important;
  }

  /* Ensure all containers respect viewport width on mobile */
  .page-wrapper,
  .feed-page-wrapper,
  .feed-container-centered,
  .post-card,
  .post-content-wrapper,
  .post-rating-wrapper,
  .post-comments-wrapper {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  
  .post-content-wrapper {
    flex-direction: column !important;
  }
  
  .post-image-wrapper {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .post-rating-wrapper {
    width: 100% !important;
  }
  
  /* post-image-wrapper is handled separately to maintain aspect ratio */

  .feed-page-wrapper {
    padding-top: 4px;
    padding-bottom: 0;
  }

  .feed-container-centered {
    padding: 0 8px;
  }

  .post-card {
    margin-bottom: 16px;
    padding: 8px;
    border-radius: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .post-content-wrapper {
    width: 100%;
    box-sizing: border-box;
  }

  .post-header {
    padding: 0 0 4px 0;
    margin-top: 4px;
    margin-bottom: 6px;
    width: 100%;
    box-sizing: border-box;
  }

  .post-caption {
    margin-bottom: 8px !important;
  }

  .post-image-wrapper {
    margin-bottom: 8px !important;
  }

  /* Profile picture and username sizes remain consistent across all devices */

  /* Make post images smaller on mobile - maintain aspect ratio */
  .post-image-wrapper {
    aspect-ratio: 1 / 1.3 !important;
    width: 70% !important;
    max-width: 70% !important;
    margin: 0 auto;
    border-radius: 10px;
    margin-bottom: 0px;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    /* Ensure aspect ratio is never broken */
    min-height: 0;
    max-height: none !important;
    height: auto !important;
  }

  /* Prevent images from causing overflow and ensure proper square display */
  .post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
  }

  .current-image-container img {
    object-fit: cover;
    object-position: center center;
  }

  .profile-avatar-container img,
  .profile-avatar-display img,
  .avatar-image {
    object-fit: cover;
    object-position: center center;
  }

  .current-image-upload-preview img {
    object-fit: cover;
    object-position: center center;
  }

  .post-header .avatar {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    background-size: cover;
    background-position: center center;
    box-shadow: none !important;
  }

  .post-header .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    box-shadow: none !important;
  }
  
  .post-username {
    font-size: 18px !important;
  }

  /* Mobile: Fixed Next Post button at bottom */
  .post-rating-wrapper {
    position: relative;
    padding-bottom: 80px;
    margin-top: 0px;
    width: 100%;
    box-sizing: border-box;
  }

  .post-rating-wrapper .post-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 24px 10px 24px;
    background: transparent;
    border-top: none;
    z-index: 10;
    margin: 0;
    box-shadow: none;
    box-sizing: border-box;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .btn-next-post {
    width: 100%;
    padding: 14px 20px !important;
    font-size: 15px !important;
    border-radius: 10px !important;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    margin: 0;
    position: relative;
  }

  /* Mobile: Fixed button at bottom, scrollable comments - only when comments are visible */
  .post-comments-wrapper[style*="display: block"] {
    height: calc(100vh - 200px);
    max-height: 500px;
    position: relative;
    overflow: hidden;
    gap: 0;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
  }

  .post-comments-wrapper[style*="display: block"] .comments-section {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-bottom: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: flex;
    flex-direction: column;
  }
  
  .post-comments-wrapper[style*="display: block"] .comments-section:has(.empty-state-text) {
    overflow-y: hidden;
  }
  
  .post-comments-wrapper[style*="display: block"] .comment-form {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 5px 10px 5px;
    padding: 16px;
    background: transparent;
    border-top: none;
    box-shadow: none;
    z-index: 5;
  }
  
  /* Adjust for mobile keyboard */
  @media (max-width: 768px) {
    .post-comments-wrapper[style*="display: block"] .comment-form:has(input:focus) {
      bottom: env(keyboard-inset-height, 0);
    }
  }

  .post-comments-wrapper[style*="display: block"] .comments-section::-webkit-scrollbar {
    display: none;
  }

  .post-comments-wrapper[style*="display: block"] .comments-list {
    flex: 1;
    max-height: none;
    min-height: 0;
  }

  .post-comments-wrapper[style*="display: block"] .post-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: var(--card-bg);
    border-color: var(--border-light);
    z-index: 10;
    margin-top: 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
  }
  
  .post-comments-wrapper .btn-next-post {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    background: #1e40af;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }
  
  .post-comments-wrapper .btn-next-post:hover {
    background: #1e40af;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  }
  
  .post-comments-wrapper .btn-next-post:active {
    transform: translateY(0);
  }
  
  /* Better mobile touch targets */
  .slider-group {
    margin: 8px 0;
    padding: 0;
  }

  .slider {
    height: 6px !important;
    width: 100%;
    min-height: auto;
  }

  .slider::-webkit-slider-thumb {
    width: 20px !important;
    height: 20px !important;
  }

  .slider::-moz-range-thumb {
    width: 20px !important;
    height: 20px !important;
  }

  .slider-label {
    font-size: 16px !important;
    font-weight: 600 !important;
    margin-bottom: 6px;
    padding: 0;
  }

  .slider-value {
    font-size: 16px !important;
  }

  .post-rating {
    padding: 8px 0;
    width: 100%;
    box-sizing: border-box;
  }
  
  .post-edit-btn,
  .post-delete-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
  }
  
  .post-username-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 4px 0;
  }

  .post-comments-toggle {
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    font-size: 13px;
    border-radius: 22px;
    bottom: 12px;
    right: 12px;
  }

  .post-comments-toggle svg {
    width: 18px;
    height: 18px;
  }

  .rating-comparison-view {
    padding: 12px 0;
  }

  .comparison-stats {
    gap: 12px;
    margin-bottom: 12px;
  }

  .comparison-stat-value {
    font-size: 28px !important;
  }

  .comparison-stat-label {
    font-size: 10px !important;
  }

  .comparison-user-rating {
    font-size: 11px !important;
  }

  .rating-comparison-note {
    font-size: 13px !important;
    margin-bottom: 16px;
    padding: 0 8px;
  }

  /* Auth page mobile improvements */
  .auth-container {
    padding: 80px 24px 0 24px;
    justify-content: flex-start;
    min-height: auto;
  }

  .auth-wrapper {
    max-width: 100%;
    gap: 8px;
    padding: 0 8px;
  }

  .auth-header {
    margin-top: 0;
    margin-bottom: 12px;
  }

  .auth-title {
    font-size: 30px;
    margin-bottom: 2px;
  }

  .auth-subtitle {
    font-size: 14px;
    margin-bottom: 0;
  }

  .auth-card {
    padding: 0;
  }

  .auth-tabs {
    margin-bottom: 12px;
  }

  .auth-tab {
    padding: 10px 14px;
    font-size: 14px;
  }

  .auth-form {
    gap: 10px;
  }

  .auth-form-label {
    font-size: 12px;
    margin-bottom: 4px;
  }

  .auth-form-input {
    padding: 11px 12px;
    font-size: 14px;
    border-radius: 8px;
  }

  .auth-submit-btn {
    padding: 11px 18px;
    font-size: 14px;
    border-radius: 8px;
    margin-top: 0;
    margin-bottom: 0;
  }

  .auth-error-message {
    font-size: 12px !important;
    margin-top: -8px !important;
    margin-bottom: 2px !important;
  }

  .auth-footer-text {
    font-size: 11px;
    margin-top: 16px; /* More margin above on mobile */
    margin-bottom: 0;
  }
  
  /* Match start page footer spacing - no extra space */
  body.auth-page .auth-container {
    padding-bottom: 0;
  }
  
  body.auth-page .auth-submit-btn {
    margin-bottom: 0;
  }
  
  body.auth-page .auth-form {
    margin-bottom: 0;
    padding-bottom: 0;
  }
  
  body.auth-page .auth-wrapper {
    margin-bottom: 0;
    padding-bottom: 0;
  }
  
  body.auth-page .footer {
    margin-top: 0;
    margin-bottom: 0;
    padding: 12px 0;
  }
  
  /* More margin above Clavic © 2025 on auth page */
  body.auth-page .footer-brand {
    margin-top: 4px;
  }
}

/* Crop Modal Styles */
.crop-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.crop-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.crop-modal-content {
  position: relative;
  background: var(--card-bg);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

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

.crop-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.crop-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.crop-modal-close svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.crop-modal-close:hover {
  background: var(--bg-tertiary);
  color: #111827;
}

.crop-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  flex: 1;
}

.crop-container {
  position: relative;
  width: 100%;
  min-height: 500px;
  max-height: 600px;
  overflow: visible;
  border-radius: 12px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#cropCanvas {
  display: block;
  max-width: 100%;
  min-height: 500px;
  max-height: 600px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

#cropCanvas:active {
  cursor: grabbing;
}

.crop-overlay {
  position: absolute;
  pointer-events: none;
  border: 3px solid rgba(255, 255, 255, 1);
  box-sizing: border-box;
  z-index: 10;
  display: block;
}

.crop-preview-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.crop-preview-label {
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#cropPreview {
  border-color: var(--border-color);
  display: block;
}

#cropPreview.circle-preview {
  border-radius: 50%;
}

#cropPreview.square-preview {
  border-radius: 12px;
}

.crop-modal-footer {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-color: var(--border-color);
  justify-content: flex-end;
}

@media (max-width: 768px) {
  .crop-modal-content {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  
  .crop-container {
    min-height: 400px;
    max-height: 500px;
  }
  
  #cropCanvas {
    min-height: 400px;
    max-height: 500px;
  }
}

/* Rating Comparison View (replaces sliders) */
.rating-comparison-view {
  padding: 16px 0;
}

.comparison-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.comparison-stat {
  text-align: center;
}

.comparison-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.comparison-stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 3px;
  line-height: 1;
}

.comparison-user-inline {
  font-size: 14px;
  font-weight: 400;
  color: #9ca3af;
  margin-left: 6px;
}

.comparison-user-rating {
  font-size: 12px;
  font-weight: 400;
  color: #9ca3af;
  margin-top: 4px;
  line-height: 1.2;
}

/* Profile link disabled state */
.post-header-link-disabled {
  pointer-events: none;
  cursor: default;
  opacity: 0.7;
}

.post-header-link-disabled .avatar,
.post-header-link-disabled .post-username {
  filter: blur(4px);
  -webkit-filter: blur(4px);
}

.profile-lock-hint {
  color: #9ca3af;
  font-size: 12px;
  font-weight: 400;
}

.rating-comparison-note {
  text-align: center;
  font-size: 15px;
  margin-bottom: 24px;
  padding-top: 0;
}

.rating-comparison-link {
  color: #6b7280;
  text-decoration: none;
  font-weight: 500;
}

.rating-comparison-link:hover {
  color: #6b7280;
  text-decoration: none;
}

/* Notification Badge */
.nav-notification-btn {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 10px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Activity Center */
.notification-center {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 60px 20px 20px;
}

.notification-center-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(2px);
}

.notification-center-panel {
  position: relative;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  z-index: 1001;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.notification-center-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 24px;
  border-color: var(--border-light);
  position: relative;
  background: var(--card-bg);
}

.notification-center-title {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  margin: 0;
  letter-spacing: -0.02em;
}

.notification-center-back {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
  line-height: 1;
  display: none; /* Hidden on desktop */
}

.notification-center-back:hover {
  background: #e5e7eb;
  color: #111827;
  transform: translateY(-50%) scale(1.05);
}

.notification-center-close {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.08);
  border: none;
  color: #000;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  line-height: 1;
}

[data-theme="dark"] .notification-center-close {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.notification-center-close:hover {
  background: rgba(0, 0, 0, 0.15);
  transform: translateY(-50%) scale(1.1);
}

[data-theme="dark"] .notification-center-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.notification-center-close:hover svg {
  transform: rotate(90deg);
  stroke: #000000 !important;
}

[data-theme="dark"] .notification-center-close:hover svg {
  stroke: #ffffff !important;
}

.notification-center-close svg {
  width: 20px;
  height: 20px;
  stroke: #000000 !important;
  transition: transform 0.2s ease;
}

[data-theme="dark"] .notification-center-close svg {
  stroke: #ffffff !important;
}

.notification-center-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 0 0;
  background: var(--card-bg);
}

.notification-center-body::-webkit-scrollbar {
  width: 6px;
}

.notification-center-body::-webkit-scrollbar-track {
  background: transparent;
}

.notification-center-body::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.notification-center-body::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.notification-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #6b7280;
}

.notification-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
}

.notification-empty-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.4;
  filter: grayscale(100%);
}

.notification-empty-text {
  color: #9ca3af;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.notification-error {
  padding: 40px 20px;
  text-align: center;
}

.notification-error-text {
  color: #ef4444;
  font-size: 14px;
}

/* Notification Item */
.notification-item {
  display: flex;
  align-items: flex-start;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  cursor: default;
  position: relative;
  gap: 14px;
  transition: background-color 0.2s ease;
  background: var(--card-bg);
}

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

.notification-item.unread {
  background: var(--card-bg);
  border-left: 3px solid #1e40af;
}

.notification-item.unread:hover {
  background: var(--bg-tertiary);
}

.notification-avatar-link {
  text-decoration: none;
  display: flex;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.notification-avatar-link:hover {
  transform: scale(1.05);
}

.notification-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border-light);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  position: relative;
  cursor: pointer;
  transition: box-shadow 0.2s ease;
}

.notification-avatar-link:hover .notification-avatar {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.notification-avatar-img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.notification-avatar-initials {
  font-size: 16px;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.notification-content {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
  padding-right: 32px;
}

.notification-text {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 4px;
  font-weight: 400;
}

.notification-username-link {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}

.notification-item.unread .notification-text {
  font-weight: 500;
  color: var(--text-secondary);
}

.notification-time {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

.notification-dot {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 8px;
  height: 8px;
  background: #1e40af;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--card-bg), 0 2px 6px rgba(37, 99, 235, 0.4);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

/* Mobile styles for notification center */
@media (max-width: 768px) {
  .notification-center {
    padding: 0;
    align-items: stretch;
  }

  .notification-center-panel {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }

  .notification-center-header {
    padding: 18px 20px;
  }

  .notification-center-title {
    font-size: 20px;
  }

  .notification-center-back {
    display: none !important; /* Hide back button on mobile */
  }

  .notification-center-close {
    display: flex; /* Show X button on mobile with policy page style */
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.08);
    border: none;
    color: #000;
  }

  [data-theme="dark"] .notification-center-close {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
  }

  .notification-center-close:hover {
    background: rgba(0, 0, 0, 0.15);
    transform: translateY(-50%) scale(1.1);
  }

  [data-theme="dark"] .notification-center-close:hover {
    background: rgba(255, 255, 255, 0.2);
  }

  .notification-center-close:hover svg {
    transform: rotate(90deg);
    stroke: #000000 !important;
  }

  [data-theme="dark"] .notification-center-close:hover svg {
    stroke: #ffffff !important;
  }

  .notification-center-close svg {
    width: 20px;
    height: 20px;
    stroke: #000000 !important;
    transition: transform 0.2s ease;
  }

  [data-theme="dark"] .notification-center-close svg {
    stroke: #ffffff !important;
  }

  .notification-item {
    padding: 14px 16px;
    gap: 12px;
  }

  .notification-avatar {
    width: 40px;
    height: 40px;
  }

  .notification-avatar-initials {
    font-size: 15px;
  }

  .notification-content {
    padding-right: 28px;
  }

  .notification-dot {
    top: 16px;
    right: 16px;
    width: 7px;
    height: 7px;
  }
}

/* Dark Mode Toggle Button */
/* Dark mode toggle - standalone (mobile) */
.dark-mode-toggle.mobile-only {
  position: fixed;
  bottom: 18px;
  right: 16px;
  z-index: 10001; /* Higher than footer to stay above it */
  display: none; /* Hidden by default, shown on mobile */
  pointer-events: auto;
}

.dark-mode-toggle.mobile-only .dark-mode-btn {
  pointer-events: auto;
  cursor: pointer;
}

/* Dark mode toggle inside footer - desktop only */
.footer .dark-mode-toggle,
.footer-dark-toggle {
  position: static;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* On mobile, hide footer toggle and show standalone */
@media (max-width: 768px) {
  /* Hide dark mode toggle in footer on mobile */
  .footer-dark-toggle {
    display: none !important;
  }
  
  /* Hide mobile-only toggle when nav theme toggle is present */
  .dark-mode-toggle.mobile-only {
    display: none !important;
  }
}

.dark-mode-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid #ffffff;
  border-radius: 24px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-family: inherit;
}

.dark-mode-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);

}

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

.dark-mode-btn i {
  font-size: 16px;
  transition: transform 0.3s ease;
}

.dark-mode-label {
  font-size: 14px;
}

@media (max-width: 768px) {
  .dark-mode-toggle {
    bottom: 18px;
    right: 16px;
  }
  
  .dark-mode-btn {
    padding: 10px 16px;
    font-size: 13px;
  }
  
  .dark-mode-label {
    font-size: 13px;
  }
}

/* Dark Mode Styles */
[data-theme="dark"] {
  /* Cards and containers */
  .card,
  .auth-card,
  .edit-profile-card,
  .score-card,
  .current-image-card,
  .post-card,
  .notification-center-panel {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
  }

  /* Text colors */
  h1, h2, h3, h4, h5, h6,
  .nav-brand,
  .auth-title,
  .edit-profile-title,
  .profile-username,
  .profile-display-name,
  .current-image-title,
  .post-header-username,
  .post-header-time,
  .score-value,
  .stat-item strong,
  .profile-bio-text {
    color: var(--text-secondary);
  }

  .auth-subtitle,
  .profile-bio-text,
  .post-header-time,
  .score-label,
  .stat-label,
  .text-muted {
    color: var(--text-tertiary);
  }

  /* Navigation */
  .nav-link {
    color: var(--text-tertiary);
  }

  .nav-link:hover {
    color: var(--text-tertiary);
    transform: scale(1.05);
  }

  /* Buttons */
  .btn-primary {
    background: var(--accent-blue);
    color: #ffffff;
  }

  .btn-primary:hover {
    background: var(--accent-blue-hover);
    color: #ffffff !important;
  }

  .btn-secondary,
  .btn-edit-profile,
  .btn-logout {
    background: var(--card-bg);
    color: var(--text-primary);
    border-color: var(--border-color);
  }


  /* Inputs */
  .auth-form-input,
  .edit-input,
  .edit-textarea,
  .edit-profile-input,
  .edit-profile-textarea,
  .comment-input {
    background: var(--input-bg);
    color: #ffffff;
    border-color: var(--input-border);
    border-width: 1.5px;
  }

  .auth-form-input:hover,
  .edit-profile-input:hover,
  .edit-profile-textarea:hover {
    border-color: #6b7280;
  }

  .auth-form-input:focus,
  .edit-input:focus,
  .edit-textarea:focus,
  .edit-profile-input:focus,
  .edit-profile-textarea:focus {
    border-color: var(--accent-blue);
    border-width: 2px;
    background: var(--input-bg);
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.12);
  }

  .comment-input:focus {
    outline: none;
    background: rgb(21, 20, 39) !important;
    border: 1px solid transparent !important;
    backdrop-filter: blur(20px) !important;
    border-color: transparent !important;
    border-width: 1px !important;
    box-shadow: none !important;
  }

  .auth-form-input::placeholder,
  .edit-input::placeholder,
  .edit-textarea::placeholder,
  .comment-input::placeholder {
    color: var(--text-muted);
  }

  /* Tabs */
  .auth-tabs,
  .profile-tabs {
    border-bottom-color: var(--border-color);
  }

  .auth-tabs {
    border-bottom-color: var(--border-color);
  }

  .auth-tab {
    color: var(--text-tertiary);
  }

  .auth-tab:hover {
    color: var(--text-secondary);
  }

  .auth-tab.active {
    color: #2563eb; /* Darker blue for dark mode */
    border-bottom-color: #2563eb;
  }

  .auth-tab.active:hover {
    color: #3b82f6; /* Lighter on hover */
    border-bottom-color: #3b82f6;
  }

  .profile-tab {
    color: var(--text-tertiary);
  }

  .profile-tab.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
  }

  /* Modals */
  .modal-overlay {
    background: var(--overlay-bg);
  }

  .modal-content,
  .edit-profile-modal-content,
  .post-modal-content {
    background: var(--modal-bg);
    color: var(--text-primary);
  }

  .post-modal {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(3px);
  }

  .score-modal {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
  }

  .edit-profile-modal-overlay {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(3px);
  }

  .logout-confirm-modal-overlay {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(3px);
  }

  .crop-modal-overlay {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(3px);
  }

  .notification-center-overlay {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(3px);
  }

  .post-modal-info h3 {
    color: #ffffff !important;
  }

  .post-modal-info p {
    color: var(--text-tertiary) !important;
  }

  .post-delete-btn {
    color: #ffffff !important;
  }

  /* Dropdowns */
  .post-grid-menu-dropdown,
  .notification-center-panel {
    background: var(--card-bg);
    border-color: var(--border-color);
  }

  .post-grid-menu-item {
    color: var(--text-primary);
  }

  .post-grid-menu-item:hover {
    background: var(--bg-tertiary);
  }

  /* Notification center */
  .notification-center-header {
    background: var(--card-bg);
    border-bottom-color: var(--border-color);
  }

  .notification-item {
    border-bottom-color: var(--border-color);
    background: var(--card-bg);
  }

  .notification-item:hover {
    background: rgba(255, 255, 255, 0.05);
  }

  .notification-item.unread {
    background: var(--card-bg);
    border-left: 3px solid #1e40af;
  }

  .notification-item.unread:hover {
    background: rgba(255, 255, 255, 0.05);
  }

  .notification-avatar-link:hover .notification-avatar {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  }

  .notification-avatar {
    border-color: var(--border-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  }

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

  .notification-item.unread .notification-text {
    color: var(--text-primary);
  }

  .notification-username-link {
    color: #ffffff !important; 
  }

  .notification-time {
    color: var(--text-tertiary);
  }

  .notification-dot {
    background: #1e40af;
    box-shadow: 0 0 0 2px var(--card-bg), 0 2px 6px rgba(37, 99, 235, 0.5);
  }

  /* Comments */
  .comments-section {
    border-top-color: var(--border-color);
  }

  .comments-title {
    color: var(--text-secondary);
  }

  .comment-username-link {
    color: var(--text-primary);
  }

  .comment-username-link:hover {
    color: var(--text-primary) !important;
    text-decoration: none !important;
  }

  .comment-username {
    color: var(--text-primary);
  }

  .comment-text-content {
    color: var(--text-primary);
  }

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

  .comment-reply-btn {
    color: #ffffff !important;
  }

  /* Sliders */
  .slider {
    background: #9ca3af; /* Lighter gray for slider track */
  }

  .slider::-webkit-slider-thumb {
    background: #1e40af; /* Lighter blue for slider thumb */
  }

  .slider::-moz-range-thumb {
    background: #1e40af; /* Lighter blue for slider thumb */
  }

  /* Empty states */
  .empty-state-text {
    color: var(--text-tertiary);
  }

  /* Landing page */
  .landing-phrase,
  .rate-based-on,
  .landing-indicator {
    color: var(--text-primary);
  }

  #physiqueButton {
    color: #ffffff;
  }



  /* Profile sections */
  .profile-hero {
    background: var(--card-bg);
    border-color: var(--border-color);
  }

  .profile-stats {
    border-color: var(--border-color);
  }

  .stat-item {
    border-color: var(--border-color);
  }

  /* Post elements */
  .post-header {
    border-bottom-color: var(--border-color);
  }

  .post-actions {
    border-top-color: var(--border-color);
  }

  /* Remove white outline/shadow around avatar in dark mode */
  .avatar {
    outline: none !important;
    box-shadow: none !important;
  }

  .avatar {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    outline: none !important;
    box-shadow: none !important;
  }
  
  .post-header .avatar {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    outline: none !important;
    box-shadow: none !important;
  }
  
  .post-username {
    font-size: 18px !important;
    color: #ffffff !important;
  }

  .post-username-link {
    color: #ffffff !important;
  }

  .post-username-link:hover {
    color: #ffffff !important;
    text-decoration: underline;
  }

  .post-type-time {
    color: #ffffff !important;
  }

  .rating-comparison-link {
    color: #ffffff !important;
  }

  .rating-comparison-link:hover {
    color: #ffffff !important;
  }

  /* Error and success messages */
  .error-message,
  .auth-error-message {
    color: #ef4444;
  }

  .success-message {
    color: #10b981;
  }

  /* Navigation buttons */
  .nav-link-button,
  .nav-notification-btn,
  .nav-home-btn,
  .mobile-notification-btn,
  .mobile-home-btn {
    color: var(--text-tertiary);
  }

  .nav-link-button:hover,
  .nav-notification-btn:hover,
  .nav-home-btn:hover,
  .mobile-notification-btn:hover,
  .mobile-home-btn:hover {
    color: var(--accent-blue);
    background: transparent;
  }

  .nav-link-button.active,
  .nav-home-btn.active,
  .mobile-home-btn.active {
    color: var(--accent-blue);
  }

  /* Mobile menu */
  .nav-menu-panel {
    background: var(--card-bg);
    border-bottom-color: var(--border-color);
  }

  .nav-menu-panel a,
  .nav-menu-panel button {
    color: var(--text-primary);
  }


  .nav-menu-btn {
    color: var(--text-secondary);
  }

  .mobile-logout-btn {
    color: var(--text-tertiary);
    border-top-color: var(--border-color);
  }

  .mobile-logout-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
  }

  /* Post grid */
  .post-grid-item {
    background: var(--bg-tertiary);
  }

  .post-grid-menu-dropdown {
    background: var(--card-bg);
    border-color: var(--border-color);
    box-shadow: 0 4px 12px var(--shadow-color);
  }

  .post-grid-menu-item {
    color: var(--text-primary);
  }

  .post-grid-menu-item:hover {
    background: var(--bg-tertiary);
  }

  /* Current image menu button (three dots) */
  .current-image-menu-btn {
    color: #cccccc;
  }

  .current-image-menu-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
  }

  /* Current image menu item (three dot menu) */
  .current-image-menu-item {
    color: #ffffff !important;
  }

  .current-image-menu-item:hover {
    background: var(--bg-tertiary);
    color: #ffffff !important;
  }

  /* Score card */
  .score-box {
    border-right-color: var(--border-color);
    border-bottom-color: var(--border-color);
  }

  /* Profile elements */
  .profile-tabs {
    border-bottom-color: var(--border-color);
  }

  .current-image-header {
    border-bottom-color: var(--border-color);
  }

  /* Auth elements */
  .auth-wrapper {
    background: transparent;
  }

  .auth-footer-text {
    color: var(--text-tertiary);
  }

  /* Comment input background */
  .comment-input {
    background: rgba(26, 26, 26, 0.8);
  }

  [data-theme="dark"] .comment-input {
    background: rgba(26, 26, 26, 0.8);
  }

  /* Loading screens */
  .loading-spinner {
    background: rgba(0, 0, 0, 0.95) !important;
  }

  .loading {
    color: var(--text-tertiary);
  }

  .notification-loading {
    color: var(--text-tertiary);
  }

  /* Post comments toggle */
  .post-comments-toggle {
    background: rgba(0, 0, 0, 0.4);
    color: white;
  }

  .post-comments-toggle:hover {
    background: rgba(0, 0, 0, 0.6);
  }

  /* Notification badge */
  .notification-badge {
    background: var(--accent-blue);
    color: white;
  }

  /* All text elements */
  p, span, div, label {
    color: inherit;
  }

  /* Links */
  a {
    color: var(--accent-blue);
  }

  a:hover {
    color: var(--accent-blue-hover);
  }

  .nav-brand:hover {
    color: var(--text-secondary) !important;
  }

  /* Dark mode toggle button */
  .dark-mode-btn {
    background: var(--card-bg);
    color: var(--text-primary);
    border-color: var(--border-color);
  }

  .dark-mode-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-light);
  }

  /* Post image wrapper */
  .post-image-wrapper {
    background: var(--bg-tertiary);
  }

  /* Upload areas */
  .current-image-upload-area,
  .legacy-image-upload-area {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
  }

  .current-image-upload-area:hover,
  .legacy-image-upload-area:hover {
    background: var(--border-light);
    border-color: var(--border-light);
  }

  /* Edit profile sections */
  .edit-section {
    border-bottom-color: #333333;
  }

  /* Edit profile modal dark mode fixes */
  .edit-profile-advanced-toggle {
    color: #ffffff;
  }

  .edit-profile-helper {
    color: #999999;
  }

  .edit-profile-btn-cancel {
    background: #1a1a1a;
    color: #ffffff;
    border: 1px solid #333333;
  }

  .edit-profile-btn-cancel:hover {
    background: #2a2a2a;
    border-color: #444444;
  }

  /* Save button */
  .edit-profile-btn-save {
    background: #1e40af;
    color: #ffffff;
  }

  .edit-profile-btn-save:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.4);
  }

  /* Back button */
  .back-button {
    color: var(--text-primary);
  }

  .back-button:hover {
    color: var(--accent-blue);
  }

  /* Toggle switches */
  .toggle-switch {
    background: var(--bg-tertiary);
  }

  .toggle-switch.active {
    background: var(--accent-blue);
  }

  /* Dropdown */
  .edit-profile-advanced-content {
    background: var(--card-bg);
    border-color: #333333;
    border-top-color: #333333;
  }

  /* Avatar initials */
  .avatar-initials,
  .profile-avatar-initials {
    background: var(--bg-tertiary);
    color: var(--text-primary);
  }

  /* Modal close button */
  .edit-profile-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
  }

  /* Logout confirmation modal - dark mode */
  .logout-confirm-modal-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .logout-confirm-modal-overlay {
    background: rgba(0, 0, 0, 0.7);
  }

  .logout-confirm-modal-title {
    color: var(--text-primary);
  }

  .logout-confirm-modal-message {
    color: var(--text-tertiary);
  }

  .logout-confirm-btn-cancel {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
  }

  .logout-confirm-btn-cancel:hover {
    background: var(--border-light);
  }

  /* Logout button in edit profile modal - dark mode */
  .edit-profile-logout-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
  }

  .edit-profile-logout-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
  }

  /* Delete account button - dark mode */
  .edit-profile-delete-account-btn {
    background: rgba(220, 38, 38, 0.1);
    color: #ef4444;
    border: 1px solid rgba(220, 38, 38, 0.3);
  }

  .edit-profile-delete-account-btn:hover {
    background: rgba(220, 38, 38, 0.15);
    border-color: rgba(220, 38, 38, 0.4);
    color: #f87171;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
  }

  /* Delete account confirmation modal - dark mode */
  .delete-account-confirm-modal-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .delete-account-confirm-modal-overlay {
    background: rgba(0, 0, 0, 0.7);
  }

  .delete-account-confirm-modal-title {
    color: #ffffff;
  }

  .delete-account-confirm-modal-message {
    color: #999999;
  }

  .delete-account-confirm-btn-cancel {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
  }

  .delete-account-confirm-btn-cancel:hover {
    background: var(--border-light);
  }

  .delete-account-confirm-btn-confirm {
    background: #ef4444;
    color: #ffffff;
  }

  .delete-account-confirm-btn-confirm:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  }

  /* Notification center back button - dark mode */
  .notification-center-back {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
  }

  .notification-center-back:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
  }

  .notification-center-back svg {
    stroke: currentColor !important;
  }

  @media (max-width: 768px) {
    .notification-center-back {
      background: rgba(255, 255, 255, 0.15) !important; /* More visible background on mobile dark mode */
      color: #ffffff !important;
    }

    .notification-center-back:hover {
      background: rgba(255, 255, 255, 0.25) !important; /* Brighter on hover */
      color: #ffffff !important;
    }
  }
}

/* 18+ Age Gate Modal */
.age-gate-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.age-gate-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
}

.age-gate-content {
  position: relative;
  background: var(--card-bg);
  border-radius: 18px;
  padding: 40px 32px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.age-gate-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 16px 0;
}

.age-gate-description {
  font-size: 16px;
  color: var(--text-tertiary);
  line-height: 1.6;
  margin: 0 0 32px 0;
}

.age-gate-checkbox-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.age-gate-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--accent-blue);
}

.age-gate-label {
  font-size: 16px;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.age-gate-button {
  width: 100%;
  padding: 14px 24px;
  background: var(--accent-blue);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.age-gate-button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  opacity: 0.6;
}

.age-gate-button:not(:disabled):hover {
  background: var(--accent-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Legal Pages Styling */
.legal-page-wrapper {
  max-width: 800px;
  margin: 80px auto 40px;
  padding: 0 20px;
}

.legal-page-content {
  background: var(--card-bg);
  padding: 40px;
  border-radius: 12px;
  max-width: 100%;
  margin: 0 auto;
}

.legal-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 20px;
}

.legal-page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 1;
}

.legal-page-header h1 {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}

.legal-page-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.impressum-lang-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 20px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  height: 40px;
}

.impressum-lang-toggle .lang-option {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.impressum-lang-toggle .lang-option.active {
  color: var(--accent-blue);
  font-weight: 700;
}

.impressum-lang-toggle .lang-separator {
  color: var(--text-muted);
  margin: 0 2px;
}

.impressum-lang-toggle:hover {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  transform: scale(1.02);
}

.impressum-lang-toggle:hover .lang-option.active {
  color: var(--accent-blue);
}

[data-theme="dark"] .impressum-lang-toggle {
  background: var(--bg-tertiary);
  border-color: #333333;
  color: var(--text-primary);
}

[data-theme="dark"] .impressum-lang-toggle .lang-option {
  color: var(--text-muted);
}

[data-theme="dark"] .impressum-lang-toggle .lang-option.active {
  color: var(--accent-blue);
}

[data-theme="dark"] .impressum-lang-toggle:hover {
  background: #1a1a1a;
  border-color: #444444;
}

.legal-page-toggle {
  position: static;
  display: flex;
}

.legal-page-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  color: #000;
  text-decoration: none;
  transition: all 0.2s ease;
  border: none;
}

[data-theme="dark"] .legal-page-close {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.legal-page-close:hover {
  background: rgba(0, 0, 0, 0.15);
  transform: scale(1.1);
}

[data-theme="dark"] .legal-page-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.legal-page-close:hover svg {
  transform: rotate(90deg);
  stroke: #000000 !important;
}

[data-theme="dark"] .legal-page-close:hover svg {
  stroke: #ffffff !important;
}

.legal-page-close svg {
  width: 20px;
  height: 20px;
  stroke: #000000 !important;
  transition: transform 0.2s ease;
}

[data-theme="dark"] .legal-page-close svg {
  stroke: #ffffff !important;
}

.legal-page-content h1 {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.legal-page-content h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 32px 0 16px 0;
}

.legal-page-content h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 24px 0 12px 0;
}

.legal-page-content p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  margin: 0 0 16px 0;
}

.legal-page-content ul {
  margin: 0 0 20px 0;
}

.legal-page-content li {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.legal-page-content a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.legal-page-content a:hover {
  opacity: 0.7;
  text-decoration: underline;
}

/* Hide footer on legal pages */
body:has(.legal-page-content) .footer {
  display: none;
}

@media (max-width: 768px) {
  /* Page wrapper mobile optimization */
  .legal-page-wrapper {
    max-width: 100%;
    margin: 60px auto 40px;
    padding: 0 20px;
  }

  .legal-page-content {
    padding: 24px 20px;
    border-radius: 8px;
  }

  .legal-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
  }

  .legal-page-title-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .legal-page-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    flex: 1;
  }

  .legal-page-close {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
  }

  .legal-page-close svg {
    width: 20px;
    height: 20px;
    stroke: #000000 !important;
  }

  [data-theme="dark"] .legal-page-close svg {
    stroke: #ffffff !important;
  }

  .legal-page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
  }

  .legal-page-toggle {
    flex-shrink: 0;
  }

  .legal-page-toggle .dark-mode-btn {
    padding: 8px 12px;
    font-size: 14px;
  }

  .legal-page-toggle .dark-mode-btn i {
    font-size: 14px;
  }

  .legal-page-close svg {
    width: 20px;
    height: 20px;
    stroke: #000000 !important;
  }

  [data-theme="dark"] .legal-page-close svg {
    stroke: #ffffff !important;
  }

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

  .legal-page-content h2 {
    font-size: 20px;
    margin: 28px 0 14px 0;
  }

  .legal-page-content h3 {
    font-size: 18px;
    margin: 20px 0 10px 0;
  }

  .legal-page-content p {
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 14px 0;
  }

  .legal-page-content ul {
    margin: 0 0 16px 0;
    padding-left: 20px;
  }

  .legal-page-content li {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 6px;
  }

  /* Better spacing for mobile */
  .legal-page-content > p:first-of-type {
    margin-bottom: 24px;
  }

  .age-gate-content {
    padding: 32px 24px;
  }

  .age-gate-title {
    font-size: 24px;
  }
}

/* Minimal Footer */
.footer {
  border-top: 1px solid #e5e7eb;
  padding: var(--spacing-lg) 0 calc(var(--spacing-lg) + var(--spacing-base) + env(safe-area-inset-bottom)); /* Extra bottom padding for Safari + safe area */
  background: var(--bg-primary);
  text-align: center;
  margin-top: auto;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  min-height: 60px;
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
}

/* Footer on ratings pages - positioned below rate button, hidden initially */
body:has(.feed-page-wrapper) .footer {
  position: relative;
  margin-top: 60px; /* Space below rate button */
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  z-index: 1; /* Below rate button which is typically z-index 10+ */
}

body:has(.feed-page-wrapper) .footer.show-on-scroll {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Ensure footer doesn't interfere with fixed rate button on mobile */
@media (max-width: 768px) {
  body:has(.feed-page-wrapper) .footer {
    margin-top: 80px; /* Extra space on mobile to clear rate button */
    padding-bottom: calc(var(--spacing-lg) + 20px); /* Extra bottom padding */
  }
}

/* Hide footer on auth page */
body.auth-page .footer {
  display: none !important;
}

body.auth-page .footer-inner {
  gap: 8px;
}

.footer-inner {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 var(--spacing-base);
  color: #6b7280;
  font-size: var(--font-size-body); /* 13-14px for readability */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  position: relative;
}

.footer-brand {
  color: #6b7280;
  font-size: var(--font-size-body);
}

.footer-brand-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-sm);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-xs);
}

/* Mobile footer structure - compact and better looking */
@media (max-width: 768px) {
  .footer {
    padding: var(--spacing-lg) 0 calc(var(--spacing-lg) + var(--spacing-sm));
  }

  .footer-inner {
    padding: 0 var(--spacing-base);
    gap: var(--spacing-base);
    align-items: center;
  }

  .footer-brand-links {
    flex-direction: column;
    gap: var(--spacing-base);
    width: 100%;
    align-items: center;
  }

  .footer-brand {
    font-size: 12px;
    margin: 0;
    order: 2; /* Show copyright at bottom */
    text-align: center;
    width: 100%;
    color: var(--text-muted);
  }

  .footer-links {
    order: 1; /* Show links first */
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-xs) var(--spacing-sm);
  }

  .footer-links span {
    display: inline;
    margin: 0;
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.5;
  }

  .footer-links a {
    padding: 0;
    font-size: 12px;
    line-height: 1.5;
    display: inline-block;
    color: var(--text-tertiary);
    transition: color 0.2s ease;
  }

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

.footer-links a {
  color: #6b7280;
  text-decoration: none;
  padding: var(--spacing-xs) var(--spacing-sm);
  transition: color 0.2s ease;
}

/* Only on auth page */
body.auth-page .footer-links a[href^="mailto:"] {
  margin-bottom: var(--spacing-xs);
}

.footer-links a:hover {
  color: #111827;
  text-decoration: underline;
}

.footer-links span {
  color: #6b7280;
  margin: 0 var(--spacing-sm); /* More spacing around separator dots */
}

/* Footer dark toggle */
.footer-dark-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
}

.footer-dark-toggle .dark-mode-btn {
  padding: 6px 14px;
  font-size: 13px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #6b7280;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.footer-dark-toggle .dark-mode-btn:hover {
  border-color: #d1d5db;
  color: #111827;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Desktop - single line layout with toggle on far right */
@media (min-width: 769px) {
  .footer-inner {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 16px;
    position: relative;
    max-width: 100%;
    width: 100%;
  }

  .footer-brand-links {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    justify-content: center;
  }

  .footer-brand {
    margin: 0;
  }

  .footer-links {
    margin-top: 0;
  }

  .footer-dark-toggle {
    margin-top: 0;
    position: absolute;
    right: 20px;
  }
}

@media (max-width: 768px) {
  /* Base footer styles for mobile */
  .footer {
    padding: 12px 0 40px 0; /* More bottom padding on mobile */
    position: relative;
    z-index: 1;
    min-height: auto;
    margin-top: 0;
    margin-bottom: 0;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
  }

  .footer-inner {
    gap: 8px;
    padding: 0 16px;
  }

  .footer-dark-toggle {
    display: none !important; /* Hidden on mobile, using standalone button */
  }
  
  /* Start page - clean layout */
  body.start-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
  }
  
  body.start-page .landing {
    flex: 1;
    min-height: auto;
    padding-top: 160px;
    padding-bottom: 20px;
  }
  
  body.start-page .footer {
    margin-top: 0;
    padding: 12px 0;
  }
  
  /* Auth page - footer at bottom, no scroll */
  body.auth-page {
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  
  body.auth-page .auth-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }
  
  
  /* Profile page - footer spacing */
  body.profile-page .footer {
    margin-top: 20px;
    padding: 12px 0;
  }
  
  
  /* Hide footer on legal pages */
  body:has(.legal-page-content) .footer {
    display: none !important;
  }
  
  /* Hide dark mode toggle on rate pages and profile page (mobile) */
  body:has(.feed-page-wrapper) .dark-mode-toggle.mobile-only,
  body.profile-page .dark-mode-toggle.mobile-only {
    display: none !important;
  }
  
  /* Always hide mobile dark mode toggle on profile page */
  body.profile-page .dark-mode-toggle.mobile-only {
    display: none !important;
  }

  /* Hide dark mode toggle when notification center is open on mobile */
  body.notification-center-open .dark-mode-toggle.mobile-only {
    display: none !important;
  }
}

/* Hide dark mode toggle on rate pages and profile page (desktop) */
@media (min-width: 769px) {
  body:has(.feed-page-wrapper) .footer-dark-toggle {
    display: none !important;
  }
  
  /* Hide footer dark toggle on profile page only on mobile */
  body.profile-page .footer-dark-toggle {
    display: none !important;
  }
}

/* Show footer dark toggle on profile page on desktop */
@media (min-width: 769px) {
  body.profile-page .footer-dark-toggle {
    display: flex !important;
  }
}

/* Dark mode footer */
[data-theme="dark"] .footer {
  background: var(--bg-primary);
  border-top-color: #333333;
}

[data-theme="dark"] .footer-inner {
  color: #999999;
}

[data-theme="dark"] .footer-brand {
  color: #999999;
}

[data-theme="dark"] .footer-links a {
  color: #999999;
}

[data-theme="dark"] .footer-links a:hover {
  color: #ffffff;
}

[data-theme="dark"] .footer-links span {
  color: #999999;
}

[data-theme="dark"] .footer-dark-toggle .dark-mode-btn {
  background: var(--bg-primary);
  border-color: #333333;
  color: #999999;
}

[data-theme="dark"] .footer-dark-toggle .dark-mode-btn:hover {
  border-color: #555555;
  color: #ffffff;
}

/* Dark mode legal page close button */
[data-theme="dark"] .legal-page-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Dark mode for notification center close button on mobile */
@media (max-width: 768px) {
  [data-theme="dark"] .notification-center-close {
    background: rgba(255, 255, 255, 0.12);
  }

  [data-theme="dark"] .notification-center-close:hover {
    background: rgba(255, 255, 255, 0.2);
  }
}

/* Dark mode for legal pages */
[data-theme="dark"] {
  .age-gate-content {
    background: var(--card-bg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  }

  .age-gate-overlay {
    background: rgba(0, 0, 0, 0.95);
  }

  .legal-page-content {
    background: var(--card-bg);
  }

  .legal-footer {
    background: var(--card-bg);
    border-top-color: var(--border-color);
  }
}

/* Share Link Notification */
.share-link-notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  max-width: 400px;
  width: calc(100% - 40px);
  animation: slideUp 0.3s ease-out;
}

.share-link-notification-content {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid #e5e7eb;
}

.share-link-notification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.share-link-notification-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.share-link-notification-close {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.2s;
}

.share-link-notification-close:hover {
  color: #111827;
  background: #f3f4f6;
}

.share-link-notification-text {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 12px 0;
}

.share-link-notification-link-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: #f3f4f6;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.share-link-notification-link {
  font-size: 13px;
  color: #1d4ed8;
  font-weight: 500;
  word-break: break-all;
  flex: 1;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  line-height: 1.4;
}

.share-link-notification-copy-icon {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.share-link-notification-copy-icon:hover {
  background: #e5e7eb;
  color: #1d4ed8;
}

.share-link-notification-btn {
  width: 100%;
  padding: 10px 16px;
  background: #1d4ed8;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.share-link-notification-btn:hover {
  background: #1e40af;
}

/* Toast Notification */
.toast-notification {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #111827;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  z-index: 10001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toast-notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Share Profile Button */
.btn-share-profile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 0;
  padding: 8px 16px;
  background: var(--accent-blue);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.2);
}

@media (min-width: 769px) {
  .btn-share-profile {
    width: auto;
    min-width: 120px;
  }
}

.btn-share-profile:hover {
  background: var(--accent-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.3);
}

.btn-share-profile:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.2);
}

.btn-share-profile svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
}

/* Dark mode for share notification */
[data-theme="dark"] .share-link-notification-content {
  background: var(--card-bg);
  border-color: #333333;
}

[data-theme="dark"] .share-link-notification-title {
  color: #ffffff;
}

[data-theme="dark"] .share-link-notification-text {
  color: #999999;
}

[data-theme="dark"] .share-link-notification-link-wrapper {
  background: #1a1a1a;
  border-color: #333333;
}

[data-theme="dark"] .share-link-notification-link {
  color: #1e40af;
}

[data-theme="dark"] .share-link-notification-copy-icon {
  color: #999999;
}

[data-theme="dark"] .share-link-notification-copy-icon:hover {
  background: #2a2a2a;
  color: #1e40af;
}

[data-theme="dark"] .share-link-notification-close {
  color: #999999;
}

[data-theme="dark"] .share-link-notification-close:hover {
  color: #ffffff;
  background: #2a2a2a;
}

[data-theme="dark"] .btn-share-profile {
  background: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.3);
}

[data-theme="dark"] .btn-share-profile:hover {
  background: var(--accent-blue-hover);
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.4);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .share-link-notification {
    bottom: 100px;
    max-width: calc(100% - 32px);
  }

  .toast-notification {
    bottom: 120px;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

