/* ============================================
   COMPARISON PAGE STYLES - UPDATED
   ============================================ */

:root {
  --primary-gradient: linear-gradient(135deg, var(--fp-teal) 0%, var(--fp-green) 100%);
  --secondary-gradient: linear-gradient(135deg, var(--fp-green) 0%, var(--fp-teal) 100%);
  --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  --hover-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

/* ============================================
   HEADER SECTION
   ============================================ */

.comparison-header {
  background: var(--primary-gradient);
  padding: 20px 30px;
  border-radius: 16px;
  margin-bottom: 30px;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
}

.comparison-header::before,
.comparison-header::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  animation: float 6s ease-in-out infinite;
}

.comparison-header::before {
  top: -50%;
  right: -5%;
  width: 300px;
  height: 300px;
}

.comparison-header::after {
  bottom: -30%;
  left: -5%;
  width: 200px;
  height: 200px;
  animation: float 8s ease-in-out infinite reverse;
}

.header-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.header-content h1 {
  color: white;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.header-content h1 i {
  font-size: 2.2rem;
}

.header-content p {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.1rem;
}

/* ============================================
   COMPARISON CONTAINER
   ============================================ */

.comparison-container {
  min-height: 400px;
}

/* ============================================
   SECTION HEADERS
   ============================================ */

.section-header {
  margin-bottom: 30px;
  padding: 20px;
  background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
  border-radius: 16px;
  border-left: 5px solid var(--fp-teal);
}

.section-header.latest-section {
  margin-top: 50px;
  background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
  border-left-color: var(--fp-green);
}

.section-header h2 {
  color: var(--text-dark);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-header h2 i {
  color: var(--fp-teal);
  font-size: 1.6rem;
}

.section-header.latest-section h2 i {
  color: var(--fp-green);
}

.section-header p {
  color: #666;
  font-size: 1rem;
  margin: 0;
  padding-left: 38px;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-comparison {
  text-align: center;
  padding: 80px 20px;
  background: white;
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  animation: fadeInUp 0.6s ease;
}

.empty-icon {
  font-size: 4rem;
  color: #e0e0e0;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.empty-icon i {
  animation: pulse 2s ease-in-out infinite;
}

.empty-icon i:nth-child(2) {
  color: var(--fp-teal);
  animation-delay: 0.3s;
}

.empty-comparison h2 {
  font-size: 2rem;
  color: #333;
  margin-bottom: 15px;
  font-weight: 700;
}

.empty-comparison p {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 35px;
}

.btn-browse {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--primary-gradient);
  color: white;
  padding: 16px 40px;
  border-radius: 30px;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(16, 119, 122, 0.3);
  transition: all 0.3s ease;
}

.btn-browse:hover {
  background: var(--secondary-gradient);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(16, 119, 122, 0.4);
}

/* ============================================
   COMPARISON GRID (POPULAR SECTION)
   ============================================ */

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  margin-bottom: 40px;
}

.comparison-card {
  background: white;
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: all 0.4s ease;
  animation: fadeInUp 0.6s ease;
}

.comparison-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--hover-shadow);
}

.card-header {
  background: var(--primary-gradient);
  padding: 10px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 {
  color: white;
  font-size: 1.3rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.views-counter {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.views-counter i {
    font-size: 1rem;
}

.views-counter span {
    font-weight: 600;
}

.phones-comparison {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  padding: 15px 0px;
  align-items: center;
}

.phone-column {
  text-align: center;
}

.phone-image-container {
  position: relative;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: 16px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  min-height: 180px;
  padding: 10px;
}

.comparison-card:hover .phone-image-container {
  background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
}

.phone-image {
  max-width: 100%;
  max-height: 160px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.comparison-card:hover .phone-image {
  transform: scale(1.05);
}

.phone-info {
  padding: 0 5px;
  min-width: 0;
  overflow: hidden;
}

.phone-brand {
  color: var(--fp-teal);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 8px;
}

.phone-name {
  color: var(--text-dark);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 12px 0;
  line-height: 1.3;
  min-height: 42px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.phone-price {
  color: var(--fp-red);
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
}

.phone-price sup {
  font-size: 0.9rem;
  margin-right: 4px;
}

.vs-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0;
}

.vs-badge {
  width: 55px;
  height: 55px;
  background: var(--primary-gradient);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.vs-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #e0e0e0, transparent);
  z-index: 1;
}

.card-actions {
  padding: 20px;
  background: white;
  border-top: 2px solid #e8e8e8;
}

.btn-view-full {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--primary-gradient);
  color: white;
  padding: 14px 30px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(16, 119, 122, 0.3);
  transition: all 0.3s ease;
}

.btn-view-full:hover {
  background: var(--secondary-gradient);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 119, 122, 0.4);
}

/* ============================================
   PAGINATION STYLES
   ============================================ */

/* Custom Pagination Wrapper */
.custom-pagination {
    margin-top: 30px;
    padding: 20px;
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Pagination Links Container */
.pagination-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Previous/Next Buttons */
.pagination-btn {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--fp-green);
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.pagination-btn:hover {
    background: #f8f9fa;
    border-color: var(--fp-green);
}

.pagination-btn.disabled {
    color: #999;
    background: #f5f5f5;
    cursor: not-allowed;
}

/* Page Numbers Container */
.pagination-numbers {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Individual Page Number */
.page-num {
    display: flex;
    align-items: center;
    justify-content: center;
    /* min-width: 40px; */
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--fp-green);
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.page-num:hover {
    background: #f8f9fa;
    border-color: var(--fp-green);
    color: var(--fp-green);
}

/* Active Page Number */
.page-num.active {
    border-color: var(--fp-green);
    color: var(--fp-green);
    font-weight: 600;
    background: #dff5e1;
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

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

@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(0.95);
  }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Above 1024px - Show 2 columns */
@media (min-width: 1025px) {
  .comparison-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Large Tablets (1024px and below) */
@media (max-width: 1024px) {
  .comparison-grid {
    gap: 25px;
  }
}

/* Tablets (768px and below) */
@media (max-width: 768px) {
  .comparison-header {
    padding: 25px 20px;
    border-radius: 12px;
  }

  .header-content h1 {
    font-size: 2rem;
    flex-direction: column;
    gap: 10px;
  }

  .header-content h1 i {
    font-size: 1.8rem;
  }

  .header-content p {
    font-size: 1rem;
  }

  .section-header {
    padding: 15px;
    margin-bottom: 25px;
  }

  .section-header h2 {
    font-size: 1.5rem;
    gap: 10px;
  }

  .section-header h2 i {
    font-size: 1.3rem;
  }

  .section-header p {
    font-size: 0.9rem;
    padding-left: 33px;
  }

  .section-header.latest-section {
    margin-top: 40px;
  }

  .comparison-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .phones-comparison {
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    padding: 20px 8px;
  }

  .vs-divider::before {
    display: none;
  }

  .phone-image-container {
    min-height: 130px;
    padding: 8px;
  }

  .phone-image {
    max-height: 110px;
  }

  .phone-info {
    padding: 0 3px;
  }

  .phone-brand {
    font-size: 0.75rem;
  }

  .phone-name {
    font-size: 0.9rem;
    min-height: 38px;
  }

  .phone-price {
    font-size: 1.1rem;
  }

  .vs-badge {
    width: 45px;
    height: 45px;
    font-size: 1rem;
  }

  /* Pagination Responsive - Tablet */
  .custom-pagination {
      padding: 15px 10px;
      margin-top: 25px;
  }

  .pagination-links {
      gap: 8px;
  }

  .pagination-btn {
      padding: 8px 14px;
      font-size: 13px;
  }

  .page-num {
      /* min-width: 36px; */
      height: 36px;
      padding: 0 10px;
      font-size: 13px;
  }

  .pagination-numbers {
      gap: 6px;
  }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
  .comparison-header {
    padding: 20px 10px;
    margin-bottom: 20px;
  }

  .header-content h1 {
    font-size: 1.4rem;
    gap: 8px;
  }

  .header-content h1 i {
    font-size: 1.4rem;
  }

  .header-content p {
    font-size: 0.9rem;
  }

  .section-header {
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 12px;
  }

  .section-header h2 {
    font-size: 1.2rem;
    gap: 8px;
  }

  .section-header h2 i {
    font-size: 1.1rem;
  }

  .section-header p {
    font-size: 0.85rem;
    padding-left: 28px;
  }

  .section-header.latest-section {
    margin-top: 30px;
  }

  .empty-comparison {
    padding: 60px 15px;
  }

  .empty-icon {
    font-size: 3rem;
    gap: 15px;
  }

  .empty-comparison h2 {
    font-size: 1.6rem;
  }

  .empty-comparison p {
    font-size: 1rem;
  }

  .btn-browse {
    padding: 14px 30px;
    font-size: 1rem;
  }

  .comparison-grid {
    gap: 15px;
  }

  .comparison-card {
    border-radius: 12px;
  }

  .card-header {
    padding: 10px 12px;
  }

  .card-header h3 {
    font-size: 1rem;
    gap: 6px;
  }

  .phones-comparison {
    grid-template-columns: 1fr auto 1fr;
    gap: 5px;
    padding: 12px 5px;
  }

  .phone-image-container {
    min-height: 100px;
    padding: 5px;
    border-radius: 12px;
  }

  .phone-image {
    max-height: 85px;
  }

  .phone-info {
    padding: 0 2px;
  }

  .phone-brand {
    font-size: 0.65rem;
    margin-bottom: 5px;
  }

  .phone-name {
    font-size: 0.75rem;
    min-height: 32px;
    margin-bottom: 8px;
    line-height: 1.2;
  }

  .phone-price {
    font-size: 0.9rem;
  }

  .phone-price sup {
    font-size: 0.65rem;
    margin-right: 2px;
  }

  .vs-badge {
    width: 38px;
    height: 38px;
    font-size: 0.85rem;
  }

  .card-actions {
    padding: 12px;
  }

  .btn-view-full {
    padding: 10px 16px;
    font-size: 0.85rem;
    border-radius: 10px;
  }
}

/* Mobile Responsive (576px and below) - Pagination */
@media (max-width: 576px) {
    .custom-pagination {
        padding: 15px 5px;
        margin-top: 20px;
    }

    .pagination-links {
        gap: 6px;
        width: 100%;
    }

    .pagination-btn {
        padding: 7px 12px;
        font-size: 12px;
        flex: 0 0 auto;
    }

    .page-num {
        /* min-width: 32px; */
        height: 32px;
        padding: 0 8px;
        font-size: 12px;
    }

    .pagination-numbers {
        gap: 5px;
        flex: 1;
        max-width: calc(100% - 180px);
        overflow-x: auto;
        scrollbar-width: thin;
    }

    /* Hide scrollbar but keep functionality */
    .pagination-numbers::-webkit-scrollbar {
        height: 4px;
    }

    .pagination-numbers::-webkit-scrollbar-thumb {
        background: #ddd;
        border-radius: 2px;
    }
}

/* Extra Small Mobile (400px and below) */
@media (max-width: 400px) {
  .comparison-header {
    padding: 15px 8px;
  }

  .header-content h1 {
    font-size: 1.2rem;
  }

  .header-content h1 i {
    font-size: 1.2rem;
  }

  .header-content p {
    font-size: 0.85rem;
  }

  .section-header {
    padding: 10px;
  }

  .section-header h2 {
    font-size: 1.1rem;
  }

  .section-header p {
    font-size: 0.8rem;
    padding-left: 25px;
  }

  .empty-icon {
    font-size: 2.5rem;
  }

  .empty-comparison h2 {
    font-size: 1.4rem;
  }

  .card-header {
    padding: 8px 10px;
  }

  .card-header h3 {
    font-size: 0.9rem;
    gap: 5px;
  }

  .phones-comparison {
    gap: 4px;
    padding: 10px 4px;
  }

  .phone-image-container {
    min-height: 90px;
    padding: 4px;
    border-radius: 10px;
  }

  .phone-image {
    max-height: 75px;
  }

  .phone-info {
    padding: 0 1px;
  }

  .phone-brand {
    font-size: 0.6rem;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
  }

  .phone-name {
    font-size: 0.7rem;
    min-height: 28px;
    margin-bottom: 6px;
    line-height: 1.1;
  }

  .phone-price {
    font-size: 0.8rem;
  }

  .phone-price sup {
    font-size: 0.6rem;
    margin-right: 1px;
  }

  .vs-badge {
    width: 34px;
    height: 34px;
    font-size: 0.75rem;
  }

  .card-actions {
    padding: 10px;
  }

  .btn-view-full {
    padding: 8px 12px;
    font-size: 0.8rem;
    gap: 6px;
    border-radius: 8px;
  }

  .btn-view-full i {
    font-size: 0.75rem;
  }

  /* Pagination Extra Small Mobile */
  .custom-pagination {
      padding: 10px 5px;
  }

  .pagination-links {
      gap: 5px;
  }

  .pagination-btn {
      padding: 6px 10px;
      font-size: 11px;
  }

  .page-num {
      /* min-width: 30px; */
      height: 30px;
      padding: 0 6px;
      font-size: 11px;
  }

  .pagination-numbers {
      gap: 4px;
  }

  /* Show only 3 page numbers on very small screens */
  .pagination-numbers .page-num:not(.active):nth-child(n+4):nth-last-child(n+4) {
      display: none;
  }
}

/* Extra Small Mobile (360px and below) */
@media (max-width: 360px) {
  .comparison-header {
    padding: 15px 8px;
  }

  .header-content h1 {
    font-size: 1.2rem;
  }

  .header-content h1 i {
    font-size: 1.2rem;
  }

  .header-content p {
    font-size: 0.85rem;
  }

  .section-header {
    padding: 10px;
  }

  .section-header h2 {
    font-size: 1.1rem;
  }

  .section-header p {
    font-size: 0.8rem;
    padding-left: 25px;
  }

  .empty-icon {
    font-size: 2.5rem;
  }

  .empty-comparison h2 {
    font-size: 1.4rem;
  }

  .card-header {
    padding: 8px 10px;
  }

  .card-header h3 {
    font-size: 0.9rem;
    gap: 5px;
  }

  .phones-comparison {
    gap: 4px;
    padding: 10px 4px;
  }

  .phone-image-container {
    min-height: 90px;
    padding: 4px;
    border-radius: 10px;
  }

  .phone-image {
    max-height: 75px;
  }

  .phone-info {
    padding: 0 1px;
  }

  .phone-brand {
    font-size: 0.6rem;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
  }

  .phone-name {
    font-size: 0.7rem;
    min-height: 28px;
    margin-bottom: 6px;
    line-height: 1.1;
  }

  .phone-price {
    font-size: 0.8rem;
  }

  .phone-price sup {
    font-size: 0.6rem;
    margin-right: 1px;
  }

  .vs-badge {
    width: 34px;
    height: 34px;
    font-size: 0.75rem;
  }

  .card-actions {
    padding: 10px;
  }

  .btn-view-full {
    padding: 8px 12px;
    font-size: 0.8rem;
    gap: 6px;
    border-radius: 8px;
  }

  .btn-view-full i {
    font-size: 0.75rem;
  }
}

/* Landscape Mobile - Pagination */
@media (max-width: 768px) and (orientation: landscape) {
    .custom-pagination {
        padding: 10px;
    }

    .pagination-btn,
    .page-num {
        /* height: 34px; */
    }
}

/* Ensure pagination stays centered on all screen sizes */
@media (max-width: 320px) {
    .pagination-links {
        flex-direction: column;
        width: 100%;
    }

    .pagination-numbers {
        max-width: 100%;
        order: 2;
        margin: 10px 0;
    }

    .pagination-btn:first-child {
        order: 1;
    }

    .pagination-btn:last-child {
        order: 3;
    }
}