/* Permalink Styles */
.permalink-container {
  background-color: var(--bg-color);
  min-height: 100vh;
  padding: 2rem 0;
}

/* Article Header */
.article-header {
  margin-bottom: 3rem;
}

.article-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-color);
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}

.price-section {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.price {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.currency {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-color);
}

.amount {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.negotiable-badge {
  background-color: var(--success-color, #28a745);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
}

.publication-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: right;
}

.publication-info span {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.publication-info i {
  margin-right: 0.5rem;
  opacity: 0.7;
}

/* Main Image Section */
.main-image-section {
  margin-bottom: 3rem;
}

.main-image-container {
  position: relative;
  width: 100%;
  height: 500px;
  border-radius: 12px;
  overflow: hidden;
  background-color: #f8f9fa;
}

.main-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s ease;
}

.main-image.loading {
  opacity: 0;
}

.image-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 4px solid #e9ecef;
  border-top: 4px solid var(--primary-color, #0d6efd);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 10;
}

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

.image-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.main-image-container:hover .image-overlay {
  opacity: 1;
}

.image-overlay i {
  font-size: 24px;
}

/* Thumbnail Gallery */
.thumbnail-gallery {
  margin-top: 1rem;
}

.thumbnails {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.thumbnail-item {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s ease;
}

.thumbnail-item.active {
  border-color: var(--primary-color);
}

.thumbnail-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Content Sections */
.content-section {
  margin-bottom: 3rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.description, .keypoints {
  line-height: 1.8;
  color: var(--text-color);
  font-size: 1.1rem;
}

/* Tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tag {
  background-color: var(--bg-secondary);
  color: var(--text-color);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
}

/* Sidebar */
.sidebar-section {
  margin-bottom: 2.5rem;
}

.sidebar-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

/* Contact Card */
.contact-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.contact-card:hover {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* User Type Specific Cards */
.basic-card {
  background: linear-gradient(135deg, rgba(108, 117, 125, 0.1), rgba(108, 117, 125, 0.05));
  border-color: rgba(108, 117, 125, 0.3);
}

.premium-card {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.05));
  border-color: rgba(255, 215, 0, 0.3);
  box-shadow: 0 8px 32px rgba(255, 215, 0, 0.1);
}

.premium-card::before {
  background: linear-gradient(90deg, #ffd700, #ffed4e);
}

.store-card {
  background: linear-gradient(135deg, rgba(0, 123, 255, 0.1), rgba(0, 123, 255, 0.05));
  border-color: rgba(0, 123, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 123, 255, 0.1);
}

.store-card::before {
  background: linear-gradient(90deg, #007bff, #0056b3);
}

/* Contact Card Header */
.contact-card-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.author-avatar {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 3px solid rgba(255, 255, 255, 0.3);
}

.avatar-ring {
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: linear-gradient(45deg, transparent, transparent);
  animation: rotate 3s linear infinite;
}

.basic-ring {
  border-color: rgba(108, 117, 125, 0.5);
}

.premium-ring {
  border-color: rgba(255, 215, 0, 0.7);
  background: linear-gradient(45deg, rgba(255, 215, 0, 0.3), rgba(255, 215, 0, 0.1));
}

.store-ring {
  border-color: rgba(0, 123, 255, 0.7);
  background: linear-gradient(45deg, rgba(0, 123, 255, 0.3), rgba(0, 123, 255, 0.1));
}

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

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

.author-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 0.5rem 0;
  line-height: 1.2;
}

.author-type {
  margin-bottom: 0.5rem;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.3rem 0.5rem;
  border-radius: 25px;
  font-size: 0.675rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.basic-badge {
  background: linear-gradient(135deg, #6c757d, #495057);
  color: white;
  box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.premium-badge {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #b8860b;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.store-badge {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
}

/* Contact Card Body */
.contact-card-body {
  margin-top: 1.5rem;
}

.contact-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  color: var(--text-color);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.contact-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.contact-btn:hover::before {
  left: 100%;
}

.contact-btn:hover {
  transform: translateX(5px);
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  text-decoration: none;
  color: var(--text-color);
}

.btn-icon {
  width: 45px;
  height: 45px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.phone-btn .btn-icon {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
}

.whatsapp-btn .btn-icon {
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: white;
}

.email-btn .btn-icon {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: white;
}

.website-btn .btn-icon {
  background: linear-gradient(135deg, #6f42c1, #5a32a3);
  color: white;
}

.contact-btn:hover .btn-icon {
  transform: scale(1.1);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

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

.btn-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-value {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-color);
  word-break: break-all;
}

/* Location */
.location {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.location i {
  color: var(--success-color, #28a745);
  font-size: 1.125rem;
}

/* Related Ads */
.related-ads {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.related-ad {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.related-image {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.related-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

.related-title {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  line-height: 1.3;
}

.related-title a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
}

.related-title a:hover {
  color: var(--primary-color);
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .permalink-container {
      padding: 1rem 0;
  }
  
  .article-title {
      font-size: 2rem;
  }
  
  .amount {
      font-size: 2rem;
  }
  
  .main-image-container {
      height: 350px;
  }
  
  .article-meta {
      flex-direction: column;
      align-items: flex-start;
  }
  
  .publication-info {
      text-align: left;
  }
  
  .author-avatar {
      margin: 0 auto;
  }
  
  .contact-card {
      padding: 1.5rem;
  }
  
  .contact-btn {
      padding: 0.875rem 1.25rem;
  }
  
  .btn-icon {
      width: 40px;
      height: 40px;
      font-size: 1.125rem;
  }
  
  .related-image {
      margin: 0 auto;
  }
}

@media (max-width: 576px) {
  .article-title {
      font-size: 1.75rem;
  }
  
  .amount {
      font-size: 1.75rem;
  }
  
  .main-image-container {
      height: 250px;
  }
  
  .thumbnail-item {
      width: 70px;
      height: 70px;
  }
}

/* Gallery Modal Styles */
.gallery-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 24px;
  z-index: 10000;
  text-decoration: none;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.gallery-modal-close:hover {
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
}

.gallery-modal .swiper {
  width: 100%;
  height: 100%;
}

.gallery-modal .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-modal .swiper-zoom-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-modal .swiper-zoom-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.gallery-modal .swiper-button-next,
.gallery-modal .swiper-button-prev {
  color: white;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  margin-top: -25px;
  transition: background-color 0.2s ease;
}

.gallery-modal .swiper-button-next:hover,
.gallery-modal .swiper-button-prev:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.gallery-modal .swiper-pagination {
  color: white;
}

.gallery-modal .swiper-pagination-bullet {
  background-color: white;
  opacity: 0.5;
}

.gallery-modal .swiper-pagination-bullet-active {
  opacity: 1;
}

@media (max-width: 768px) {
  .gallery-modal .swiper-button-next,
  .gallery-modal .swiper-button-prev {
      width: 40px;
      height: 40px;
      margin-top: -20px;
  }
  
  .gallery-modal-close {
      top: 10px;
      right: 10px;
      width: 35px;
      height: 35px;
      font-size: 18px;
  }
  
  .image-overlay {
      width: 50px;
      height: 50px;
  }
  
  .image-overlay i {
      font-size: 20px;
  }
}

@media (max-width: 576px) {
  .gallery-modal .swiper-button-next,
  .gallery-modal .swiper-button-prev {
      width: 35px;
      height: 35px;
      margin-top: -17.5px;
  }
  
  .gallery-modal-close {
      top: 5px;
      right: 5px;
      width: 30px;
      height: 30px;
      font-size: 16px;
  }
}
