/* ===== Footer Custom Styles - ใช้ CSS Variables และ Scoped Selectors ===== */

/* CSS Variables สำหรับ Footer */
:root {
  --footer-social-size: 45px;
  --footer-social-font: 18px;
  --footer-social-icon: 20px;
  --footer-social-hover-transform: translateY(-3px);
  --footer-social-hover-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

/* ===== Footer Action Buttons ===== */
.footer-action-buttons .btn {
  font-size: 16px;
  padding: 8px 24px;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.3s ease;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-action-buttons .btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.footer-action-buttons .btn i {
  font-size: 18px;
  margin-right: 8px;
}

/* ===== Social Media Icons - Scoped to Footer ===== */
.site-footer .site-button.youtube {
  background: linear-gradient(45deg, #FF0000, #CC0000);
}

.site-footer .site-button.tiktok {
  background: linear-gradient(45deg, #000000, #25F4EE);
}

.site-footer .site-button.line {
  background: linear-gradient(45deg, #00B900, #00C300);
}

.site-footer .site-button.telegram {
  background: linear-gradient(45deg, #0088CC, #229ED9);
}

.site-footer .site-button.github {
  background: linear-gradient(45deg, #333333, #666666);
}

.site-footer .site-button.shopee {
  background: linear-gradient(45deg, #EE4D2D, #FF6B35);
}

.site-footer .site-button.lazada {
  background: linear-gradient(45deg, #4C1D95, #7C3AED);
}

/* ===== Footer Social Button Sizes ===== */
.site-footer .site-button {
  width: var(--footer-social-size);
  height: var(--footer-social-size);
  font-size: var(--footer-social-font);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.site-footer .site-button:hover {
  transform: var(--footer-social-hover-transform);
  box-shadow: var(--footer-social-hover-shadow);
}

.site-footer .site-button i {
  font-size: var(--footer-social-icon);
}

/* ===== Contact Info Icons ===== */
.footer-icon-location {
  background: linear-gradient(45deg, #4CAF50, #66BB6A);
  color: white;
  padding: 8px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
  transition: all 0.3s ease;
}

.footer-icon-location:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.footer-icon-email {
  background: linear-gradient(45deg, #2196F3, #42A5F5);
  color: white;
  padding: 8px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
  transition: all 0.3s ease;
}

.footer-icon-email:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

.footer-icon-phone {
  background: linear-gradient(45deg, #388E3C, #4CAF50);
  color: white;
  padding: 8px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 4px 15px rgba(56, 142, 60, 0.3);
  transition: all 0.3s ease;
}

.footer-icon-phone:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 142, 60, 0.4);
}

.footer-icon-clock {
  background: linear-gradient(45deg, #FF9800, #FFB74D);
  color: white;
  padding: 8px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
  transition: all 0.3s ease;
}

.footer-icon-clock:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4);
}

/* Icon animations */
.footer-icon-location i,
.footer-icon-email i,
.footer-icon-phone i,
.footer-icon-clock i {
  font-size: 14px;
  transition: all 0.3s ease;
}

.footer-icon-location:hover i,
.footer-icon-email:hover i,
.footer-icon-phone:hover i,
.footer-icon-clock:hover i {
  transform: scale(1.1);
}

/* ===== QR Code Styles ===== */
.qr-code-section {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  width: 50%;
  padding-top: 20px;
}

.qr-codes-container {
  flex-wrap: wrap;
}

.qr-code-item {
  min-width: 80px;
}

.qr-code-wrapper {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px;
  display: inline-block;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.qr-code-wrapper:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.qr-code-image {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.qr-code-image:hover {
  transform: scale(1.05);
}

.qr-modal-image {
  max-width: 300px;
  max-height: 300px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* ===== Footer Action Buttons ===== */
.footer-action-buttons {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
}

.footer-action-btn {
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  transition: all 0.3s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Footer button variants */
.footer-action-btn.btn-outline-light {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.footer-action-btn.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.footer-action-btn.btn-primary {
  background: #605DFF;
  border-color: #605DFF;
  color: #fff;
}

.footer-action-btn.btn-primary:hover {
  background: #4a47d1;
  border-color: #4a47d1;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(96, 93, 255, 0.3);
}

.footer-action-btn.btn-success {
  background: #00d27a;
  border-color: #00d27a;
  color: #fff;
}

.footer-action-btn.btn-success:hover {
  background: #00b366;
  border-color: #00b366;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 210, 122, 0.3);
}

.footer-action-btn.btn-warning {
  background: #ffb800;
  border-color: #ffb800;
  color: #fff;
}

.footer-action-btn.btn-warning:hover {
  background: #e6a600;
  border-color: #e6a600;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 184, 0, 0.3);
}

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

.footer-action-btn i {
  font-size: 14px;
  transition: all 0.3s ease;
}

.footer-action-btn:hover i {
  transform: scale(1.1);
}

/* ===== Footer Statistics ===== */
.footer-statistics {
  margin-top: 20px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.footer-statistics h5 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #fff;
  text-align: left;
  margin-top: 0;
  padding-top: 18px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 7px;
  position: relative;
}

.footer-statistics h5::before {
  content: '';
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 1px;
  background: #3a3a3a;
  border-radius: 1px;
}

.footer-statistics h5 i {
  font-size: 15px;
  margin-right: 4px;
  color: #b6b6b6;
}

.statistics-grid {
  display: flex;
  flex-direction: row;
  gap: 8px;
  justify-content: space-between;
  align-items: stretch;
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  text-align: left;
  padding: 6px 8px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  flex: 1 1 0;
  min-width: 0;
  max-width: 110px;
}

.stat-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 7px;
  position: relative;
  background: var(--stat-bg, rgba(0, 123, 255, 0.13));
  color: var(--stat-color, #007bff);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  transition: all 0.3s;
  flex-shrink: 0;
}

.stat-icon i {
  font-size: 11px;
  transition: transform 0.3s;
}

.stat-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
}

.stat-value {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 1px;
  line-height: 1.1;
  transition: all 0.3s;
}

.stat-label {
  color: rgba(255,255,255,0.8);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.1;
  text-transform: none;
  letter-spacing: 0.1px;
  white-space: nowrap;
}

.stat-item:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.18);
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  transform: translateY(-1px) scale(1.02);
}

/* Online indicator animation */
.stat-item[data-stat="online"] .stat-icon::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--stat-color, #28a745);
  transform: translate(-50%, -50%);
  animation: pulse 2s infinite;
  opacity: 0.3;
}

@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0.3;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.1;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0.3;
  }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  .statistics-grid {
    flex-direction: row;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .stat-item {
    max-width: calc(33.333% - 6px);
    min-width: 80px;
    padding: 8px 6px;
  }

  .footer-statistics h5 {
    font-size: 14px;
    padding-top: 12px;
    margin-bottom: 12px;
  }

  .footer-statistics h5 i {
    font-size: 14px;
  }

  .footer-action-buttons {
    padding-top: 15px;
  }

  .footer-action-btn {
    font-size: 12px;
    padding: 6px 12px;
  }

  .qr-codes-container {
    justify-content: center;
  }

  .qr-code-item {
    min-width: 70px;
  }

  .qr-code-image {
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 576px) {
  .statistics-grid {
    flex-direction: row;
    gap: 6px;
    justify-content: space-between;
  }

  .stat-item {
    padding: 8px 4px;
    max-width: calc(33.333% - 4px);
    min-width: 70px;
    flex-direction: row;
  }

  .stat-icon {
    width: 30px;
    height: 30px;
    margin-right: 8px;
  }

  .stat-icon i {
    font-size: 12px;
  }

  .stat-value {
    font-size: 14px;
  }

  .stat-label {
    font-size: 9px;
  }

  .footer-statistics {
    margin-top: 12px;
    padding-top: 12px;
  }

  .footer-statistics h5 {
    font-size: 13px;
    margin-bottom: 10px;
  }

  .footer-statistics h5 i {
    font-size: 12px;
  }

  .footer-action-buttons {
    padding-top: 12px;
  }

  .footer-action-btn {
    font-size: 11px;
    padding: 5px 10px;
  }

  .footer-action-btn i {
    font-size: 12px;
  }

  .qr-code-section {
    margin-top: 15px;
    padding-top: 15px;
  }

  .qr-codes-container {
    gap: 15px;
  }

  .qr-code-item {
    min-width: 60px;
  }

  .qr-code-image {
    width: 45px;
    height: 45px;
  }
}

@media (max-width: 480px) {
  .statistics-grid {
    flex-direction: row;
    gap: 4px;
    justify-content: space-between;
  }

  .stat-item {
    padding: 6px 3px;
    max-width: calc(33.333% - 3px);
    min-width: 60px;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .stat-icon {
    width: 28px;
    height: 28px;
    margin-right: 0;
    margin-bottom: 4px;
  }

  .stat-icon i {
    font-size: 11px;
  }

  .stat-value {
    font-size: 12px;
    margin-bottom: 2px;
  }

  .stat-label {
    font-size: 8px;
    line-height: 1;
  }

  .footer-statistics h5 {
    font-size: 12px;
    margin-bottom: 8px;
  }

  .footer-statistics h5 i {
    font-size: 11px;
  }
}

/* ===== Extra Small Mobile Devices ===== */
@media (max-width: 320px) {
  .statistics-grid {
    gap: 3px;
  }

  .stat-item {
    padding: 4px 2px;
    max-width: calc(33.333% - 2px);
    min-width: 50px;
  }

  .stat-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 3px;
  }

  .stat-icon i {
    font-size: 10px;
  }

  .stat-value {
    font-size: 11px;
    margin-bottom: 1px;
  }

  .stat-label {
    font-size: 7px;
  }

  .footer-statistics h5 {
    font-size: 11px;
    margin-bottom: 6px;
  }

  .footer-statistics h5 i {
    font-size: 10px;
  }
}

/* ===== Mobile Touch Optimizations ===== */
@media (hover: none) and (pointer: coarse) {
  .stat-item {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
  }

  .stat-item:active {
    transform: scale(0.95);
    opacity: 0.8;
  }

  .stat-item:hover {
    transform: none;
  }
}

/* ===== Landscape Mobile Optimization ===== */
@media (max-width: 768px) and (orientation: landscape) {
  .statistics-grid {
    gap: 10px;
  }

  .stat-item {
    padding: 10px 8px;
    max-width: calc(33.333% - 7px);
  }

  .stat-icon {
    width: 35px;
    height: 35px;
    margin-right: 10px;
  }

  .stat-icon i {
    font-size: 14px;
  }

  .stat-value {
    font-size: 15px;
  }

  .stat-label {
    font-size: 10px;
  }
}

/* ===== High DPI Mobile Screens ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .stat-icon {
    border: 0.5px solid rgba(255, 255, 255, 0.1);
  }

  .stat-item {
    border-width: 0.5px;
  }
}

/* ===== Dark Mode Support for Mobile ===== */
@media (prefers-color-scheme: dark) {
  .stat-item {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
  }

  .stat-item:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
  }
}

/* ===== Reduced Motion Support ===== */
@media (prefers-reduced-motion: reduce) {
  .stat-item,
  .stat-icon,
  .stat-value,
  .stat-label {
    transition: none;
  }

  .stat-item:hover {
    transform: none;
  }

  .stat-item[data-stat="online"] .stat-icon::before {
    animation: none;
  }
}

/* ปุ่มขนาดใหญ่ เฉพาะใน footer เท่านั้น */
/* ใช้ style จาก button-reset.css แทน */

/* ปุ่มอ่านเพิ่มเติม/ปุ่ม section ให้ขนาดปกติ (override เฉพาะ blog/section ที่จำเป็น) */
/* ใช้ style จาก button-reset.css แทน */
