/* Google Font CDN Link */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=Ubuntu:wght@400;500;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  max-width: 100%; /* Ensure no element is wider than its container */
}

/* Base styles */
html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  position: relative; /* Add this to contain absolutely positioned elements */
}

/* Custom Scroll Bar CSS */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
  background: #EEA0D4;
  border-radius: 12px;
  transition: all 0.3s ease;
}
::-webkit-scrollbar-thumb:hover {
  background: #a76f94;
}

/* Scroll To Top Button CSS */
.scroll-button a {
  position: fixed;
  bottom: 20px;
  right: 20px;
  color: #fff;
  background: #f1a4d9;
  padding: 7px 12px;
  font-size: 18px;
  border-radius: 6px;
  box-shadow: rgba(0, 0, 0, 0.15) 0px 4px 6px;
  display: none;
  text-decoration: none;
  z-index: 1000;
}
.scroll-button a:hover {
  background: #e88eb6;
  box-shadow: rgba(0, 0, 0, 0.2) 0px 4px 8px;
}

/* Navigation and Header */
nav {
  position: fixed;
  width: 100%;
  padding: 20px 0;
  z-index: 998;
  transition: all 0.3s ease;
  font-family: 'Ubuntu', sans-serif;
}
nav.sticky {
  background: #EEA0D4;
  padding: 13px 0;
}
nav .navbar {
  width: 90%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: auto;
}
.logo {
  display: flex;
  align-items: center;
  margin-bottom: 40px;
}
nav .navbar .logo a {
  font-weight: 500;
  font-size: 35px;
  color: #EEA0D4;
  margin-left: -60px;
  margin-top: 15px;
}
nav.sticky .navbar .logo a {
  color: #fff;
}

/* Media Icons */
.media-icons {
  position: fixed;
  top: 50px;
  right: 50px;
  display: flex;
  gap: 15px;
  z-index: 1000;
}
.media-icons a {
  color: #EEA0D4;
  font-size: 18px;
  text-decoration: none;
  transition: color 0.3s ease;
}
.media-icons a:hover {
  color: #a76f94;
}

/* Go Back Button - Preserving original position */
.gobackbutton {
  color: #EEA0D4;
  padding: 10px 0; /* Fixed negative padding issue */
  border: 2px solid transparent;
  background-color: transparent;
  font-size: 20px;
  margin-left: -10px;
  margin-top: 10px;
  cursor: pointer;
}
.gobackbutton:hover {
  color: #ba7aa4;
  padding: 10px 0; /* Fixed negative padding issue */
  border: 2px solid transparent;
  background-color: transparent;
  font-size: 20px;
}

/* Menu */
.menu {
  display: none;
}

/* Home section */
.home {
  height: 100vh;
  width: 100%;
  background: url("images/background.png") no-repeat;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  font-family: 'Ubuntu', sans-serif;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #0E2431;
}
.home .home-content {
  width: 90%;
  height: 100%;
  margin: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.home .text-line {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid rgba(238, 160, 212, 0.75);
  display: block;
  width: 0;
  font-size: 2rem;
  margin: 10px 0;
}
.home .text-line:nth-child(1) {
  animation: typewriter-1 1s steps(17) 0s 1 normal forwards,
            blinkTextCursor 500ms steps(17) infinite normal;
  font-size: 25px;
  color: #0E2431;
}
.home .text-line:nth-child(2) {
  animation: typewriter-2 0.5s steps(12) 1s 1 normal forwards,
            blinkTextCursor 500ms steps(12) infinite normal;
  color: #0E2431;
  font-size: 75px;
  font-weight: 600;
  margin-left: -3px;
}
.home .text-line:nth-child(3) {
  animation: typewriter-3 1s steps(20) 1.5s 1 normal forwards,
            blinkTextCursor 500ms steps(20) infinite normal;
  font-size: 40px;
  margin: 5px 0;
  color: #EEA0D4;
}

/* Animation Keyframes - preserved from original */
@keyframes typewriter-1 { 
  from { width: 0; }
  to { width: 25ch; }
}
@keyframes typewriter-2 {
  from { width: 0; }
  to { width: 30ch; }
}
@keyframes typewriter-3 {
  from { width: 0; }
  to { width: 30ch; }
}
@keyframes typewriter-4 {
  from { width: 0; }
  to { width: 30ch; }
}
@keyframes blinkTextCursor {
  from { border-right-color: rgba(255, 255, 255, 0.75); }
  to { border-right-color: transparent; }
}

/* Button Styles */
.btn {
  border: none;
  width: 15em;
  height: 4em;
  border-radius: 3em;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  background: #ffc2e3;
  cursor: pointer;
  transition: all 450ms ease-in-out;
  margin-top: 5px;
}
.sparkle {
  fill: #AAAAAA;
  transition: all 800ms ease;
}
.text {
  font-weight: normal;
  color: #919191;
  font-size: medium;
}
.btn:hover {
  background: linear-gradient(0deg, #faa3dd, #c782b0);
  box-shadow: inset 0px 1px 0px 0px rgba(248, 248, 248, 0.4),
              inset 0px -4px 0px 0px rgba(189, 189, 189, 0.2),
              0px 0px 0px 4px rgba(255, 255, 255, 0.2),
              0px 0px 180px 0px #ba7aa4;
  transform: translateY(-2px);
}
.btn:hover .text {
  color: white;
}
.btn:hover .sparkle {
  fill: white;
  transform: scale(1.2);
}

/* Card Container - Fix for horizontal scroll */
.cardContainer {
  width: 100%; /* Changed from 100vw to 100% */
  height: auto; /* Allow height to adjust based on content */
  display: flex;
  flex-direction: row;
  margin-top: 20px;
  justify-content: center;
  flex-wrap: wrap; /* Allow cards to wrap */
  padding: 0 15px; /* Add padding instead of using full viewport width */
  box-sizing: border-box; /* Include padding in width calculation */
}
.card {
  width: 400px;
  height: 300px;
  background-color: #c782b0;
  border-radius: 10px;
  display: inline-block;
  align-items: center;
  text-align: center;
  justify-content: center;
  overflow: hidden;
  perspective: 1000px;
  box-shadow: 0 0 0 5px #a76f94;
  transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  margin: 10px;
  position: relative;
  max-width: 95%; /* Ensure card isn't wider than container on small screens */
}
.card:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 16px rgba(255, 255, 255, 0.2);
}
.card__content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 20px;
  box-sizing: border-box;
  background-color: #faa3dd;
  transform: rotateX(-90deg);
  transform-origin: bottom;
  transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.card:hover .card__content {
  transform: rotateX(0deg);
}
.card__title {
  margin: 0;
  font-size: 24px;
  color: #ffffff;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
}
.card__description {
  margin: 10px 0 0;
  font-size: 14px;
  color: #ffffff;
  line-height: 1.4;
  font-family: 'Poppins', sans-serif;
}

/* Card Images */
.cardtodolist {
  width: 100%;
  height: 300px;
  
}
.cardpayment {
  width: 100%;
  height: 300px;
 
}
.cardnetflix {
  width: 100%;
  height: 340px;
  object-fit: cover; /* Prevent distortion */
}
.cardspaceships {
  width: 100%;
  height: 300px;
  object-fit: cover; /* Prevent distortion */
}
.cardnumberguesser {
  width: 100%;
  height: 310px;
  margin-left: 0;
  margin-bottom: 10px;
}
.cardcalculator {
  width: 100%;
  height: 310px;
  margin-left: 0;
  margin-bottom: 10px;
}

/* Footer */
footer {
  background: #EEA0D4;
  padding: 15px 0;
  text-align: center;
  font-family: 'Poppins', sans-serif;
  margin-top: 200px;
  width: 100%; /* Ensure full width */
}
footer .text span {
  font-size: 17px;
  font-weight: 400;
  color: #fff;
}
footer .text span a {
  font-weight: 500;
  color: #FFF;
}
footer .text span a:hover {
  text-decoration: underline;
}

/* Responsive Styles */
@media screen and (max-width: 992px) {
  .media-icons {
    top: 30px;
    right: 30px;
  }
  
  /* Adjust animations for different screen sizes */
  @keyframes typewriter-1 { 
    from { width: 0; }
    to { width: 20ch; } /* Shorter width for medium screens */
  }
  @keyframes typewriter-2 {
    from { width: 0; }
    to { width: 20ch; } /* Shorter width for medium screens */
  }
  @keyframes typewriter-3 {
    from { width: 0; }
    to { width: 20ch; } /* Shorter width for medium screens */
  }
}

@media screen and (max-width: 768px) {
  /* Adjust animated text size for small screens */
  .home .text-line:nth-child(1) {
    font-size: 18px;
  }
  
  .home .text-line:nth-child(2) {
    font-size: 45px;
  }
  
  .home .text-line:nth-child(3) {
    font-size: 25px;
  }
  
  /* Stack cards vertically */
  .cardContainer {
    flex-direction: column;
    align-items: center;
    height: auto;
  }
  
  .card {
    width: 90%;
    max-width: 400px;
  }
  
  /* Adjust the social media icons */
  .media-icons {
    top: 20px;
    right: 20px;
    gap: 10px;
  }
  
  /* Adjust go back button */
  .gobackbutton {
    margin-left: -5px;
  }
  
  /* Adjust animations for smaller screens */
  @keyframes typewriter-1 { 
    from { width: 0; }
    to { width: 18ch; } /* Even shorter for small screens */
  }
  @keyframes typewriter-2 {
    from { width: 0; }
    to { width: 15ch; } /* Even shorter for small screens */
  }
  @keyframes typewriter-3 {
    from { width: 0; }
    to { width: 15ch; } /* Even shorter for small screens */
  }
}

@media screen and (max-width: 480px) {
  /* Further adjust text size for extra small screens */
  .home .text-line:nth-child(1) {
    font-size: 16px;
  }
  
  .home .text-line:nth-child(2) {
    font-size: 35px;
  }
  
  .home .text-line:nth-child(3) {
    font-size: 20px;
  }
  
  /* Ensure cards are full width */
  .card {
    width: 95%;
  }
  
  /* Adjust go back button for mobile */
  .gobackbutton {
    font-size: 18px;
  }
  
  /* Update logo position for mobile */
  nav .navbar .logo a {
    margin-left: -20px;
    font-size: 30px;
  }
  
  /* Adjust media icons for mobile */
  .media-icons {
    top: 15px;
    right: 15px;
    gap: 8px;
  }
  
  .media-icons a {
    font-size: 16px;
  }
  
  /* Adjust animations for tiny screens */
  @keyframes typewriter-1 { 
    from { width: 0; }
    to { width: 16ch; } /* Even shorter for tiny screens */
  }