/* ============================================
   COMPONENTS - Notifiche, Back to Top, etc
============================================ */

/* Notifiche */
.spazio-notification {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--color-bg-card);
  backdrop-filter: blur(20px);
  color: var(--color-text-primary);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 9999;
  min-width: 300px;
  max-width: 500px;
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition-base);
  cursor: pointer;
}

.spazio-notification.show {
  opacity: 1;
  transform: translateY(0);
}

.spazio-notification-success {
  border-left: 4px solid #10b981;
}

.spazio-notification-error {
  border-left: 4px solid #ef4444;
}

.spazio-notification-info {
  border-left: 4px solid var(--color-accent-yellow);
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--gradient-primary);
  border: none;
  border-radius: 50%;
  color: #000;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-base);
  z-index: 998;
  box-shadow: var(--shadow-glow);
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(253, 185, 39, 0.5);
}

/* Search Form */
.search-form {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.search-form-group {
  display: flex;
  gap: var(--spacing-sm);
}

.search-field {
  flex: 1;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  color: var(--color-text-primary);
  font-size: 1rem;
  transition: all var(--transition-base);
}

.search-field:focus {
  outline: none;
  border-color: var(--color-accent-yellow);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 20px rgba(253, 185, 39, 0.2);
}

.search-submit {
  white-space: nowrap;
}

/* Post Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: var(--spacing-xl);
  margin: var(--spacing-2xl) 0;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: var(--spacing-sm);
  margin: var(--spacing-2xl) 0;
}

.page-numbers {
  padding: 0.75rem 1.25rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  transition: all var(--transition-base);
  font-weight: 600;
}

.page-numbers:hover,
.page-numbers.current {
  background: var(--gradient-primary);
  color: #000;
  border-color: transparent;
}

/* Error 404 Page */
.error-404 {
  padding: var(--spacing-3xl) 0;
  text-align: center;
}

.error-content {
  max-width: 700px;
  margin: 0 auto;
}

.error-icon {
  margin-bottom: var(--spacing-xl);
}

.error-title {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: var(--spacing-md);
}

.error-description {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-xl);
  line-height: 1.8;
}

.error-actions {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  margin-bottom: var(--spacing-2xl);
  flex-wrap: wrap;
}

.error-search h3 {
  margin-bottom: var(--spacing-md);
}

/* Single Post/Page */
.single-post,
.single-page {
  padding: var(--spacing-3xl) 0;
}

.post-content,
.page-content {
  max-width: 800px;
  margin: 0 auto;
}

.post-header,
.page-header {
  text-align: center;
  margin-bottom: var(--spacing-2xl);
}

.post-categories {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
  margin-bottom: var(--spacing-md);
  flex-wrap: wrap;
}

.post-category {
  padding: 0.5rem 1rem;
  background: var(--gradient-primary);
  color: #000;
  border-radius: var(--radius-xl);
  font-weight: 600;
  font-size: 0.875rem;
  transition: transform var(--transition-base);
}

.post-category:hover {
  transform: scale(1.05);
}

.post-title,
.page-title {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: var(--spacing-md);
  line-height: 1.2;
}

.post-meta {
  display: flex;
  gap: var(--spacing-lg);
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  flex-wrap: wrap;
}

.post-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-thumbnail,
.page-thumbnail {
  margin-bottom: var(--spacing-2xl);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.post-thumbnail img,
.page-thumbnail img {
  width: 100%;
  height: auto;
  display: block;
}

.post-content-wrapper,
.page-content-wrapper {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--color-text-secondary);
}

.post-content-wrapper h2,
.post-content-wrapper h3,
.page-content-wrapper h2,
.page-content-wrapper h3 {
  color: var(--color-text-primary);
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
}

.post-content-wrapper a,
.page-content-wrapper a {
  color: var(--color-accent-yellow);
  text-decoration: underline;
  transition: color var(--transition-base);
}

.post-content-wrapper a:hover,
.page-content-wrapper a:hover {
  color: var(--color-accent-orange);
}

.post-footer {
  margin-top: var(--spacing-2xl);
  padding-top: var(--spacing-xl);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.post-tags {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
  flex-wrap: wrap;
}

.tag {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  font-size: 0.875rem;
  transition: all var(--transition-base);
}

.tag:hover {
  background: var(--gradient-primary);
  color: #000;
  border-color: transparent;
}

/* Post Navigation */
.post-navigation {
  margin-top: var(--spacing-3xl);
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.nav-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xl);
}

.nav-previous,
.nav-next {
  min-width: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  background: var(--color-bg-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.nav-link:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 255, 255, 0.1);
}

.nav-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.nav-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-title {
  font-weight: 600;
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-next .nav-link {
  flex-direction: row-reverse;
  text-align: right;
}

/* Responsive */
@media (max-width: 768px) {
  .spazio-notification,
  .back-to-top {
    bottom: 20px;
    right: 20px;
  }
  
  .spazio-notification {
    min-width: auto;
    max-width: calc(100vw - 40px);
  }
  
  .posts-grid {
    grid-template-columns: 1fr;
  }
  
  .nav-links {
    grid-template-columns: 1fr;
  }
  
  .search-form-group {
    flex-direction: column;
  }
}