/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1a2a6c, #b21f1f, #1a2a6c);
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Background Particles */
#particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 5%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.logo {
  font-size: 1.7rem;
  font-weight: 700;
  text-decoration: none;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span {
  color: #ffcc00;
}

.navbar {
  display: flex;
  gap: 2rem;
}

.navbar a {
  color: #ddd;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.navbar a:hover,
.navbar a.active {
  color: #ffcc00;
}

.menu-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Main Section */
.section {
  padding: 4rem 5%;
  text-align: center;
}

.center-section {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  padding: 2rem 5%;
  flex-direction: column;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.section-title span {
  color: #ffcc00;
}

/* --- Add Card (Index) - Fixed Position & Responsive for Mobile --- */
.add-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  transition: transform 0.3s ease;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5; /* <-- GANTI JADI 1000 */
  background: linear-gradient(135deg, rgba(255, 0, 0, 0.2), rgba(100, 0, 255, 0.2));
}

.add-card:hover {
  transform: translate(-50%, -50%) scale(1.02);
}

.add-icon {
  font-size: 2.5rem;
  color: #ffcc00;
  margin-bottom: 1rem;
  background: #ffcc00;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

.add-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: white;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 300px;
}

#tagInput {
  padding: 0.8rem 1.2rem;
  border-radius: 50px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 1rem;
  outline: none;
  transition: background 0.3s;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}

#tagInput::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

#tagInput:focus {
  background: rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 0 8px rgba(255, 204, 0, 0.3);
}

.btn {
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  border: none;
  background: #ffcc00;
  color: #1a2a6c;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
  box-shadow: 0 4px 10px rgba(255, 204, 0, 0.3);
}

.btn:hover {
  background: #ff9800;
  transform: translateY(-2px);
}

/* --- Mobile Responsif --- */
@media (max-width: 768px) {
  .add-card {
    padding: 1.2rem;
    max-width: 90%;
    transform: translate(-50%, -50%) scale(0.95);
    max-height: 80vh;
    overflow-y: auto;
  }

  .add-card:hover {
    transform: translate(-50%, -50%) scale(1);
  }

  .add-icon {
    font-size: 2rem;
    width: 45px;
    height: 45px;
  }

  .add-card h3 {
    font-size: 1.3rem;
  }

  .input-group {
    max-width: 90%;
  }

  #tagInput {
    font-size: 0.95rem;
    padding: 0.7rem 1rem;
  }

  .btn {
    padding: 0.7rem 1.2rem;
    font-size: 0.95rem;
  }

  /* Perbaiki body agar tidak scroll horizontal */
  body {
    overflow-x: hidden;
  }
}

/* Tags List (Tags.html) */
.tags-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.tag {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 204, 0, 0.15);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.95rem;
  gap: 0.5rem;
  transition: all 0.3s ease;
  animation: fadeIn 0.3s ease;
  border: 1px solid rgba(255, 204, 0, 0.2);
  position: relative;
}

.tag:hover {
  background: rgba(255, 204, 0, 0.25);
  transform: scale(1.05);
  border-color: rgba(255, 204, 0, 0.4);
}

.tag span {
  color: #fff;
  word-break: break-all;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tombol Edit & Delete */
.edit-btn,
.delete-btn {
  background: rgba(255, 255, 255, 0.1);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.edit-btn i,
.delete-btn i {
  font-size: 0.75rem;
  color: #ffcc00;
}

.edit-btn:hover {
  background: rgba(255, 204, 0, 0.3);
  color: #fff;
  transform: scale(1.1);
}

.delete-btn:hover {
  background: rgba(255, 82, 82, 0.3);
  color: #fff;
  transform: scale(1.1);
}

/* Input saat edit */
.tag input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 204, 0, 0.5);
  padding: 0.3rem 0.6rem;
  border-radius: 20px;
  color: white;
  font-size: 0.9rem;
  outline: none;
  width: 100%;
  max-width: 120px;
}

.tag input:focus {
  border-color: #ffcc00;
  background: rgba(255, 255, 255, 0.2);
}

/* Custom Alert Modal */
.custom-alert {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.custom-alert.show {
  opacity: 1;
  visibility: visible;
}

.custom-alert.hidden {
  display: none;
}

.alert-content {
  background: rgba(30, 30, 40, 0.95);
  padding: 2rem;
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.custom-alert.show .alert-content {
  transform: scale(1);
}

.alert-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.alert-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.alert-btn {
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.alert-btn.cancel {
  background: #555;
  color: white;
}

.alert-btn.cancel:hover {
  background: #777;
}

.alert-btn.confirm {
  background: #ff5252;
  color: white;
}

.alert-btn.confirm:hover {
  background: #e04040;
}

/* Success Alert */
#successAlert .alert-btn.confirm {
  background: #4caf50;
}

#successAlert .alert-btn.confirm:hover {
  background: #45a049;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .navbar {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .section-title {
    font-size: 2rem;
  }

  .center-section {
    min-height: auto;
    padding: 3rem 5%;
  }

  .add-card {
    max-width: 90%;
    padding: 1.5rem;
  }

  .tags-list {
    gap: 0.75rem;
  }
}

/* Efek Glitch RGB untuk Logo */
.logo {
  font-size: 1.7rem;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  color: #fff;
  text-shadow: 0 0 3px rgba(0,0,0,0.5);
  overflow: visible;
}

.logo::before,
.logo::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: transparent;
  color: inherit;
  pointer-events: none;
}

.logo::before {
  color: red;
  clip-path: polygon(0 0, 100% 0, 100% 30%, 0 30%);
  animation: glitchRed 2.5s infinite alternate-reverse;
  opacity: 0.8;
  filter: brightness(1.2);
}

.logo::after {
  color: blue;
  clip-path: polygon(0 70%, 100% 70%, 100% 100%, 0 100%);
  animation: glitchBlue 2.5s infinite alternate-reverse;
  opacity: 0.8;
  filter: brightness(1.2);
}

.logo span {
  color: inherit;
}

/* Efek Glitch untuk Versi */
.version {
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  color: #fff;
  text-shadow: 0 0 3px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  display: inline-block;
  position: relative;
  overflow: visible;
}

.version::before,
.version::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: transparent;
  color: inherit;
  pointer-events: none;
}

.version::before {
  color: #ff00ff; /* Magenta */
  clip-path: polygon(0 0, 100% 0, 100% 40%, 0 40%);
  animation: glitchMagenta 2s infinite alternate-reverse;
  opacity: 0.8;
  filter: brightness(1.2);
}

.version::after {
  color: #00ffff; /* Cyan */
  clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%);
  animation: glitchCyan 2s infinite alternate-reverse;
  opacity: 0.8;
  filter: brightness(1.2);
}

/* Animasi Glitch Lebih Ekstrem */
@keyframes glitchRed {
  0% { transform: translateX(0); opacity: 0.8; }
  10% { transform: translateX(-3px) rotate(0.5deg); opacity: 0.9; }
  20% { transform: translateX(2px) rotate(-0.5deg); opacity: 0.7; }
  30% { transform: translateX(-2px) rotate(0.3deg); opacity: 0.8; }
  40% { transform: translateX(3px) rotate(-0.3deg); opacity: 0.9; }
  50% { transform: translateX(-1px) rotate(0.2deg); opacity: 0.7; }
  60% { transform: translateX(2px) rotate(-0.2deg); opacity: 0.8; }
  70% { transform: translateX(-2px) rotate(0.1deg); opacity: 0.9; }
  80% { transform: translateX(1px) rotate(-0.1deg); opacity: 0.7; }
  90% { transform: translateX(-1px) rotate(0.1deg); opacity: 0.8; }
  100% { transform: translateX(0); opacity: 0.8; }
}

@keyframes glitchBlue {
  0% { transform: translateX(0); opacity: 0.8; }
  10% { transform: translateX(3px) rotate(-0.5deg); opacity: 0.9; }
  20% { transform: translateX(-2px) rotate(0.5deg); opacity: 0.7; }
  30% { transform: translateX(2px) rotate(-0.3deg); opacity: 0.8; }
  40% { transform: translateX(-3px) rotate(0.3deg); opacity: 0.9; }
  50% { transform: translateX(1px) rotate(-0.2deg); opacity: 0.7; }
  60% { transform: translateX(-2px) rotate(0.2deg); opacity: 0.8; }
  70% { transform: translateX(2px) rotate(-0.1deg); opacity: 0.9; }
  80% { transform: translateX(-1px) rotate(0.1deg); opacity: 0.7; }
  90% { transform: translateX(1px) rotate(-0.1deg); opacity: 0.8; }
  100% { transform: translateX(0); opacity: 0.8; }
}

@keyframes glitchMagenta {
  0% { transform: translateX(0); opacity: 0.8; }
  15% { transform: translateX(-2px) rotate(0.2deg); opacity: 0.9; }
  30% { transform: translateX(1px) rotate(-0.2deg); opacity: 0.7; }
  45% { transform: translateX(-1px) rotate(0.1deg); opacity: 0.8; }
  60% { transform: translateX(2px) rotate(-0.1deg); opacity: 0.9; }
  75% { transform: translateX(-1px) rotate(0.1deg); opacity: 0.7; }
  90% { transform: translateX(1px) rotate(-0.1deg); opacity: 0.8; }
  100% { transform: translateX(0); opacity: 0.8; }
}

@keyframes glitchCyan {
  0% { transform: translateX(0); opacity: 0.8; }
  15% { transform: translateX(2px) rotate(-0.2deg); opacity: 0.9; }
  30% { transform: translateX(-1px) rotate(0.2deg); opacity: 0.7; }
  45% { transform: translateX(1px) rotate(-0.1deg); opacity: 0.8; }
  60% { transform: translateX(-2px) rotate(0.1deg); opacity: 0.9; }
  75% { transform: translateX(1px) rotate(-0.1deg); opacity: 0.7; }
  90% { transform: translateX(-1px) rotate(0.1deg); opacity: 0.8; }
  100% { transform: translateX(0); opacity: 0.8; }
}

/* Efek Flicker Tambahan */
.logo,
.version {
  animation: flicker 4s infinite;
}

@keyframes flicker {
  0% { opacity: 1; }
  90% { opacity: 1; }
  91% { opacity: 0.85; }
  92% { opacity: 1; }
  93% { opacity: 0.8; }
  94% { opacity: 1; }
  95% { opacity: 0.85; }
  96% { opacity: 1; }
  97% { opacity: 0.9; }
  98% { opacity: 1; }
  99% { opacity: 0.95; }
  100% { opacity: 1; }
}

/* Efek Noise Tambahan */
.logo::before,
.logo::after,
.version::before,
.version::after {
  animation-timing-function: steps(1);
}

.logo {
  cursor: default;
}

/* --- About Page Styles --- */
.about-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 600px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-align: left;
  color: #fff;
}

.about-card h2.section-title {
  text-align: center;
  margin-bottom: 1.5rem;
}

.about-content h3 {
  font-size: 1.3rem;
  color: #ffcc00;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.about-content p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.about-content ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.about-content li {
  margin-bottom: 0.5rem;
}

.about-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  font-size: 0.9rem;
  color: #aaa;
}

/* Responsive */
@media (max-width: 768px) {
  .about-card {
    padding: 1.5rem;
  }

  .about-content h3 {
    font-size: 1.2rem;
  }
}

/* --- Menu Toggle Baru - Modern & Glow Effect --- */
.menu-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #fff;
  background: #ffcc00;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 1000; /* <-- PASTIKAN TETAP 1003 */
  box-shadow: 0 0 20px rgba(255, 204, 0, 0.8);
  animation: pulse 2s infinite;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.menu-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 0 30px rgba(255, 204, 0, 1);
}

.menu-toggle.active {
  background: #ff9800;
  color: #1a2a6c;
  box-shadow: 0 0 30px rgba(255, 152, 0, 1);
}

@keyframes pulse {
  0% { box-shadow: 0 0 20px rgba(255, 204, 0, 0.8); }
  50% { box-shadow: 0 0 40px rgba(255, 204, 0, 1); }
  100% { box-shadow: 0 0 20px rgba(255, 204, 0, 0.8); }
}
/* --- Navbar Mobile - Fixed & Above All --- */
.navbar {
  display: flex;
  gap: 2rem;
}

.navbar a {
  color: #ddd;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.navbar a:hover,
.navbar a.active {
  color: #ffcc00;
}

/* --- Navbar Mobile - Slide from Right --- */
@media (max-width: 768px) {
  .navbar {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 80%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem 1.5rem;
    transition: right 0.3s ease;
    z-index: 1002; /* <-- GANTI JADI 1002 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow-y: auto;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
  }

  .navbar.active {
    right: 0;
  }

  .navbar a {
    font-size: 1.2rem;
    display: block;
    margin-bottom: 1.5rem;
    width: 100%;
    text-align: center;
    padding: 0.8rem;
    border-radius: 10px;
    transition: background 0.2s;
  }

  .navbar a:hover {
    background: rgba(255, 204, 0, 0.2);
  }

  .menu-toggle {
    display: block;
  }
}