* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #0a0a0a;
  color: #fff;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Optimasi particles container */
#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  z-index: -1;
  /* Optimasi rendering GPU */
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000;
  will-change: transform;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
  /* Optimasi rendering */
  transform: translateZ(0);
}

.header {
  text-align: center;
  padding: 40px 0;
  margin-bottom: 40px;
}

.header h1 {
  font-size: 3.5rem;
  background: linear-gradient(45deg, #ff0000, #ff3333, #ff6666);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(255, 0, 0, 0.5);
  margin-bottom: 10px;
}

.header p {
  color: #ccc;
  font-size: 1.2rem;
}

.nav-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 40px 0;
  flex-wrap: wrap;
}

.btn {
  padding: 15px 30px;
  font-size: 1.1rem;
  font-weight: bold;
  text-decoration: none;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
  /* Optimasi animasi */
  transform: translateZ(0);
  will-change: transform;
}

.btn-primary {
  background: linear-gradient(45deg, #ff0000, #cc0000);
  color: white;
  box-shadow: 0 5px 15px rgba(255, 0, 0, 0.3);
}

.btn-secondary {
  background: linear-gradient(45deg, #333, #000);
  color: white;
  border: 2px solid #ff0000;
  box-shadow: 0 5px 15px rgba(255, 0, 0, 0.2);
}

.btn:hover {
  transform: translateY(-3px) translateZ(0);
  box-shadow: 0 8px 25px rgba(255, 0, 0, 0.4);
}

.btn:active {
  transform: translateY(-1px) translateZ(0);
}

.content-section {
  background: rgba(20, 20, 20, 0.9);
  border-radius: 15px;
  padding: 30px;
  margin: 20px 0;
  border: 1px solid #333;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  /* Optimasi rendering */
  transform: translateZ(0);
  will-change: transform;
}

.section-title {
  color: #ff3333;
  font-size: 2rem;
  margin-bottom: 20px;
  text-align: center;
  border-bottom: 2px solid #ff3333;
  padding-bottom: 10px;
}

/* Table Styles */
.table-container {
  overflow-x: auto;
  margin: 20px 0;
  /* Optimasi scrolling */
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(30, 30, 30, 0.8);
  border-radius: 10px;
  overflow: hidden;
}

.data-table th,
.data-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid #333;
}

.data-table th {
  background: linear-gradient(45deg, #ff0000, #cc0000);
  color: white;
  font-weight: bold;
}

.data-table tr:hover {
  background: rgba(255, 0, 0, 0.1);
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  color: #ff3333;
  font-weight: bold;
}

.form-control {
  width: 100%;
  padding: 12px;
  background: rgba(40, 40, 40, 0.8);
  border: 1px solid #333;
  border-radius: 5px;
  color: white;
  font-size: 1rem;
  /* Optimasi rendering */
  transform: translateZ(0);
}

.form-control:focus {
  outline: none;
  border-color: #ff3333;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

/* Button Groups */
.btn-group {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.btn-success {
  background: linear-gradient(45deg, #00cc00, #009900);
  color: white;
}

.btn-danger {
  background: linear-gradient(45deg, #cc0000, #990000);
  color: white;
}

.btn-warning {
  background: linear-gradient(45deg, #ff9900, #cc7700);
  color: white;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.modal-content {
  background: rgba(30, 30, 30, 0.95);
  margin: 5% auto;
  padding: 30px;
  border-radius: 15px;
  width: 90%;
  max-width: 600px;
  border: 2px solid #ff3333;
  position: relative;
  /* Optimasi animasi */
  transform: translateZ(0);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) translateZ(0);
  }
  to {
    opacity: 1;
    transform: translateY(0) translateZ(0);
  }
}

.close {
  color: #ff3333;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  right: 15px;
  top: 15px;
  transition: color 0.2s ease;
}

.close:hover {
  color: #ff6666;
}

/* Image Preview */
.image-preview {
  max-width: 200px;
  max-height: 200px;
  margin: 10px 0;
  border-radius: 5px;
  border: 1px solid #333;
  /* Optimasi image rendering */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Config Editor */
.config-editor {
  width: 100%;
  min-height: 400px;
  background: #1e1e1e;
  color: #d4d4d4;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  border: 1px solid #333;
  border-radius: 5px;
  padding: 15px;
  resize: vertical;
  line-height: 1.5;
  /* Optimasi rendering */
  transform: translateZ(0);
}

/* Footer */
.footer {
  text-align: center;
  padding: 30px 0;
  margin-top: 50px;
  color: #666;
  border-top: 1px solid #333;
}

/* Responsive Design dengan optimasi performa */
@media (max-width: 768px) {
  .header h1 {
    font-size: 2.5rem;
  }
  
  .nav-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 300px;
  }
  
  .data-table {
    font-size: 0.9rem;
  }
  
  .data-table th,
  .data-table td {
    padding: 10px 8px;
  }
  
  .modal-content {
    width: 95%;
    margin: 10% auto;
    padding: 20px;
  }
  
  .content-section {
    padding: 20px;
    backdrop-filter: blur(5px); /* Kurangi blur di mobile */
  }
}

/* Optimasi untuk perangkat dengan kemampuan terbatas */
@media (max-width: 1024px) and (max-resolution: 1.5dppx) {
  .content-section {
    backdrop-filter: none;
    background: rgba(20, 20, 20, 0.95);
  }
}

/* Reduce motion untuk pengguna yang prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }
  
  .btn:hover {
    transform: none;
  }
  
  .content-section {
    animation: none;
  }
  
  .modal-content {
    animation: none;
  }
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px) translateZ(0);
  }
  to {
    opacity: 1;
    transform: translateY(0) translateZ(0);
  }
}

.content-section {
  animation: fadeIn 0.6s ease-out;
}

/* Loading state untuk particles */
.particles-loading {
  background: linear-gradient(45deg, #0a0a0a, #1a1a1a);
}

/* Optimasi tambahan untuk performa */
@media (hover: none) {
  .btn:hover {
    transform: none;
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.3);
  }
  
  .data-table tr:hover {
    background: transparent;
  }
}