/* General Styles */
body {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background-color: #3e3e3e;
  color: rgb(206, 104, 212);
  background-image: url(images/bg.gif);
}

a:link {
  color: #ffcc99;
}

/* visited link */
a:visited {
  color: #ffcc99;
}

/* mouse over link */
a:hover {
  color: #ff7f15;
}

/* selected link */
a:active {
  color: #ffcc99;
}

.container {
  width: 80%;
  margin: auto;
  overflow: hidden;
  padding: 0 20px;
}

header {
  background: #333;
  color: #d3af37;
  padding: 1rem 0;
  text-align: center;
  background-image: url(images/thai-style-pattern.png);
  background-repeat: no-repeat; /* Do not repeat the image */
  background-size: cover; /* Resize the background image to cover the entire container */
  background-blend-mode: lighten;
}

header h1 {
  margin: 0;
  font-size: 2.5rem;
}

header p {
  font-size: 1.1rem;
}

main section {
  padding: 20px 0;
  border-bottom: 1px #ddd solid;
  background-color: #3e3e3e;
}

main section:last-child {
  border-bottom: none;
}

h2 {
  text-align: center;
  margin-bottom: 20px;
  color: #ffc30b;
}

/* About Sarah Section */
#about-sarah .profile-container {
  display: flex;
  align-items: flex-start; /* Align items to the start for better text flow */
  gap: 54px; /* Space between image and text */
  padding: 0px 54px;
}

#about-sarah .profile-image {
  width: 250px; /* Adjust as needed */
  height: auto;
  border-radius: 8px;
  border: 3px solid #ddd;
}

#about-sarah .profile-text {
  flex: 1; /* Allows text to take remaining space */
}

#about-sarah .profile-key {
  flex: 1; /* Allows text to take remaining space */
  color: #ffcc99;
  padding: 0px 54px;
}

#about-sarah h3 {
  margin-top: 20px;
}

#about-sarah ul {
  list-style: disc;
  padding-left: 20px;
}

#contact {
  color: #faa668;
}

/* Companies Section */
.company-grid {
  display: grid;
  /* 4 columns
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  */
  /* 5 columns 
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
  */
  /* 6 columns */
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.company-card {
  background: #333;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.company-card img {
  /* max-width: 100%; */
  max-height: 160px; /* Fixed height for consistency */
  object-fit: contain; /* Ensures image fits well */
  border-radius: 4px;
  margin-bottom: 10px;
}

.company-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0;
}

.company-card h4 {
  font-size: 1rem;
  font-weight: 300;
  margin-bottom: 0;
}

/* Contact Section */
#contact p {
  text-align: center;
}

/* Footer */
footer {
  background: #333;
  color: #fff;
  text-align: center;
  padding: 1rem 0;
  margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    width: 90%;
  }

  header h1 {
    font-size: 2rem;
  }

  #about-sarah .profile-container {
    flex-direction: column; /* Stack image and text on smaller screens */
    align-items: center; /* Center items when stacked */
  }

  #about-sarah .profile-image {
    margin-bottom: 20px; /* Add space below image when stacked */
  }

  .company-grid {
    grid-template-columns: 1fr; /* Single column for companies on smaller screens */
  }
}

@media (max-width: 480px) {
  .container {
    width: 95%;
  }

  header h1 {
    font-size: 1.8rem;
  }

  header p {
    font-size: 1rem;
  }

  h2 {
    font-size: 1.5rem;
  }
}

.modal-link {
  display: inline-block;
  text-decoration: underline;
  transition: all 0.3s ease;
  cursor: pointer;
}

.modal-link:hover {
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: white;
  width: 90%;
  max-width: 950px;
  border-radius: 12px;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.4s ease;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-header {
  background: #3e3e3e;
  color: white;
  padding: 20px;
  position: relative;
}

.modal-title {
  font-size: 24px;
  margin: 0;
  font-weight: 500;
}

.close-button {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.3s ease;
}

.close-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-content {
  padding: 30px;
  line-height: 1.6;
  /*   max-width: 650px; */
  background: #5b5b5b;
  align-items: center;
}

.modal-content p {
  margin-bottom: 20px;
  color: #2c3e50;
  font-size: 16px;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  padding: 20px;
  border-top: 1px solid #ecf0f1;
  gap: 10px;
}

.modal-button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.button-primary {
  background: #3498db;
  color: white;
}

.button-primary:hover {
  background: #2980b9;
}

.button-secondary {
  background: #ecf0f1;
  color: #7f8c8d;
}

.button-secondary:hover {
  background: #dfe6e9;
}

@media (max-width: 600px) {
  .modal-container {
    width: 95%;
  }

  .modal-buttons {
    flex-direction: column;
  }

  .modal-button {
    width: 100%;
  }
}
