@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/*==================== VARIABLES ====================*/
:root {
  --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  --card-bg: rgba(255, 255, 255, 0.9);
  --text-gradient: linear-gradient(to right, #3498db, #9b59b6);
  --location-btn: linear-gradient(45deg, #3498db, #2ecc71);
  --social-toggle: linear-gradient(45deg, #9b59b6, #3498db);
  --username-bg: linear-gradient(45deg, #9b59b6, #3498db);
  --play-btn: linear-gradient(45deg, #3498db, #9b59b6);
  --text-color: #2c3e50;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --toggle-bg: linear-gradient(45deg, #f5f7fa, #c3cfe2);
  --toggle-icon: #f39c12;

  /* New variables for skills and github */
  --skill-bg-default: #3498db;
  --skill-text-default: white;
  --github-btn-bg: #24292e;
  --github-btn-text: white;
  --contact-toggle-bg: linear-gradient(45deg, #e74c3c, #f39c12);
  --contact-submit-bg: linear-gradient(45deg, #2ecc71, #3498db);
}

.dark-mode {
  --bg-gradient: linear-gradient(135deg, #1a1a1a 0%, #3d3d3d 100%);
  --card-bg: rgba(30, 30, 30, 0.9);
  --text-gradient: linear-gradient(to right, #8e44ad, #3498db);
  --location-btn: linear-gradient(45deg, #8e44ad, #27ae60);
  --social-toggle: linear-gradient(45deg, #3498db, #8e44ad);
  --username-bg: linear-gradient(45deg, #3498db, #8e44ad);
  --play-btn: linear-gradient(45deg, #8e44ad, #3498db);
  --text-color: #ecf0f1;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --toggle-bg: linear-gradient(45deg, #1a1a1a, #3d3d3d);
  --toggle-icon: #f1c40f;

  /* Dark mode variables for skills and github */
  --skill-bg-default: #555;
  --skill-text-default: #ecf0f1;
  --github-btn-bg: #4a5568;
  --github-btn-text: #f7fafc;
  --contact-toggle-bg: linear-gradient(45deg, #c0392b, #e67e22);
  --contact-submit-bg: linear-gradient(45deg, #27ae60, #2980b9);
}

/*==================== BASE ====================*/
body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg-gradient);
  min-height: 100vh;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  transition: background 0.5s ease;
  position: relative;
}

.profile-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: 0 15px 35px var(--shadow-color);
  width: 100%;
  max-width: 400px;
  padding: 30px;
  text-align: center;
  transition: transform 0.3s ease, background 0.5s ease;
  position: relative;
}

.profile-card:hover {
  transform: translateY(-5px);
}

/*==================== MODE TOGGLE ====================*/
.mode-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--toggle-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px var(--shadow-color);
  transition: all 0.3s ease;
  z-index: 10;
}

.mode-toggle:hover {
  transform: scale(1.1) rotate(15deg);
}

.mode-toggle i {
  color: var(--toggle-icon);
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.mode-toggle:hover i {
  transform: scale(1.2);
}

/*==================== Game ====================*/
.game-button {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--game-btn-bg, #4CAF50);
  color: var(--game-btn-text, white);
  padding: 10px 20px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  z-index: 10;
}
.game-button:hover {
  background-color: var(--game-btn-hover, #3e8e41);
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
.dark-mode .game-button {
  --game-btn-bg: #2d3748;
  --game-btn-hover: #4a5568;
  --game-btn-text: #f7fafc;
}
/*==================== PROFILE ====================*/
.profile-img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--card-bg);
  box-shadow: 0 5px 15px var(--shadow-color);
  margin: 0 auto 15px;
  transition: all 0.3s ease;
}

.profile-img:hover {
  transform: scale(1.05);
}

.name {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 10px 0;
  background: var(--text-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/*==================== BUTTONS ====================*/
.location-btn,
.social-toggle {
  padding: 10px 20px;
  border-radius: 50px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
  border: none;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.location-btn {
  background: var(--location-btn);
}

.location-btn:hover,
.social-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.social-container {
  margin: 25px 0;
}

.social-toggle {
  background: var(--social-toggle);
  margin-bottom: 15px;
}

/*==================== SOCIAL ICONS ====================*/
.social-links {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.social-links.show {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}
.social-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.social-icon::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.social-icon:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.social-icon:hover::before {
  left: 100%;
}

.social-tooltip {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.social-icon:hover .social-tooltip {
  opacity: 1;
  bottom: -30px;
}

.whatsapp { background-color: #25D366; }
.instagram { background: linear-gradient(45deg, #405DE6, #5851DB, #833AB4, #C13584, #E1306C, #FD1D1D); }
.tiktok { background-color: #000000; }
.facebook { background-color: #3b5998; }
.twitter { background-color: #1DA1F2; }
.telegram { background-color: #0088cc; }

/*==================== AUDIO PLAYER ====================*/
.audio-player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50px;
  padding: 8px 15px;
  margin: 20px auto;
  max-width: 300px;
  box-shadow: 0 4px 10px var(--shadow-color);
}

.play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--play-btn);
  color: white;
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.play-btn:hover {
  transform: scale(1.1);
}

.track-info {
  flex-grow: 1;
  margin-left: 15px;
  text-align: left;
}

.track-title {
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.95rem;
}

.track-artist {
  font-size: 0.8rem;
  color: #7f8c8d;
  opacity: 0.8;
}

.spotify-icon {
  margin-left: 10px;
  color: #1DB954;
  font-size: 1.8rem;
  transition: transform 0.3s ease, color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.spotify-icon:hover {
  transform: scale(1.2);
  color: #1ed760;
}

.spotify-hint {
  display: none;
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 1px;
  font-family: 'Poppins', sans-serif;
  color: white;
  background-color: rgba(29, 185, 84, 0.9);
  padding: 5px 8px;
  border-radius: 12px;
  position: absolute;
  white-space: nowrap;
  transform: translateY(-40px) translateX(-25px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.spotify-icon:hover .spotify-hint {
  display: block;
  opacity: 1;
  transform: translateY(-45px) translateX(-25px);
}

/*==================== USERNAME ====================*/
.username-container {
  margin-top: 10px;
  position: relative;
}

.username {
  display: inline-block;
  background: var(--username-bg);
  color: white;
  padding: 10px 20px;
  border-radius: 50px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
  border: none;
}

.username:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(155, 89, 182, 0.4);
}

.username-info {
  display: none;
  background: var(--card-bg);
  color: var(--text-color);
  padding: 10px 15px;
  border-radius: 10px;
  margin-top: 10px;
  box-shadow: 0 5px 15px var(--shadow-color);
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.username-info.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}
.username-info p {
  margin: 0;
  margin-bottom: 15px; /* Add some space below the paragraph */
}
.username acronym {
  text-decoration: none;
  background: none;
}

/*==================== SECTION HEADINGS ====================*/
.section-heading {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-color);
  margin-top: 25px;
  margin-bottom: 15px;
  background: var(--text-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/*==================== SKILLS ====================*/
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.skill-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 15px;
  background-color: var(--skill-bg-default);
  color: var(--skill-text-default);
  border-radius: 50px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
  opacity: 0; /* Initial state for animation */
  transform: translateY(10px); /* Initial state for animation */
  animation: fadeInMove 0.5s ease forwards; /* Apply animation */
}

.skill-badge:nth-child(1) { animation-delay: 0.1s; }
.skill-badge:nth-child(2) { animation-delay: 0.2s; }
.skill-badge:nth-child(3) { animation-delay: 0.3s; }
.skill-badge:nth-child(4) { animation-delay: 0.4s; }

.skill-badge i {
  margin-right: 8px;
  font-size: 1.1rem;
}

.skill-badge:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Specific skill colors */
.skill1 { background-color: #e34c26; } /* HTML */
.skill2 { background-color: #264de4; } /* CSS */
.skill3 { background-color: #f0db4f; color: #333; } /* JS */
.skill4 { background-color: #5382a1; } /* Java */

/* Dark mode adjustments for specific skill colors */
.dark-mode .skill1 { background-color: #d64520; }
.dark-mode .skill2 { background-color: #1e3cb8; }
.dark-mode .skill3 { background-color: #e0c820; color: #1a1a1a; }
.dark-mode .skill4 { background-color: #4a728f; }


/*==================== GITHUB BUTTON ====================*/
.github-section {
    margin-top: 25px;
    text-align: center;
}

.github-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex; /* Ubah dari inline-flex ke block */
    margin: 0 auto;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0; /* Increased padding for better look */
    background-color: var(--github-btn-bg);
    color: var(--github-btn-text);
    font-size: 1rem;
    text-decoration: none;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.github-btn i {
    margin: 0;
    font-size: 1.2rem;
}

.github-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%; /* Start from left */
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.15); /* Slightly more visible overlay */
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); /* Smooth cubic-bezier transition */
    z-index: -1;
}

.github-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.github-btn:hover::before {
    left: 0; /* Slide to cover */
}

/* Dark mode adjustments */
.dark-mode .section-heading {
    color: #9b59b6; /* Adjust heading color for dark mode */
}

.dark-mode .skill-badge {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.dark-mode .github-btn {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/*==================== CONTACT FORM ====================*/
.contact-container {
  margin-top: 25px;
}

.contact-toggle {
  padding: 10px 20px;
  border-radius: 50px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
  border: none;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
  background: var(--contact-toggle-bg);
  margin-bottom: 15px;
}

.contact-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.contact-form {
  display: none;
  background: var(--card-bg);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 5px 15px var(--shadow-color);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease; /* Smooth transition */
}

.contact-form.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.contact-form form {
  display: flex;
  flex-direction: column;
  gap: 12px; /* Increased gap for better spacing */
}

.contact-form input,
.contact-form textarea {
  padding: 12px; /* Increased padding */
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem; /* Slightly larger font */
  background-color: var(--card-bg);
  color: var(--text-color);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #3498db; /* A more distinct focus color */
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3); /* Softer shadow */
}

.contact-form button[type="submit"] {
  padding: 12px 25px; /* Increased padding */
  border-radius: 50px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
  border: none;
  background: var(--contact-submit-bg);
  box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
  margin-top: 15px; /* Increased margin */
}

.contact-form button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

/* Dark mode adjustments for contact form */
.dark-mode .contact-form input,
.dark-mode .contact-form textarea {
  border: 1px solid #555;
  background-color: rgba(40, 40, 40, 0.9);
  color: var(--text-color);
}

.dark-mode .contact-form input:focus,
.dark-mode .contact-form textarea:focus {
  border-color: #8e44ad;
  box-shadow: 0 0 0 3px rgba(142, 68, 173, 0.3);
}


/*==================== ANIMATIONS ====================*/
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Custom fadeInMove for elements */
@keyframes fadeInMove {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/*==================== RESPONSIVE ====================*/
@media (max-width: 480px) {
  .mode-toggle {
    top: 10px; /* Sesuaikan posisi */
    left: 10px;
    right: auto; /* Hapus right agar tidak konflik */
  }
  .game-button {
    top: 10px; /* Sesuaikan posisi */
    right: 10px;
    left: auto; /* Hapus left agar tidak konflik */
  }
  .profile-card {
    padding: 15px;
  }

  .profile-img {
    width: 120px;
    height: 120px;
  }

  .name {
    font-size: 1.5rem;
  }
  .audio-player {
    max-width: 90%; /* Sesuaikan lebar audio player */
    padding: 6px 10px;
  }
  .track-title {
    font-size: 0.9rem;
  }
  .track-artist {
    font-size: 0.75rem;
  }
  .social-icon {
    width: 45px; /* Sedikit kurangi ukuran ikon sosial */
    height: 45px;
    font-size: 18px;
  }
  .username-info {
    font-size: 0.85rem;
  }
  .social-links {
    flex-wrap: wrap;
  }
  .skills-grid {
    gap: 8px; /* Reduce gap on small screens */
  }
  .skill-badge {
    font-size: 0.85rem; /* Smaller font for skills */
    padding: 7px 12px;
  }
  .github-btn {
    padding: 10px 20px; /* Adjust padding for github button */
    font-size: 0.9rem;
  }
  .contact-form input,
  .contact-form textarea {
    font-size: 0.9rem;
    padding: 10px;
  }
  .contact-form button[type="submit"] {
    font-size: 0.95rem;
    padding: 10px 20px;
  }
}
