/* --- Font Definition --- */
@font-face {
  font-family: "LINESeedSansTH";
  src: url("https://cdn.jsdelivr.net/gh/ok1developer/NO1Money/LINESeedSansTH_W_Rg.woff") format("woff");
  font-weight: 400; /* Regular */
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "LINESeedSansTH";
  src: url("https://cdn.jsdelivr.net/gh/ok1developer/NO1Money/LINESeedSansTH_W_Bd.woff") format("woff");
  font-weight: 700; /* Bold */
  font-style: normal;
  font-display: swap;
}

/* --- Global Styles & Resets --- */
:root {
  --primary-color: #005a8d;
  --secondary-color: #00a9e0;
  --accent-color: #ffc107;
  --text-color: #333;
  --light-text-color: #f8f9fa;
  --bg-color: #ffffff;
  --light-bg-color: #f8f9fa;
  --border-color: #e0e0e0;
  --font-family: "LINESeedSansTH", "Sarabun", sans-serif;
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --section-padding: 60px 0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.7;
  font-size: 16px;
  font-weight: 400;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-weight: 700;
}

h1 {
  font-size: 2.8rem;
  line-height: 1.2;
}
h2 {
  font-size: 2.2rem;
  margin-top: 2.5rem;
  line-height: 1.3;
}
h3 {
  font-size: 1.8rem;
  line-height: 1.4;
}
h4 {
  font-size: 1.4rem;
  line-height: 1.5;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

ul,
ol {
  margin-bottom: 1rem;
  padding-left: 20px;
}
.custom-list {
  list-style: none;
  padding-left: 0;
}
.custom-list li {
  padding-left: 25px;
  position: relative;
  margin-bottom: 0.5rem;
}
.custom-list li::before {
  content: "\f105";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: var(--secondary-color);
  position: absolute;
  left: 0;
  top: 2px;
}
.custom-ordered-list li {
  margin-bottom: 0.5rem;
}

/* --- Header & Navigation --- */
.sticky-header {
  background-color: rgba(255, 255, 255, 0.97);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05); /* Softer initial shadow */
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  padding: 12px 0;
  transition: box-shadow 0.3s ease-in-out; /* Smooth shadow transition */
}

.sticky-header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  color: var(--primary-color);
  text-decoration: none;
  transition: opacity 0.3s ease;
}
.logo:hover {
  opacity: 0.8;
  text-decoration: none;
}
.logo img {
  margin-right: 10px;
}
.logo span {
  font-weight: 700;
  color: var(--primary-color);
}

.nav-links {
  list-style: none;
  display: flex;
}

.nav-links li {
  margin-left: 25px;
  position: relative;
}

.nav-links a {
  font-weight: 400;
  font-size: 1rem;
  color: var(--text-color);
  padding: 8px 12px;
  border-radius: 5px;
  transition: background-color 0.3s ease, color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: fit-content;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  background-color: var(--primary-color);
  color: var(--light-text-color);
  text-decoration: none;
}

/* Dropdown Styles */
.nav-links .dropdown {
  position: relative;
}

.nav-links .dropdown-toggle {
  cursor: pointer;
}

.nav-links .dropdown-toggle i {
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

.nav-links .dropdown:hover .dropdown-toggle i {
  transform: rotate(180deg);
}

.nav-links .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  min-width: 220px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  border-radius: 5px;
  padding: 10px 0;
  list-style: none;
  margin-top: 0;
  z-index: 1000;
}

.nav-links .dropdown:hover .dropdown-menu {
  display: block;
}

/* Add padding to dropdown container to bridge the gap */
.nav-links .dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 0;
  z-index: 999;
}

.nav-links .dropdown-menu li {
  margin: 0;
}

.nav-links .dropdown-menu a {
  padding: 12px 20px;
  display: block;
  border-radius: 0;
  transition: background-color 0.3s ease, color 0.3s ease, padding-left 0.3s ease;
}

.nav-links .dropdown-menu a:hover {
  background-color: var(--light-bg-color);
  color: var(--primary-color);
  padding-left: 25px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary-color);
  cursor: pointer;
}

/* --- Hero Sections --- */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  color: var(--light-text-color);
  position: relative;
  overflow: hidden;
}
.hr-line-hero {
  color: var(--light-text-color);
  opacity: 0.7;
  margin-top: 10px;
  font-size: 0.9rem;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  background-size: 200% 200%;
  animation: gradientShift 15s ease infinite;
  z-index: -1;
  opacity: 0.9;
}
.pdpa-hero::before {
  background: linear-gradient(135deg, #0062cc, #00438a);
  animation-name: gradientShiftPDPA;
}
.dpo-hero::before {
  background: linear-gradient(135deg, #138496, #0d5c69);
  animation-name: gradientShiftDPO;
}
.terms-hero::before {
  background: linear-gradient(135deg, #218838, #155724);
  animation-name: gradientShiftTerms;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
@keyframes gradientShiftPDPA {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
@keyframes gradientShiftDPO {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
@keyframes gradientShiftTerms {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.hero h1 {
  font-size: 3.2rem;
  margin-bottom: 15px;
  color: var(--light-text-color);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
  font-weight: 700;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 20px;
  max-width: 750px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.95;
  font-weight: 400;
}
.hero .company-name {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* --- Content Section Layout --- */
.content-section {
  padding: var(--section-padding);
  display: flex;
  gap: 35px;
}

.toc-sidebar {
  flex: 0 0 300px;
  background-color: var(--light-bg-color);
  padding: 30px;
  border-radius: 10px;
  height: fit-content;
  position: sticky;
  top: 100px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
}

.toc-sidebar h2 {
  font-size: 1.4rem;
  margin-top: 0;
  margin-bottom: 15px;
  border-bottom: 2px solid var(--secondary-color);
  padding-bottom: 10px;
  display: flex;
  align-items: center;
  font-weight: 700;
}
.toc-sidebar .toc-icon {
  margin-right: 8px;
  color: var(--secondary-color);
}
.toc-divider {
  border: 0;
  height: 1px;
  background-color: var(--border-color);
  margin: 20px 0;
}

.toc-sidebar ul {
  list-style: none;
  padding-left: 0;
}

.toc-sidebar li a {
  display: block;
  padding: 10px 15px;
  margin-bottom: 6px;
  border-radius: 6px;
  color: var(--text-color);
  font-weight: 400;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
  font-size: 0.95rem;
}

.toc-sidebar li a:hover,
.toc-sidebar li a.active-toc {
  background-color: var(--secondary-color);
  color: var(--light-text-color);
  transform: translateX(5px);
  font-weight: 700;
}

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

.content-block {
  background-color: var(--bg-color);
  padding: 35px;
  margin-bottom: 35px;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
}
.content-block:first-child {
  margin-top: 0;
}
.content-block:last-child {
  margin-bottom: 0;
}

.content-block h2 i,
.content-block h3 i {
  margin-right: 12px;
  color: var(--secondary-color);
}
.sub-section {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  padding-left: 1rem;
  border-left: 3px solid var(--secondary-color);
}
.sub-section p:first-child {
  margin-top: 0;
}

.table-responsive {
  overflow-x: auto;
  margin-top: 20px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

th,
td {
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  text-align: left;
  vertical-align: top;
}

th {
  background-color: var(--primary-color);
  color: var(--light-text-color);
  font-weight: 700;
}

tbody tr:nth-child(even) {
  background-color: var(--light-bg-color);
}
tbody tr:hover {
  background-color: #e9ecef;
}
td strong {
  color: var(--primary-color);
  font-weight: 700;
}

/* --- Specific Element Styling (PDPA Page) --- */
.consent-options {
  margin-top: 20px;
}
.consent-option {
  background: #eef7ff;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 15px;
  border-left: 5px solid var(--secondary-color);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}
.consent-option h4 {
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.2rem;
  font-weight: 700;
}

.external-link {
  font-weight: 700; /* Make external links bold */
  color: var(--primary-color);
  word-break: break-all;
}
.external-link:hover {
  color: var(--secondary-color);
}

.section-divider {
  border: 0;
  height: 1px;
  background-image: linear-gradient(to right, rgba(0, 0, 0, 0), var(--border-color), rgba(0, 0, 0, 0));
  margin: 50px 0;
}

/* --- Specific Element Styling (DPO Page) --- */
.contact-cards-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  align-items: stretch;
}

.contact-card {
  background-color: var(--bg-color);
  padding: 30px;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  text-align: left;
  border: 1px solid var(--border-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.contact-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.contact-card .card-icon {
  font-size: 2.8rem;
  color: var(--secondary-color);
  margin-bottom: 20px;
  text-align: center;
}

.contact-card h2 {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 20px;
  font-weight: 700;
}

.contact-card p {
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  font-size: 0.95rem;
}

.contact-card p i {
  margin-right: 12px;
  color: var(--primary-color);
  width: 20px;
  text-align: center;
  margin-top: 3px;
}
.notification-block {
  background-color: #fff3cd;
  border-left: 5px solid #ffeeba;
  padding: 25px;
}
.notification-block h2 {
  color: #856404;
}
.notification-block h2 i {
  color: #856404;
}
.notification-block p {
  color: #856404;
}

/* --- Footer --- */
footer {
  background-color: var(--primary-color);
  color: var(--light-text-color);
  padding: 40px 0;
  text-align: center;
}
footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}
footer p {
  margin-bottom: 15px;
  font-size: 0.9rem;
}
.social-links a {
  color: var(--light-text-color);
  margin: 0 10px;
  font-size: 1.3rem;
  transition: color 0.3s ease, transform 0.3s ease;
}
.social-links a:hover {
  color: var(--accent-color);
  transform: scale(1.2);
}

/* --- Back to Top Button --- */
#backToTopBtn {
  display: none;
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99;
  border: none;
  outline: none;
  background-color: var(--secondary-color);
  color: white;
  cursor: pointer;
  padding: 12px 15px;
  border-radius: 50%;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
  opacity: 0; /* Start hidden for JS fade in */
}

#backToTopBtn:hover {
  background-color: var(--primary-color);
  transform: scale(1.1);
}

/* --- Animations --- */
.animate-fade-in {
  animation: fadeIn 1s ease-out forwards;
}
.animate-fade-in-down {
  animation: fadeInDown 0.8s ease-out forwards;
}
.animate-fade-in-up {
  animation: fadeInUp 0.8s 0.2s ease-out forwards;
}
.animate-slide-in-left {
  animation: slideInLeft 1s 0.3s ease-out forwards;
}
.animate-pop-in {
  animation: popIn 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
  transform: scale(0.5);
}

.animate-fade-in,
.animate-fade-in-down,
.animate-fade-in-up,
.animate-slide-in-left,
.animate-pop-in {
  opacity: 0;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes popIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
  .content-section {
    flex-direction: column;
  }
  .toc-sidebar {
    position: static;
    width: 100%;
    margin-bottom: 30px;
    flex: 0 0 auto;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: calc(100% - 1px);
    left: 0;
    background-color: white;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-top: 1px solid var(--border-color);
  }
  .nav-links.active {
    display: flex;
  }
  .nav-links li {
    margin: 0;
    width: 100%;
  }
  .nav-links a {
    display: block;
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
  }
  .nav-links li:last-child a {
    border-bottom: none;
  }

  /* Mobile Dropdown Styles */
  .nav-links .dropdown-menu {
    position: static;
    display: none;
    box-shadow: none;
    background-color: var(--light-bg-color);
    margin: 0;
    padding: 0;
  }

  .nav-links .dropdown.active .dropdown-menu {
    display: block;
  }

  .nav-links .dropdown-menu a {
    padding: 12px 15px 12px 35px;
    font-size: 0.9rem;
  }

  .nav-links .dropdown-menu a:hover {
    padding-left: 40px;
  }

  .menu-toggle {
    display: block;
  }

  h1 {
    font-size: 2.2rem;
  }
  h2 {
    font-size: 1.8rem;
  }
  .hero h1 {
    font-size: 2.5rem;
  }
  .hero p {
    font-size: 1rem;
  }

  .content-block {
    padding: 25px;
  }
  .contact-card {
    padding: 25px;
  }
  .toc-sidebar {
    padding: 20px;
  }

  #backToTopBtn {
    bottom: 20px;
    right: 20px;
    padding: 10px 13px;
    font-size: 1rem;
  }
}
@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }
  .hero p {
    font-size: 0.9rem;
  }
  h1 {
    font-size: 2rem;
  }
  h2 {
    font-size: 1.6rem;
  }
  h3 {
    font-size: 1.3rem;
  }
  .content-block {
    padding: 20px;
  }
  .toc-sidebar {
    padding: 15px;
  }
  .toc-sidebar li a {
    padding: 8px 10px;
    font-size: 0.9rem;
  }
}
.policy-version {
  font-size: 0.9rem;
  color: #ffffff;
  margin-top: 1rem;
}
