/* styles.css */
/* Add this at the very top to prevent horizontal scroll */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* Add padding to body to account for fixed header */
body {
  margin: 0;
  font-family: "Times New Roman", Times, serif;
  box-sizing: border-box; /* Add this */
  padding-top: 90px; /* Increased to account for gradient line */
}

/* Add universal box-sizing */
*, *::before, *::after {
  box-sizing: border-box;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 100vw;
  background-color: #fcfcfc;
  backdrop-filter: blur(10px);
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 0; /* Remove padding from header itself */
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px; /* Move padding to header-content */
}

.header .gradient-line {
  margin: 0; /* Remove default margin */
  width: 100%;
}

.logo {
  font-weight: bold;
  color: #333;
}

.navbar {
  position: relative;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 15px;
  flex-wrap: wrap; /* Allow wrapping on small screens */
}

.nav-list li a {
  text-decoration: none;
  color: #333;
  font-size: 24px;
  padding: 5px;
}

.nav-list li a:hover {
  color: rgb(175, 43, 57);
}

.opening-text {
  margin-left: 56px;
  margin-right: 56px;
  margin-top: calc(50vh / 8); /* 1/16 of spacer height (50vh) */
  display: flex;
  align-items: center;
  gap: 40px;
  width: calc(100% - 112px); /* Account for margins */
  max-width: 100%;
}

.text-block {
  text-align: left;
  flex: 1; /* Allow text to shrink */
  min-width: 0; /* Allow shrinking below content size */
}

.opening-image {
  max-width: 400px;
  width: 100%; /* Make responsive */
  height: auto;
  border-radius: 8px;
  margin-left: 60px;
  flex-shrink: 0; /* Prevent image from shrinking too much */
}

.opening-text h1 {
  font-size: 96px;
  margin-bottom: 30px;
  margin-top: 50px; /* Reduced from 100px since we have body padding now */
  word-wrap: break-word; /* Prevent text overflow */
}

.opening-text h2 {
  font-size: 48px;
  word-wrap: break-word; /* Prevent text overflow */
}

@media (max-width: 768px) {
  .opening-text {
      flex-direction: column;
      text-align: center;
      margin-left: 20px;
      margin-right: 20px;
      width: calc(100% - 40px);
  }
  
  .opening-text h1 {
      font-size: 48px; /* Smaller on mobile */
  }
  
  .opening-text h2 {
      font-size: 32px; /* Smaller on mobile */
  }
  
  .opening-image {
      margin-left: 0;
      max-width: 100%;
  }
}

.gradient-line {
  height: 4px;
  border: none;
  background: linear-gradient(to right, rgb(175, 43, 57), rgb(15, 11, 12), rgb(175, 43, 57));
  width: 100%;
  max-width: 100%;
}

.background-shape {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  /* background: linear-gradient(to right, rgb(175, 43, 57), rgb(236, 231, 232), rgb(175, 43, 57)); */
  background: #fafafa;
  z-index: -1;
  clip-path: polygon(0 0, 0% 0, 0% 00%, 0% 00%);
}

/* mobile formatting for text */
/* Responsive text visibility */
.mobile-text {
  display: none;
}

.desktop-text {
  display: inline;
}

/* Enhanced mobile styles */
@media (max-width: 768px) {
  .mobile-text {
    display: inline;
  }
  
  .desktop-text {
    display: none;
  }
  
  .opening-text {
    flex-direction: column;
    text-align: center;
    margin-left: 20px;
    margin-right: 20px;
    width: calc(100% - 40px);
    gap: 20px;
  }
  
  .opening-text h1 {
    font-size: 48px;
    margin-top: 40px; 
    margin-bottom: 20px;
  }
  
  .opening-text h2 {
    font-size: 28px;
    line-height: 1.2;
  }
  
  .opening-image {
    margin-left: 0;
    max-width: 200px;
    width: 200px;
    height: auto;
    margin-top: 10px;
  }
}
/* fix header spacing */

@media (max-width: 768px) {
  body {
    padding-top: 60px; /* Reduced from 90px */
  }
  
  .opening-text {
    flex-direction: column;
    text-align: center;
    margin-left: 20px;
    margin-right: 20px;
    margin-top: 20px; /* Much smaller fixed margin */
    width: calc(100% - 40px);
    gap: 20px;
  }
  
  .opening-text h1 {
    font-size: 48px;
    margin-bottom: 20px;
    margin-top: 40px; /* Reduced from 50px */
  }
}


/* end */

/* Navbar */
.nav-list a {
  position: relative;
  text-decoration: none;
  color: inherit;
  padding: 8px 16px;
  transition: color 0.3s ease;
}

.nav-list a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background-color: rgb(15, 11, 12);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-list a:hover::after {
  width: 100%;
}

.nav-list a:hover {
  color: rgb(15, 11, 12);
}

.nav-list a:hover {
  background-color: #f8f9fa;
  color: rgb(15, 11, 12);
  border-radius: 6px;
}

/* Logo */
.logo-with-bg {
  display: inline-block;
  position: relative;
  width: 60px; /* Adjust width to match your lobster image */
  height: 60px; /* Adjust height to match your lobster image */
  background-image: url("golden_ration.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: bold;
  transition: all 0.3s ease;
  
  /* Center the text over the image */
  display: flex;
  align-items: center;
  justify-content: center;
  
  /* Rotate the text 45 degrees */
  color: #333;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8); /* Add text shadow for better readability */
}

.logo-with-bg::before {
  content: "Josh Phythian";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  white-space: nowrap;
  pointer-events: none;
}

.logo-with-bg:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .logo-image {
      height: 35px;
  }
  
  .logo-text {
      font-size: 1.2rem;
  }
  
  .logo-with-bg {
      width: 50px;
      height: 50px;
      font-size: 1rem;
  }
  
  .nav-list {
      gap: 10px; /* Reduce gap on mobile */
  }
  
  .nav-list li a {
      font-size: 20px; /* Smaller font on mobile */
      padding: 4px 8px;
  }
}

/* Section2 boxes */
.spacer {
  height: 20vh;
  width: 100%;
  max-width: 100%;
}

/* Container for textboxes */
.textboxes-container {
  position: relative;
  width: 100%;
  max-width: 100vw; /* Prevent exceeding viewport */
  min-height: 150vh; /* Increase height to give more space */
  display: block; /* Change from flex to block for absolute positioning */
  padding: 50px 0; /* Add some padding for safety */
  z-index: 10;
  box-sizing: border-box;
}

/* Individual textbox styling */
.textbox {
  position: absolute;
  width: 300px; /* Fixed width for consistency */
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgb(175, 43, 57);
  /* border: 2px solid rgb(15, 11, 12); */
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  z-index: 15;
  box-sizing: border-box; /* Ensure padding is included in width */
  
  /* Initial hidden state - start visible for debugging */
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Position each textbox at specific x coordinates */
#textbox1 {
  /* left: calc(50% - 150px);  */
  /* 1/2 from left, minus half width to center */
  left: calc(83.33% - 150px); 
  
  top: -50px;
  transform: translateX(100px) scale(0.8); /* Initial offset */
  transition-delay: 0s;
}

#textbox1.visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}

#textbox2 {
  left: calc(60.67% - 150px); /* 4/6 from left, minus half width to center */
  top: 300px;
  transform: translateX(100px) scale(0.8);
  transition-delay: 0.2s;
}

#textbox2.visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}

#textbox3 {
  left: calc(83.33% - 150px); /* 5/6 from left, minus half width to center */
  top: 500px;
  transform: translateX(100px) scale(0.8);
  transition-delay: 0.4s;
}

#textbox3.visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}

/* Reduce spacing between intro paragraph and list */
.textbox .list-intro {
  margin-bottom: 4px; /* Reduced from default margin */
}

.textbox .tight-list {
  margin-top: 0px; /* Remove top margin from list */
  padding-top: 0;
}


/* Remove the old visible state since it's now handled individually */
/* .textbox.visible - removed, now handled per textbox */

/* Textbox content styling */
.textbox h3 {
  color: rgb(175, 43, 57);
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.textbox p {
  color: rgb(15, 11, 12);
  line-height: 1.6;
  font-size: 1rem;
}

/* Remove old staggered animation delays - now handled in individual textbox rules */

/* Alternative layout: Force textboxes to exact right third */
.textboxes-container-right-third {
  position: relative;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  display: block;
  padding: 0;
  z-index: 10;
}

.textbox-right-positioned {
  position: absolute;
  right: 5%;
  width: 28%;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgb(175, 43, 57);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  z-index: 15;
  box-sizing: border-box;
  
  /* Initial hidden state */
  opacity: 0;
  transform: translateX(100px) scale(0.8);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Positioning for each textbox when using absolute positioning */
#textbox1.textbox-right-positioned {
  top: 10%;
}

#textbox2.textbox-right-positioned {
  top: 40%;
}

#textbox3.textbox-right-positioned {
  top: 70%;
}

/* Responsive design */
@media (max-width: 1024px) {
  .textbox {
      width: 280px; /* Slightly smaller on medium screens */
  }
}

@media (max-width: 768px) {
  .textboxes-container {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 3rem;
      padding: 0 5%;
  }
  
  .textbox {
      position: relative; /* Switch back to relative positioning on mobile */
      width: 90%;
      max-width: 90%;
      left: auto !important; /* Override absolute positioning */
      top: auto !important; /* Override absolute positioning */
      transform: translateY(50px) scale(0.9) !important; /* Override x-transforms */
  }
  
  .textbox.visible {
      transform: translateY(0) scale(1) !important;
  }
  
  /* Reset individual textbox positioning on mobile */
  #textbox1, #textbox2, #textbox3 {
      position: relative;
      left: auto;
      top: auto;
  }
  
  #textbox1.visible, #textbox2.visible, #textbox3.visible {
      transform: translateY(0) scale(1);
  }
}

/* Fix background shape z-index to ensure textboxes appear above it */
.background-shape {
  z-index: -1;
}
/* Info Section */
.info-section {
  background-color: #f8f9fa;
  padding: 60px 0;
  margin-top: 50px;
  border-top: 1px solid #e9ecef;
  border-bottom: 1px solid #e9ecef;
}

.info-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 60px;
  align-items: flex-start;
}

.info-left {
  flex: 2;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Replace the existing .info-right rule with this updated version */
.info-right {
  flex: 1;
  padding-left: 40px;
  position: relative;
}

/* Add the gradient line as a pseudo-element */
.info-right::before {
  content: '';
  position: absolute;
  left: -2px; /* Position it where the border was */
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, rgb(15, 11, 12), rgb(175, 43, 57), rgb(15, 11, 12));
}

/* Red semicircle background element */
.textboxes-container::before {
  content: 'RESEARCH';
  position: absolute; /* Keep as absolute if you want it contained to the section */
  left: -25vw; /* Extend beyond container to left */
  top: 0;
  width: 70vw;
  height: 120%;
  background-color: rgb(175, 43, 57);
  border-radius: 0 50vw 50vw 0;
  z-index: 1;
  opacity: 0.2;
  pointer-events: none;
  transform: translateY(-10vw); /* Move up by 10vw */
  
  /* Text styling */
  display: flex;
  align-items: center;
  justify-content: right;
  font-size: 6vw;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.8);
  font-family: "Times New Roman", Times, serif;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.2em;
}

/* Ensure the textboxes container can contain the semicircle */
.textboxes-container {
  position: relative;
  overflow: visible; /* Allow semicircle to extend beyond */
}

/* Hide on mobile to prevent layout issues */
@media (max-width: 768px) {
  .textboxes-container::before,
  .textboxes-container::after {
    width: 80vw; /* Smaller on mobile */
    height: 110%;
    transform: translateY(-40vw); 
    border-radius: 0 80vw 90vw 0;
  }
}

/* end */

/* For responsive design, remove the gradient line on mobile */
@media (max-width: 768px) {
  .info-right::before {
    display: none;
  }
}

.info-block h3 {
  color: rgb(175, 43, 57);
  font-size: 1.3rem;
  margin-bottom: 15px;
  font-weight: 600;
}

.info-block ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.info-block li {
  color: rgb(15, 11, 12);
  margin-bottom: 8px;
  padding-left: 15px;
  position: relative;
}

.info-block li:before {
  content: "•";
  color: rgb(175, 43, 57);
  position: absolute;
  left: 0;
}

.info-block p {
  color: rgb(15, 11, 12);
  margin: 8px 0;
  line-height: 1.5;
}

.info-block a {
  color: rgb(175, 43, 57);
  text-decoration: none;
  transition: color 0.3s ease;
}

.info-block a:hover {
  color: rgb(15, 11, 12);
  text-decoration: underline;
}

.info-right h3 {
  color: rgb(175, 43, 57);
  font-size: 1.3rem;
  margin-bottom: 20px;
  font-weight: 600;
}

.info-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.info-nav-list li {
  margin-bottom: 15px;
}

.info-nav-list a {
  color: rgb(15, 11, 12);
  text-decoration: none;
  font-size: 1.1rem;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.3s ease;
  display: block;
}

.info-nav-list a:hover {
  background-color: rgb(175, 43, 57);
  color: white;
  transform: translateX(5px);
}

/* Responsive design for info section */
@media (max-width: 768px) {
  .info-container {
    flex-direction: column;
    gap: 40px;
  }
  
  .info-right {
    padding-left: 0;
    border-left: none;
    border-top: 2px solid rgb(175, 43, 57);
    padding-top: 30px;
  }
  
  .info-left {
    gap: 25px;
  }
}


/* Footer */
.footer {
  background-color: #f8f9fa;
  padding: 20px 0;
  text-align: center;
  border-top: 1px solid #e9ecef;
  margin-top: 2px;
}

.footer p {
  margin: 0;
  color: #6c757d;
  font-size: 14px;
}

.footer a {
  color: rgb(175, 43, 57);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer a:hover {
  color: rgb(15, 11, 12);
  text-decoration: underline;
}

/* Project section */

.title {
  font-size: max(2vw, 24px);
  line-height: 1.1;
  padding-bottom: .4em;
  color: rgb(255, 255, 255);
  text-shadow: 0 2px 2px rgba(0, 0, 0, .1);
}

.text {
  font-size: max(1vw, 15px);
  line-height: 1.4;
  overflow: hidden;
  padding-bottom: 20px;
  color: rgba(255, 255, 255, 0.7);
}

.accordions {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 2vh;
}

.accordion {
  background: linear-gradient(200deg, rgb(175, 43, 57), rgb(15, 11, 12) 3.57%, rgb(175, 43, 57) 98.38%);
  width: max(50vw, 280px);
  padding: 25px 30px 10px;
  border-radius: 15px;
  margin-bottom: 40px;
  box-shadow: 0 30px 30px -10px rgba(0, 0, 0, .3);
  
  &:nth-child(2) {
    background: linear-gradient(200deg, rgb(15, 11, 12) 3.57%, rgb(175, 43, 57) 98.38%);
  }
  
  &:nth-child(3) {
    background: linear-gradient(200deg, rgb(175, 43, 57), rgb(15, 11, 12) 3.57%, rgb(175, 43, 57) 98.38%);
  }
  
  &:nth-child(4) {
    background: linear-gradient(200deg, rgb(15, 11, 12) 3.57%, rgb(175, 43, 57) 98.38%);
  }
  &:nth-child(5) {
    background: linear-gradient(200deg, rgb(175, 43, 57), rgb(15, 11, 12) 3.57%, rgb(175, 43, 57) 98.38%);
  }
  &:nth-child(6) {
    background: linear-gradient(200deg, rgb(15, 11, 12) 3.57%, rgb(175, 43, 57) 98.38%);
  }
}

#project-section a,
.accordion a,
.accordion .title a {
  color: white !important;
  text-decoration: none;
}

/* Hover effect for project section links */
#project-section a:hover,
.accordion a:hover,
.accordion .title a:hover {
  color: rgba(255, 255, 255, 0.8) !important;
  text-decoration: underline;
}

/* Alternative approach - if you want to be more specific */
.accordions .accordion .title a {
  color: white !important;
  text-decoration: none;
}

.accordions .accordion .title a:hover {
  color: rgba(255, 255, 255, 0.8) !important;
  text-decoration: underline;
}


@media (max-width: 480px) {
  .accordion {
    padding: 15px 20px 8px;
  }
  .title {
    font-size: 20px;
  }
}
