/* ============================================
   Cookie Consent Banner & Modal Styles
   Texplore - PDPA Compliance
   ============================================ */

/* --- Overlay (for modal only) --- */
.cc-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.cc-overlay.cc-active {
  opacity: 1;
  visibility: visible;
}

/* --- Compact Banner (slim bottom bar) --- */
.cc-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #2a2a2a;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.25);
  z-index: 10001;
  padding: 12px 0;
  transform: translateY(100%);
  transition: transform 0.4s ease;
  font-family: 'Inter', 'Noto Sans Thai', sans-serif;
}
.cc-banner.cc-active {
  transform: translateY(0);
}

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

.cc-banner-text {
  flex: 1;
  font-size: 12px;
  line-height: 1.5;
  color: #d1d1d1;
  margin: 0;
}

.cc-banner-text a {
  color: #ffffff;
  text-decoration: underline;
}
.cc-banner-text a:hover {
  color: #52db82;
}

.cc-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* --- Buttons --- */
.cc-btn {
  padding: 7px 18px;
  border-radius: 1000px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  border: 1.5px solid transparent;
  font-family: 'Inter', 'Noto Sans Thai', sans-serif;
  white-space: nowrap;
}

.cc-btn-accept {
  background: #1aa47b;
  color: #ffffff;
  border-color: #1aa47b;
}
.cc-btn-accept:hover {
  background: #148a66;
  border-color: #148a66;
}

.cc-btn-customize {
  background: transparent;
  color: #d1d1d1;
  border-color: transparent;
  text-decoration: underline;
  padding: 8px 12px;
  font-weight: 400;
}
.cc-btn-customize:hover {
  color: #ffffff;
}

/* --- Modal (detailed preferences) --- */
.cc-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  z-index: 10002;
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
  font-family: 'Inter', 'Noto Sans Thai', sans-serif;
}
.cc-modal.cc-active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.cc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cc-modal-title {
  font-family: 'Sora', 'Noto Sans Thai', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #111418;
  margin: 0;
}

.cc-modal-desc {
  font-size: 13px;
  line-height: 1.6;
  color: #4e5255;
  margin: 0 0 20px 0;
}

/* --- Language Toggle --- */
.cc-lang-toggle {
  display: flex;
  gap: 2px;
  background: #f4f4f5;
  border-radius: 1000px;
  padding: 2px;
}

.cc-lang-btn {
  border: none;
  background: transparent;
  padding: 3px 10px;
  border-radius: 1000px;
  font-size: 12px;
  font-weight: 600;
  color: #4e5255;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Inter', sans-serif;
}
.cc-lang-btn.cc-lang-active {
  background: #ffffff;
  color: #111418;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* --- Categories --- */
.cc-categories {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.cc-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #f8f9fa;
  border-radius: 10px;
  border: 1px solid #e7e7e8;
  transition: border-color 0.3s;
}
.cc-category:hover {
  border-color: #1aa47b;
}

.cc-category-info {
  flex: 1;
  margin-right: 12px;
}

.cc-category-name {
  font-size: 13px;
  font-weight: 600;
  color: #111418;
  margin: 0 0 2px 0;
}

.cc-category-desc {
  font-size: 11px;
  color: #4e5255;
  line-height: 1.4;
  margin: 0;
}

/* --- Toggle Switch --- */
.cc-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.cc-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cc-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  border-radius: 22px;
  transition: 0.3s;
}
.cc-toggle-slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.cc-toggle input:checked + .cc-toggle-slider {
  background-color: #1aa47b;
}
.cc-toggle input:checked + .cc-toggle-slider::before {
  transform: translateX(18px);
}
.cc-toggle input:disabled + .cc-toggle-slider {
  background-color: #1aa47b;
  opacity: 0.6;
  cursor: not-allowed;
}

/* --- Modal Buttons --- */
.cc-modal-buttons {
  display: flex;
  gap: 8px;
}

.cc-btn-save {
  background: #1aa47b;
  color: #ffffff;
  border-color: #1aa47b;
  flex: 1;
}
.cc-btn-save:hover {
  background: #148a66;
  border-color: #148a66;
}

.cc-btn-decline-modal {
  background: #ffffff;
  color: #4e5255;
  border-color: #d1d5db;
  flex: 1;
}
.cc-btn-decline-modal:hover {
  color: #111418;
  border-color: #111418;
}

/* --- Floating Settings Button --- */
.cc-settings-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1aa47b;
  color: #ffffff;
  border: none;
  cursor: pointer;
  z-index: 9998;
  box-shadow: 0 3px 10px rgba(26, 164, 123, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
}
.cc-settings-btn.cc-active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}
.cc-settings-btn:hover {
  background: #148a66;
  box-shadow: 0 5px 14px rgba(26, 164, 123, 0.4);
  transform: scale(1.05);
}
.cc-settings-btn svg {
  width: 22px;
  height: 22px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .cc-banner-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 0 16px;
  }
  .cc-banner-actions {
    justify-content: center;
  }
  .cc-modal {
    width: 95%;
    padding: 20px;
    max-height: 80vh;
  }
  .cc-modal-buttons {
    flex-direction: column;
  }
  .cc-settings-btn {
    bottom: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
  }
}

/* --- Policy page layout fix ---
   The fixed navbar is ~71px tall at desktop. The global .contact-main uses
   padding-top:75px which is barely enough and causes the h1 to overlap the
   navbar at certain zoom levels. Override with generous padding here. --- */
.contact-main {
  padding-top: 140px !important;
}
.contact-main .heading-5 {
  width: 100%;
  text-align: center;
  justify-content: center;
}

/* --- Privacy Policy & DSR page styles --- */
.pp-lang-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 32px;
  background: #f4f4f5;
  border-radius: 1000px;
  padding: 4px;
  width: fit-content;
}

.pp-lang-tab {
  border: none;
  background: transparent;
  padding: 8px 24px;
  border-radius: 1000px;
  font-size: 14px;
  font-weight: 600;
  color: #4e5255;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Inter', 'Noto Sans Thai', sans-serif;
}
.pp-lang-tab.pp-active {
  background: #ffffff;
  color: #111418;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pp-content {
  display: none;
}
.pp-content.pp-active {
  display: block;
}

.pp-content h2 {
  font-family: 'Sora', 'Noto Sans Thai', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: #111418;
  margin: 32px 0 12px 0;
}
.pp-content h2:first-child {
  margin-top: 0;
}

.pp-content h3 {
  font-family: 'Sora', 'Noto Sans Thai', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: #111418;
  margin: 24px 0 8px 0;
}

.pp-content p,
.pp-content li {
  font-size: 15px;
  line-height: 1.7;
  color: #4e5255;
}

.pp-content ul {
  padding-left: 20px;
  margin: 8px 0 16px 0;
}

.pp-content li {
  margin-bottom: 6px;
}

.pp-content a {
  color: #1aa47b;
  text-decoration: underline;
}
.pp-content a:hover {
  color: #148a66;
}

.pp-content .pp-effective-date {
  font-size: 13px;
  color: #888;
  font-style: italic;
  margin-bottom: 24px;
}

.pp-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}
.pp-content table th,
.pp-content table td {
  border: 1px solid #e7e7e8;
  padding: 10px 14px;
  text-align: left;
}
.pp-content table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #111418;
}
.pp-content table td {
  color: #4e5255;
}

/* --- DSR Form extras --- */
.dsr-request-type-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234e5255' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.dsr-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: #4e5255;
  cursor: pointer;
}
.dsr-consent-label input[type="checkbox"] {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: #1aa47b;
}
