:root {
  --primary-color: #0054c9;
  --secondary-color: #ffd401;
  --dark-color: #010101;
  --light-color: #f4f4f4;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  background-color: var(--light-color);
  margin: 0;
  padding: 0;
}

* {
  box-sizing: border-box;
}

a {
  text-decoration: none;
  color: #333;
}

.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  box-shadow: 0 0 0 0.5px var(--light-color) inset;
  z-index: 999;
  background: var(--primary-color) !important;
  backdrop-filter: blur(10px);
  font-family: 'Poppins', sans-serif;
}

.navbar span {
  color: var(--secondary-color);
  font-weight: 700;
}

.navbar-nav .nav-link:hover {
  color: var(--secondary-color) !important;
  transition: 0.5s;
  transform: scale(1.03);
}

.navbar-nav .nav-link {
  transition: all 0.2s ease-in-out;
  width: fit-content;
}

.navbar img {
  display: none;
}

.bounce.spin {
  animation: bounce 0.6s ease-in-out 1s, spin 0.6s ease-in-out 2s;
}

@keyframes bounce {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes spin {
  from {
    transform: rotate(0);
  }
  to {
    transform: rotate(360deg);
  }
}

/* From Uiverse.io by RiccardoRapelli */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch #input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #2196f3;
  -webkit-transition: 0.4s;
  transition: 0.4s;
  z-index: 0;
  overflow: hidden;
}

.sun-moon {
  position: absolute;
  content: '';
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: yellow;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

#input:checked + .slider {
  background-color: black;
}

#input:focus + .slider {
  box-shadow: 0 0 1px #2196f3;
}

#input:checked + .slider .sun-moon {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
  background-color: white;
  -webkit-animation: rotate-center 0.6s ease-in-out both;
  animation: rotate-center 0.6s ease-in-out both;
}

.hero-section {
  background-image: url('https://images.unsplash.com/photo-1557683316-973673baf926');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  min-height: 100vh; /* Use min-height instead of height */
  justify-content: center;
  align-items: center;
  color: var(--light-color);
  text-align: center;
  margin-top: 0 !important; /* Remove bootstrap margin */
  padding-top: 6rem !important; /* Add padding to compensate for navbar height */
  display: flex;
}

.hero-section h1 {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 10px;
}

.hero-section p {
  font-size: 18px;
  margin-bottom: 10px;
  font-weight: 300;
}

/* From Uiverse.io by abrahamcalsin */
.button {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 5px;
  background: #0054c9;
  font-family: 'Poppins', sans-serif;
  box-shadow: 0px 6px 24px 0px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  cursor: pointer;
  border: none;
  margin: 0.5rem 0.5rem;
}

.button:after {
  content: ' ';
  width: 0%;
  height: 100%;
  background: #ffd401;
  position: absolute;
  transition: all 0.4s ease-in-out;
  right: 0;
}

.button:hover::after {
  right: auto;
  left: 0;
  width: 100%;
}

.button span {
  text-align: center;
  text-decoration: none;
  width: 100%;
  padding: 18px 25px;
  color: var(--light-color);
  font-size: 1.125em;
  font-weight: 700;
  letter-spacing: 0.3em;
  z-index: 20;
  transition: all 0.3s ease-in-out;
}

.button:hover span {
  color: #006aff;
  animation: scaleUp 0.3s ease-in-out;
}

@keyframes scaleUp {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.95);
  }

  100% {
    transform: scale(1);
  }
}

/* From Uiverse.io by david-mohseni */
.wrapper {
  display: inline-flex;
  list-style: none;
  height: 120px;
  width: 100%;
  padding-top: 40px;
  font-family: 'Poppins', sans-serif;
  justify-content: center;
}

.wrapper .icon {
  position: relative;
  background: #f4f4f4;
  color: #010101;
  border-radius: 50%;
  margin: 10px;
  width: 50px;
  height: 50px;
  font-size: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.wrapper .tooltip {
  position: absolute;
  top: 0;
  font-size: 14px;
  background: var(--light-color);
  color: var(--light-color);
  padding: 5px 8px;
  border-radius: 5px;
  box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.wrapper .tooltip::before {
  position: absolute;
  content: '';
  height: 8px;
  width: 8px;
  background: var(--light-color);
  bottom: -3px;
  left: 50%;
  transform: translate(-50%) rotate(45deg);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.wrapper .icon:hover .tooltip {
  top: -45px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.wrapper .icon:hover span,
.wrapper .icon:hover .tooltip {
  text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.1);
}

.wrapper .tiktok:hover,
.wrapper .tiktok:hover .tooltip,
.wrapper .tiktok:hover .tooltip::before {
  background: var(--dark-color);
  color: var(--light-color);
}

.wrapper .github:hover,
.wrapper .github:hover .tooltip,
.wrapper .github:hover .tooltip::before {
  background: var(--dark-color);
  color: var(--light-color);
}

.wrapper .instagram:hover,
.wrapper .instagram:hover .tooltip,
.wrapper .instagram:hover .tooltip::before {
  background: #e4405f;
  color: var(--light-color);
}

.card {
  position: relative;
  width: 100%;
  max-width: 300px;
  height: 300px;
  background-color: #f2f2f2;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  perspective: 1000px;
  box-shadow: 0 0 0 5px #ffffff80;
  transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  margin: 0 auto;
}

/* Cards dark mode */
body.dark-mode .card {
  background-color: var(--dark-card-bg);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.1);
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
  -webkit-font-smoothing: subpixel-antialiased;
}

.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;
  background-color: rgba(242, 242, 242, 0.9);
  transform: rotateX(-90deg);
  transform-origin: bottom;
  transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Cards dark mode */
body.dark-mode .card__content {
  background-color: rgba(30, 30, 30, 0.95);
  color: var(--dark-text);
}

.card:hover .card__content {
  transform: rotateX(0deg);
}

.card:hover img {
  transform: scale(1.1);
}

.card__title {
  margin: 0 0 10px 0;
  font-size: 24px;
  color: #333;
  font-weight: 700;
  text-align: center;
}

/* Cards dark mode */
body.dark-mode .card__title {
  color: var(--dark-text);
}

.card:hover svg {
  scale: 0;
}

.card__description {
  margin: 0;
  font-size: 14px;
  color: #777;
  line-height: 1.4;
  text-align: center;
  padding: 0 10px;
}

/* Cards dark mode */
body.dark-mode .card__description {
  color: var(--dark-text-secondary);
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  width: fit-content;
}

.card-link:hover {
  text-decoration: none;
  color: inherit;
}

/* Style for Project Section */
#proyek {
  position: relative;
  background-image: url('https://images.unsplash.com/photo-1557683316-973673baf926');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  height: fit-content;
  justify-content: center;
  align-items: center;
  color: var(--light-color);
  text-align: center;
  padding: 3rem 0;
  margin-top: -100px;
  padding: 4rem 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

.cards-container {
  display: grid;
  grid-template-columns: repeat(3, minmax(300px, 1fr));
  gap: 2rem;
  width: 100%;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
  justify-items: center;
}

.cards-container::after {
  content: '';
  width: 0;
}

.cards-container:last-child:nth-child(3n-1) {
  grid-column-end: -2;
}

.cards-container:last-child:nth-child(3n-2) {
  grid-column: 2;
}

#proyek .content-container {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
}

#proyek h1 {
  position: relative;
  z-index: 1;
}

/* Contact Info Container */
.contact-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 2rem;
}

.contact-info div {
  background: rgba(255, 255, 255, 0.1);
  padding: 1.5rem 2rem;
  border-radius: 10px;
  backdrop-filter: blur(5px);
  transition: transform 0.3s ease;
}

.contact-info div:hover {
  transform: translateY(-5px);
}

#tentang .content-container {
  margin-bottom: auto;
}

#tentang .content-container p {
  padding: 0.5rem 1rem !important;
  margin-bottom: 0.5rem;
}

@media (min-width: 992px) {
  #tentang .content-container p {
    padding: 0.5rem 10rem !important;
  }
}

/* Update About and Skills Section Layout */
#tentang .content-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

#tentang .content-container p {
  padding: 1rem !important;
  margin-bottom: 1rem;
  text-align: justify;
}

/* Skills Container Updates */
.skills-container {
  max-width: 800px;
  margin: 3rem auto;
  padding: 0 1rem;
}

/* Remove progress bar styles and revert to original skill section styles */
.skill-timeline {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.skill-item {
  background: rgba(255, 255, 255, 0.9);
  border-left: 4px solid var(--primary-color);
  padding: 1.5rem;
  border-radius: 0 8px 8px 0;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  height: 100%;
}

.skill-item:hover {
  transform: translateX(10px);
  border-left-color: var(--secondary-color);
  background: rgba(255, 255, 255, 1);
}

.skill-title {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.skill-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.since {
  color: var(--dark-color) !important;
  font-size: 0.9rem;
  margin: 0;
  font-weight: 500;
}

.skill-level {
  background: var(--primary-color);
  color: var(--light-color);
  padding: 0.2rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.skill-tech {
  color: var(--dark-color) !important;
  opacity: 0.8;
  margin: 0;
  font-size: 0.9rem;
}

/* Timeline Education Styles */
.timeline {
  position: relative;
  max-width: 1200px;
  margin: 10rem auto;
  padding: 20px;
}

.timeline::after {
  content: '';
  position: absolute;
  width: 6px;
  background-color: var(--secondary-color);
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -3px;
  border-radius: 3px;
}

.timeline-item {
  padding: 10px 40px;
  position: relative;
  width: 50%;
}

.timeline-item::after {
  content: '';
  position: absolute;
  width: 25px;
  height: 25px;
  right: -17px;
  background-color: var(--secondary-color);
  border: 4px solid var(--primary-color);
  top: 15px;
  border-radius: 50%;
  z-index: 1;
}

.left {
  left: 0;
}

.right {
  left: 50%;
}

.right::after {
  left: -16px;
}

.timeline-content {
  padding: 1rem;
  background-color: white;
  position: relative;
  border-radius: 6px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.timeline-content:hover {
  transform: translateY(-5px);
}

.timeline-date {
  color: var(--secondary-color);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.timeline-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

/* Dark mode adjustments */
body.dark-mode .timeline-content {
  background-color: var(--dark-surface);
  color: var(--dark-text);
}

body.dark-mode .timeline-title {
  color: var(--secondary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
  .skill-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .skills-container {
    margin: 2rem auto;
  }

  .skill-item {
    padding: 1rem;
  }

  .cards-container {
    grid-template-columns: 1fr;
    padding: 0 1rem;
    place-items: center;
  }

  .cards-container::after {
    grid-column: span 1;
  }

  .timeline::after {
    left: 31px;
  }

  .timeline-item {
    width: 100%;
    padding-left: 70px;
    padding-right: 25px;
  }

  .right {
    left: 0;
  }

  .right::after,
  .left::after {
    left: 15px;
  }
}

/* Media Queries */
@media screen and (max-width: 768px) {
  .timeline::after {
    left: 31px;
  }

  .timeline-item {
    width: 100%;
    padding-left: 70px;
    padding-right: 25px;
  }

  .right {
    left: 0;
  }

  .right::after {
    left: 15px;
  }

  .left::after {
    left: 15px;
  }
}

/* Optional: Add smooth scrolling to page */
html {
  scroll-behavior: smooth;
}

/* Ensure elements are visible on mobile */
@media (max-width: 768px) {
  [data-sr] {
    visibility: visible;
  }
}

/* Ensure elements don't flash before animation */
.sr-only {
  visibility: hidden !important;
}

/* Prevent FOUC (Flash of Unstyled Content) */
.js-loading *,
.js-loading *:before,
.js-loading *:after {
  animation-play-state: paused !important;
}

/* Responsive Media Queries - Grouped by breakpoint */
@media (min-width: 1200px) {
  .cards-container {
    grid-template-columns: repeat(3, 1fr);
  }

  .card:last-child:nth-child(3n-1),
  .card:nth-last-child(2):nth-child(3n-2) {
    .cards-container {
      grid-template-columns: repeat(3, 1fr);
    }

    /* Center last two cards */
    .card:last-child:nth-child(3n-1),
    .card:nth-last-child(2):nth-child(3n-2) {
      transform: translateX(50%);
    }

    .cards-container::after {
      content: '';
      grid-column: span 3;
    }

    .card:last-child:nth-child(3n - 1) {
      grid-column-end: -2;
    }

    .card:last-child:nth-child(3n - 2) {
      grid-column-end: 3;
    }
  }

  @media (min-width: 992px) {
    #tentang .content-container p {
      padding: 1rem 3rem !important;
    }

    .skill-item {
      width: 100%;
      max-width: 800px;
    }
  }

  @media (min-width: 768px) and (max-width: 1199px) {
    .cards-container {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  @media (max-width: 576px) {
    .button {
      margin: 0.2rem auto;
      width: 60%;
      font-size: 0.8rem;
    }

    .hero-section h1 {
      font-size: 36px;
    }

    .hero-section p {
      font-size: 14px;
    }

    .wrapper {
      padding-top: 10px;
      margin: 0 auto;
    }

    .skill-timeline {
      grid-template-columns: 1fr; /* Change to 1 column on mobile */
      gap: 1rem;
    }

    .skill-item {
      margin-bottom: 0.5rem;
    }
  }
}

/* Skills Section */
.skill-timeline {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.skill-item {
  background: rgba(255, 255, 255, 0.9);
  border-left: 4px solid var(--primary-color);
  padding: 1.5rem;
  border-radius: 0 8px 8px 0;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  height: 100%;
}

.skill-item:hover {
  transform: translateX(10px);
  border-left-color: var(--secondary-color);
  background: rgba(255, 255, 255, 1);
}

.skill-title {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.skill-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.since {
  color: var(--dark-color) !important;
  font-size: 0.9rem;
  margin: 0;
  font-weight: 500;
}

.skill-level {
  background: var(--primary-color);
  color: var(--light-color);
  padding: 0.2rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.skill-tech {
  color: var(--dark-color) !important;
  opacity: 0.8;
  margin: 0;
  font-size: 0.9rem;
}

/* Contact Section */
#kontak {
  padding: 5rem 0;
  position: relative;
  overflow: hidden;
}

.contact-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 2rem;
}

.contact-info div {
  background: rgba(255, 255, 255, 0.1);
  padding: 2.5rem;
  border-radius: 20px;
  backdrop-filter: blur(5px);
  transition: transform 0.3s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.contact-info div:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.contact-info h3 {
  color: var(--secondary-color);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.contact-info p {
  color: #666;
  font-size: 1.1rem;
  margin: 0;
}

/* Responsive styles */
@media (max-width: 576px) {
  .skill-timeline {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .skill-item {
    margin-bottom: 0.5rem;
  }

  .contact-info div {
    padding: 1.5rem;
  }
}

.dropdown-menu {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37) !important;
  padding: 0.5rem !important;
}

.dropdown-item {
  color: #000 !important; /* Mengubah warna teks menjadi hitam */
  transition: all 0.3s ease;
  border-radius: 5px;
  padding: 0.5rem 1rem !important;
}

.dropdown-item:hover {
  background: rgba(255, 212, 1, 0.3) !important;
  transform: translateX(5px);
}

.dropdown-item.active,
.dropdown-item[data-active='true'] {
  background: var(--secondary-color) !important;
  color: var(--primary-color) !important;
  font-weight: 600;
}

.nav-item.dropdown .dropdown-menu {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37) !important;
  padding: 0.5rem !important;
  margin-top: 0.5rem !important;
  min-width: 10rem;
}

.nav-item.dropdown .dropdown-item {
  color: #000 !important;
  transition: all 0.3s ease;
  border-radius: 5px;
  padding: 0.5rem 1rem !important;
  font-size: 0.9rem;
}

.nav-item.dropdown .dropdown-item:hover {
  background: rgba(255, 212, 1, 0.8) !important;
  transform: translateX(5px);
}

.nav-item.dropdown .dropdown-item.active,
.nav-item.dropdown .dropdown-item[data-active='true'] {
  background: var(--secondary-color) !important;
  color: var(--primary-color) !important;
  font-weight: 600;
}

::-webkit-scrollbar {
  width: 1em;
}

::-webkit-scrollbar-track {
  background: #0054c9;
}

::-webkit-scrollbar-thumb {
  background: #ffd401;
}

/* Navbar Mobile Styles */
@media (max-width: 991.98px) {
  .navbar-toggler {
    display: block !important;
    border: 2px solid #0054c9;
    padding: 0.5rem;
  }

  .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 212, 1, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
  }
}
