:root {
  --primary-color: #5d9cec;
  --text-color: #e8e6e3;
  --text-secondary: #b3b0ad;
  --border-color: #3d3f40;
  --bg-color: #181a1b;
  --bg-secondary: #1e2021;
  --bg-card: #242729;
  --danger-color: #ef5350;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --link-color: #8ab4f8;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.7;
  color: var(--text-color);
  background: var(--bg-color);
  font-size: 18px;
  animation: fadeIn 0.4s ease-in;
}

/* Forza emoji Apple style in tutto il sito */
* {
  font-family: Georgia, 'Times New Roman', serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* App Loader */
#appLoader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #181a1b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.15s ease-out;
}

#appLoader.loaded {
  opacity: 0;
  pointer-events: none;
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #3d3f40;
  border-top: 3px solid #5d9cec;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loader-text {
  margin-top: 15px;
  color: #b3b0ad;
  font-family: Georgia, serif;
  font-size: 14px;
}

#appContent {
  opacity: 0;
  transition: opacity 0.2s ease-in;
}

#appContent.loaded {
  opacity: 1;
}

.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background: rgba(24, 26, 27, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: 30px 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header .header-container {
  position: relative;
}

header h1 {
  font-size: 28px;
  font-weight: 400;
  font-family: Georgia, serif;
}

header h1 a {
  color: var(--text-color);
  text-decoration: none;
}

header nav {
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
}

header nav a {
  color: var(--link-color);
  text-decoration: none;
  font-size: 16px;
  transition: all 0.3s ease;
  position: relative;
}

header nav a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--link-color);
  transition: width 0.3s ease;
}

header nav a:hover::after {
  width: 100%;
}

/* User Profile Button in Header */
.user-profile-btn {
  position: relative;
  cursor: pointer;
}

.user-avatar-header {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: var(--text-secondary);
  overflow: hidden;
}

.user-avatar-header:hover {
  border-color: var(--primary-color);
  transform: scale(1.05);
}

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

.user-avatar-header.logged-in {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(93, 156, 236, 0.2);
}

/* User Dropdown */
.user-dropdown {
  position: absolute;
  top: calc(100% + 15px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  min-width: 280px;
  padding: 16px;
  z-index: 1000;
  animation: dropdownSlide 0.2s ease-out;
}

@keyframes dropdownSlide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-dropdown::before {
  content: '';
  position: absolute;
  top: -8px;
  right: 16px;
  width: 16px;
  height: 16px;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
  transform: rotate(45deg);
}

.dropdown-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.dropdown-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--primary-color);
}

.dropdown-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-color);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.dropdown-email {
  font-size: 13px;
  color: var(--text-secondary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.dropdown-blocked-badge {
  margin-top: 6px;
  padding: 4px 10px;
  background: #dc3545;
  color: white;
  font-size: 12px;
  font-weight: 600;
  border-radius: 12px;
  display: inline-block;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.dropdown-login-prompt {
  text-align: center;
}

#dropdownSettings {
  padding: 12px 0 8px;
  border-top: 1px solid var(--border-color);
  margin-bottom: 8px;
}

.dropdown-setting {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 0;
  font-size: 14px;
  color: var(--text-color);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  user-select: none;
}

.dropdown-setting input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.dropdown-setting:hover {
  color: var(--primary-color);
}

.dropdown-logout-btn {
  width: 100%;
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition: all 0.2s ease;
  margin-top: 8px;
}

.dropdown-logout-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.dropdown-delete-account-btn {
  width: 100%;
  background: none;
  border: 1px solid var(--danger-color);
  color: var(--danger-color);
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition: all 0.2s ease;
  margin-top: 8px;
}

.dropdown-delete-account-btn:hover {
  background: var(--danger-color);
  color: white;
}

.dropdown-menu-btn {
  width: 100%;
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition: all 0.2s ease;
  margin-top: 8px;
  text-align: center;
}

.dropdown-menu-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

#dropdownMainView,
#dropdownPreferencesView {
  animation: slideInFromRight 0.3s ease;
}

#dropdownMainView.slide-out,
#dropdownPreferencesView.slide-out {
  animation: slideOutToRight 0.3s ease;
}

@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutToRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(10px);
  }
}

.dropdown-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-color);
  padding: 8px 0;
  cursor: pointer;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition: color 0.2s ease;
  margin-bottom: 12px;
}

.dropdown-back-btn:hover {
  color: var(--primary-color);
}

.dropdown-preferences-content {
  padding-top: 8px;
}

.dropdown-preferences-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 20px 0;
  text-align: left;
}


header nav a:hover {
  transform: translateY(-2px);
}

/* Main */
main {
  margin: 20px auto 60px;
  min-height: calc(100vh - 200px);
}

#homepage {
  margin-top: 40px;
}

/* Post Cards */
.post-card {
  background: transparent;
  border-radius: 0;
  padding: 0 0 24px;
  margin-bottom: 32px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-bottom: 1px solid var(--border-color);
}

.post-card:hover {
  transform: translateX(8px);
  border-bottom-color: var(--link-color);
}

.post-card img.post-cover {
  position: relative;
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 0;
  margin-bottom: 16px;
  transition: transform 0.5s ease, filter 0.3s ease, opacity 0.3s ease;
  filter: grayscale(30%) brightness(0.85);
  opacity: 0.8;
}

.post-card:hover img.post-cover {
  transform: scale(1.02);
  filter: grayscale(0%) brightness(1);
  opacity: 1;
}

.post-card h2 {
  font-size: 22px;
  margin-bottom: 8px;
  color: var(--text-color);
  font-weight: 400;
  font-family: Georgia, serif;
  transition: color 0.3s ease;
}

.post-card:hover h2 {
  color: var(--link-color);
}

/* Post meta generale (homepage) */
.post-meta {
  display: flex;
  gap: 15px;
  font-size: 15px;
  color: var(--text-secondary);
  flex-wrap: wrap;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Post meta nel post singolo */
#postPage .post-meta {
  margin: 20px 0 30px;
  padding: 16px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  flex-direction: column;
  gap: 10px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-label {
  font-weight: 600;
  color: var(--text-color);
  font-size: 14px;
}

.meta-value {
  color: var(--text-secondary);
  font-size: 14px;
}

.pinned-badge {
  background: #cd2052;
  color: white;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.no-posts, .error {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

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

/* Single Post */
#postPage {
  background: transparent;
  border-radius: 0;
  padding: 20px 0;
  box-shadow: none;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Skeleton Screen */
.skeleton-post {
  animation: fadeIn 0.2s ease-in;
  padding: 20px 0;
}

.skeleton-title {
  height: 36px;
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-secondary) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 20px;
  width: 70%;
}

.skeleton-meta {
  height: 20px;
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-secondary) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 30px;
  width: 50%;
}

.skeleton-line {
  height: 18px;
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-secondary) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 12px;
  width: 100%;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.post-cover-full {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 24px;
}

#postPage h1 {
  font-size: 40px;
  margin-bottom: 24px;
  line-height: 1.3;
  font-weight: 400;
  font-family: Georgia, serif;
}

.post-body {
  margin-top: 32px;
  font-size: 19px;
  line-height: 1.8;
  font-family: Georgia, 'Times New Roman', serif;
}

.post-body h2 {
  font-size: 28px;
  margin: 32px 0 16px;
  font-weight: 400;
}

.post-body h3 {
  font-size: 22px;
  margin: 24px 0 12px;
  font-weight: 400;
}

.post-body h4 {
  font-size: 19px;
  margin: 20px 0 12px;
  font-weight: 600;
}

.post-body p {
  margin-bottom: 16px;
}

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 16px 0;
}

.post-body ul, .post-body ol {
  margin-left: 24px;
  margin-bottom: 16px;
}

.post-body a {
  color: var(--link-color);
  text-decoration: none;
  border-bottom: 1px solid var(--link-color);
  transition: all 0.3s ease;
  position: relative;
}

.post-body a:hover {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  padding-left: 4px;
}

.post-body code {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: Monaco, Consolas, "Courier New", monospace;
  font-size: 0.9em;
  color: #e8e6e3;
}

.post-body .spoiler {
  background-color: #3d3f40;
  color: transparent;
  user-select: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.post-body .spoiler:hover {
  background-color: rgba(93, 156, 236, 0.3);
}

#postActions {
  margin-top: 32px;
  display: flex;
  gap: 10px;
}

/* Reactions */
.post-reactions {
  margin: 40px 0 32px;
  padding: 24px 0;
  border-top: 1px solid var(--border-color);
}

/* User Info & Login */
.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--primary-color);
}

.user-info span {
  flex: 1;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-decoration: underline;
  padding: 0;
}

.btn-link:hover {
  color: var(--link-color);
}

.login-prompt {
  margin-bottom: 16px;
  text-align: center;
}

.btn-google {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: #f8f8f8;
  border: 1px solid #ddd;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-google:hover {
  background: #f8f8f8;
  color: black;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  transform: translateY(-1px);
}

.btn-google:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.reactions-title {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.reactions-container {
  position: relative;
  margin-bottom: 12px;
}

.reaction-picker-btn {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.reaction-picker-btn:hover {
  opacity: 0.9;
}

.reaction-picker {
  position: absolute;
  top: 55px;
  left: 0;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  max-width: 400px;
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.reaction-picker.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.reaction-picker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

@media (max-width: 768px) {
  .reaction-picker-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  
  .reaction-picker {
    max-width: 320px;
  }
}

.reaction-btn {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.reaction-btn:hover {
  transform: scale(1.2);
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(93, 156, 236, 0.3);
}

.reaction-btn:active {
  transform: scale(0.95);
}

.reaction-btn.reacted {
  background: var(--primary-color);
  border-color: var(--primary-color);
  box-shadow: 0 0 20px rgba(93, 156, 236, 0.5);
}

@keyframes reactionPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3) rotate(10deg); }
  100% { transform: scale(1); }
}

.reactions-display {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 30px;
  align-items: center;
}

.reaction-count {
  background: var(--bg-card);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 16px;
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.no-reactions {
  color: var(--text-secondary);
  font-size: 14px;
  font-style: italic;
  font-family: Georgia, serif;
}

/* Comments Section */
.comments-section {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--border-color);
}

.comments-section h3 {
  font-size: 26px;
  margin-bottom: 30px;
  font-weight: 400;
  color: var(--text-color);
  font-family: Georgia, serif;
  letter-spacing: -0.5px;
}

.comments-login-prompt {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-secondary);
  font-style: italic;
  font-size: 16px;
}

.comments-list {
  margin-bottom: 40px;
}

.no-comments {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-style: italic;
  font-size: 15px;
}

.comment {
  position: relative;
  padding: 16px 0 16px 20px;
  margin-bottom: 20px;
  border-left: 2px solid rgba(255, 255, 255, 0.15);
  transition: all 0.2s ease;
  background: transparent;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  user-select: none;
  display: flex;
  gap: 12px;
}

.comment::before {
  content: '';
  position: absolute;
  left: -2px;
  top: 0;
  width: 2px;
  height: 0;
  background: rgba(255, 255, 255, 0.6);
  transition: height 0.3s ease;
}

.comment:hover::before {
  height: 100%;
}

.comment:hover {
  padding-left: 24px;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

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

.comment-author-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comment-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-top: 2px;
}

.comment-avatar:hover {
  border-color: rgba(255, 255, 255, 0.5);
}

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

.comment-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
}

.comment-author {
  font-weight: 600;
  color: var(--text-color);
  font-size: 15px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  display: inline;
  margin-right: 6px;
}

.comment-date {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.comment-text {
  color: var(--text-color);
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 15px;
  display: inline;
}

.mention {
  color: var(--link-color);
  font-weight: 500;
  cursor: text;
}

.comment-delete-btn {
  background: transparent;
  border: none;
  color: rgba(239, 83, 80, 0.7);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.comment-delete-btn:hover {
  color: var(--danger-color);
}

.comment-like-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  transition: all 0.15s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.7;
  flex-shrink: 0;
  align-self: flex-start;
  margin-right: 8px;
}

.comment-like-btn:hover {
  opacity: 1;
}

.comment-like-btn.liked {
  opacity: 1;
  color: #ff6464;
}

.comment-like-btn .like-count {
  font-size: 12px;
  font-weight: 500;
  min-width: 12px;
  text-align: center;
}

@keyframes likeAnimation {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

.comment-like-btn.like-animation {
  animation: likeAnimation 0.3s ease;
}

.comment-reply-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
  transition: all 0.15s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  opacity: 0.7;
}

.comment-reply-btn:hover {
  opacity: 1;
  color: var(--text-color);
}

.reply-form {
  margin-top: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.reply-input {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-color);
  font-size: 15px;
  font-family: Georgia, 'Times New Roman', serif;
  resize: vertical;
  line-height: 1.6;
  transition: all 0.2s ease;
}

.reply-input:focus {
  border-color: rgba(255, 255, 255, 0.3);
  outline: none;
}

.reply-input::placeholder {
  color: var(--text-tertiary);
  opacity: 0.6;
}

.reply-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: flex-end;
}

.reply-form-actions button {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.reply-form-actions button:first-child {
  background: var(--text-color);
  color: var(--bg-color);
}

.reply-form-actions button:first-child:hover {
  opacity: 0.9;
}

.reply-form-actions button:last-child {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.reply-form-actions button:last-child:hover {
  background: var(--bg-secondary);
  color: var(--text-color);
}

.comment-replies {
  margin-top: 16px;
  margin-left: 0;
  padding-left: 24px;
  padding-top: 12px;
  padding-bottom: 8px;
  border-left: 2px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 4px 4px 0;
  display: none;
}

.comment-replies.visible {
  display: block;
}

.toggle-replies-container {
  margin-top: 8px;
}

.toggle-replies-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-align: left;
  font-weight: 500;
}

.toggle-replies-btn:hover {
  color: var(--text-color);
}

.comment-replies .comment {
  margin-bottom: 12px;
  padding: 12px 0 12px 20px;
  border-left: none;
  background: transparent;
  position: relative;
}

.comment-replies .comment::before {
  display: none;
}

.comment-replies .comment:hover {
  padding-left: 24px;
}

.comment-replies .comment:last-child {
  margin-bottom: 0;
}

.comment-replies .comment-avatar {
  width: 28px;
  height: 28px;
}

.comment-replies .comment-text {
  font-size: 15px;
}

.comment-form {
  padding: 0;
  margin-top: 30px;
}

.comment-form textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-color);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
  min-height: 100px;
  margin-bottom: 12px;
  outline: none;
  transition: all 0.2s ease;
}

.comment-form textarea:focus {
  border-color: var(--primary-color);
  background: var(--bg-color);
  box-shadow: 0 0 0 3px rgba(93, 156, 236, 0.1);
}

.comment-form textarea::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}


/* Editor */
#editorPage {
  background: transparent;
  border-radius: 0;
  padding: 20px 0;
  box-shadow: none;
}

#editor input[type="text"] {
  width: 100%;
  padding: 12px 0;
  border: none;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  font-size: 16px;
  margin-bottom: 16px;
  font-family: Georgia, serif;
  background: transparent;
  color: var(--text-color);
  outline: none;
  transition: all 0.3s ease;
}

#editor input[type="text"]:focus {
  border-bottom-color: var(--primary-color);
  transform: translateY(-2px);
}

#editor input#postTitle {
  font-size: 32px;
  font-weight: 400;
}

.editor-options {
  display: flex;
  gap: 20px;
  margin: 16px 0;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.editor-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  user-select: none;
}

.editor-options input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.editor-options label:hover {
  color: var(--text-color);
}

#editorToolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px 0;
  background: transparent;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  flex-wrap: wrap;
}

#editorToolbar button {
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  color: var(--text-color);
}

#editorToolbar button:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(93, 156, 236, 0.3);
}

#editorToolbar button:active {
  transform: translateY(0);
}

#postEditor {
  min-height: 400px;
  padding: 20px 0;
  border: none;
  border-radius: 0;
  font-size: 19px;
  line-height: 1.8;
  outline: none;
  margin-bottom: 24px;
  font-family: Georgia, serif;
  transition: all 0.3s ease;
}

#postEditor:focus {
  transform: translateY(-2px);
}

#postEditor:empty:before {
  content: attr(placeholder);
  color: var(--text-secondary);
}

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

/* Buttons */
button, .btn-primary, .btn-secondary, .btn-danger {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

button::before, .btn-primary::before, .btn-secondary::before, .btn-danger::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

button:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary, #savePostBtn, #loginBtn {
  background: var(--text-color);
  color: var(--bg-color);
}

.btn-primary:hover, #savePostBtn:hover, #loginBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px #f8f8f8;
}

.btn-secondary, #cancelBtn, #closeLoginBtn {
  background: var(--bg-card);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover, #cancelBtn:hover, #closeLoginBtn:hover {
  background: var(--border-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-danger, #deletePostBtn {
  background: var(--danger-color);
  color: white;
}

.btn-danger:hover, #deletePostBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 83, 80, 0.4);
}

/* Login Modal */
#loginModal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
  backdrop-filter: blur(5px);
}

.modal-content {
  background: var(--bg-card);
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  max-width: 400px;
  width: 90%;
  border: 1px solid var(--border-color);
  animation: scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-content h2 {
  margin-bottom: 20px;
}

.modal-content input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 16px;
  margin-bottom: 16px;
  font-family: inherit;
  background: var(--bg-color);
  color: var(--text-color);
  transition: all 0.3s ease;
}

.modal-content input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(93, 156, 236, 0.1);
  transform: translateY(-2px);
}

.modal-content button {
  width: 100%;
  margin-bottom: 10px;
}

/* Footer */
footer {
  background: transparent;
  border-top: 1px solid var(--border-color);
  padding: 30px 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 15px;
  margin-top: 60px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

footer p {
  margin-bottom: 12px;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.footer-links a {
  color: var(--link-color);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.footer-links span {
  color: var(--text-secondary);
  opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }
  
  #postPage {
    padding: 24px 16px;
  }
  
  #postPage h1 {
    font-size: 28px;
  }
  
  .post-body {
    font-size: 16px;
  }
  
  #editorPage {
    padding: 24px 16px;
  }
  
  /* Header mobile-friendly */
  header {
    padding: 15px 0;
  }
  
  header h1 {
    font-size: 22px;
  }
  
  header nav {
    gap: 12px;
  }
  
  header nav a {
    font-size: 14px;
  }
  
  .user-avatar-header {
    width: 36px;
    height: 36px;
  }
  
  /* Dropdown mobile */
  .dropdown-menu {
    right: -10px;
    left: auto;
    min-width: 200px;
  }
  
  /* Post cards mobile */
  .post-card {
    padding: 0 0 12px;
    margin-bottom: 32px;
  }
  
  .post-card h2 {
    font-size: 19px;
    margin-bottom: 8px;
  }
  
  .post-card img.post-cover {
    height: 160px;
    margin-bottom: 10px;
  }
  
  .post-card .post-meta {
    font-size: 14px;
    gap: 12px;
  }
  
  .pinned-badge {
    display: none;
  }
  
  /* Reactions mobile */
  .reaction-picker {
    right: 0;
    left: auto;
    max-width: calc(100vw - 30px);
  }
  
  .reaction-picker-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  
  .reaction-btn {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }
  
  /* Comments mobile */
  .comment {
    padding: 12px;
  }
  
  .comment-avatar {
    width: 32px;
    height: 32px;
  }
  
  .comment-text {
    font-size: 14px;
  }
  
  .comment-replies {
    margin-left: 0;
    padding-left: 16px;
    padding-top: 8px;
  }
  
  .comment-replies {
    padding-left: 12px;
  }
  
  .comment-replies .comment {
    padding: 8px 0 8px 12px;
  }
  
  .comment-replies .comment:last-child {
    padding-bottom: 8px;
  }
  
  .comment-replies .comment-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding-right: 0;
  }
  
  .comment-replies .comment-avatar {
    width: 24px;
    height: 24px;
  }
  
  .comment-replies .comment-author {
    font-size: 13px;
  }
  
  .comment-replies .comment-date {
    font-size: 11px;
    margin-left: 0;
  }
  
  .comment-replies .replying-to {
    font-size: 10px;
  }
  
  .reply-form {
    padding: 12px;
  }
  
  .reply-input {
    font-size: 14px;
    min-height: 70px;
  }
  
  .reply-form-actions button {
    font-size: 13px;
    padding: 6px 12px;
  }
  
  #commentText {
    min-height: 80px;
  }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
  header h1 {
    font-size: 18px;
  }
  
  header nav {
    gap: 8px;
  }
  
  header nav a {
    font-size: 13px;
  }
  
  .user-avatar-header {
    width: 32px;
    height: 32px;
  }
  
  .reaction-picker-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .post-card h2 {
    font-size: 18px;
  }
}

/* ========================================
   BROADCAST SYSTEM
   ======================================== */

.broadcast-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.25s ease;
  padding: 20px;
}

.broadcast-overlay.active {
  opacity: 1;
}

.broadcast-modal {
  background: var(--bg-card);
  border-radius: 8px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  opacity: 0;
  transform: translateY(8px);
  animation: broadcastSlideIn 0.3s ease forwards;
}

@keyframes broadcastSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.broadcast-header {
  padding: 24px 24px 16px 24px;
}

.broadcast-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-color);
  margin: 0;
  line-height: 1.4;
}

.broadcast-body {
  padding: 0 24px 24px 24px;
}

.broadcast-message {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.broadcast-footer {
  padding: 16px 24px 24px 24px;
  display: flex;
  justify-content: flex-end;
}

.broadcast-dismiss {
  background: var(--text-color);
  color: var(--bg-color);
  border: none;
  padding: 8px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.broadcast-dismiss:hover {
  opacity: 0.9;
}

.broadcast-dismiss:active {
  opacity: 0.8;
}

/* Tipi di broadcast - minimal accent */
.broadcast-info .broadcast-title::before {
  content: "ℹ️ ";
  margin-right: 6px;
}

.broadcast-success .broadcast-title::before {
  content: "✓ ";
  margin-right: 6px;
  color: #4caf50;
}

.broadcast-warning .broadcast-title::before {
  content: "⚠ ";
  margin-right: 6px;
  color: #ff9800;
}

.broadcast-announcement .broadcast-title::before {
  content: "📢 ";
  margin-right: 6px;
}

/* Responsive */
@media (max-width: 600px) {
  .broadcast-modal {
    max-width: 100%;
    margin: 0 10px;
  }
  
  .broadcast-header {
    padding: 20px;
  }
  
  .broadcast-title {
    font-size: 17px;
  }
  
  .broadcast-body {
    padding: 0 20px 20px 20px;
  }
  
  .broadcast-message {
    font-size: 15px;
  }
  
  .broadcast-footer {
    padding: 16px 20px 20px 20px;
  }
}

/* ========================================
   COOKIE CONSENT BANNER
   ======================================== */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.cookie-banner.active {
  transform: translateY(0);
}

.cookie-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.cookie-banner-text {
  flex: 1;
  max-width: 800px;
}

.cookie-banner-text p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.cookie-banner-text .cookie-privacy-link {
  font-size: 13px;
  color: var(--link-color);
  text-decoration: underline;
  display: inline-block;
  margin-top: 8px;
}

.cookie-text-expandable {
  position: relative;
}

.cookie-text-expandable.expanded {
  max-height: none;
}

.cookie-expand-btn {
  background: none;
  border: none;
  color: var(--link-color);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 0;
  margin-top: 4px;
  text-decoration: underline;
  display: none;
}

.cookie-banner-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.cookie-btn-accept {
  background: var(--text-color);
  color: var(--bg-color);
}

.cookie-btn-decline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.cookie-btn:hover {
  opacity: 0.9;
}

.cookie-btn:active {
  opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
  .cookie-banner-content {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 16px;
  }
  
  .cookie-banner-text h3 {
    font-size: 15px !important;
  }
  
  .cookie-banner-text p {
    text-align: left;
    font-size: 13px;
  }
  
  .cookie-text-expandable {
    max-height: 60px;
    overflow: hidden;
  }
  
  .cookie-banner-text .cookie-privacy-link {
    display: none;
    text-align: center;
    padding-left: 0;
    margin-top: 12px;
  }
  
  .cookie-text-expandable.expanded .cookie-privacy-link {
    display: block;
  }
  
  .cookie-expand-btn {
    display: block;
    text-align: left;
    padding-left: 0;
    margin-left: 0;
  }
  
  .cookie-banner-actions {
    width: 100%;
  }
  
  .cookie-btn {
    flex: 1;
  }
}
