/* ====== VARIABLES & RESET ====== */
:root {
  --primary: #00b4ff;
  --secondary: #ff0040;
  --dark: #000010;
  --card-bg: rgba(0, 0, 10, 0.85);
  --text: #ffffff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  overflow: auto;
}

body {
  background: radial-gradient(circle at top, var(--dark), #000);
  color: var(--primary);
  font-family: 'Rajdhani', sans-serif;
  min-height: 100vh;
  position: relative;
  touch-action: manipulation;
  overflow-x: hidden;
}

/* ====== BACKGROUND ANIMATION ====== */
body::before {
  content: '';
  position: fixed;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(ellipse at center, rgba(0, 128, 255, 0.15), transparent 70%),
    radial-gradient(ellipse at top right, rgba(255, 0, 64, 0.15), transparent 70%);
  animation: rotateBg 20s linear infinite;
  z-index: 0;
}

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

/* ====== LOGIN STYLES ====== */
#loginRoot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
  z-index: 2;
}

.login-card {
  background: var(--card-bg);
  border: 1px solid rgba(0, 128, 255, 0.5);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 40px 28px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  position: relative;
  z-index: 2;
  box-shadow: 0 0 35px rgba(0, 128, 255, 0.4);
  animation: popIn 0.8s ease;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.login-profile {
  margin-bottom: 15px;
}

.login-profile img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  box-shadow: 0 0 20px rgba(0, 128, 255, 0.7);
  object-fit: cover;
}

.login-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 26px;
  letter-spacing: 1px;
  color: var(--primary);
  text-shadow: 0 0 10px var(--primary), 0 0 20px var(--secondary);
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 12px;
  color: var(--secondary);
  text-shadow: 0 0 6px rgba(255, 0, 64, 0.6);
  margin-bottom: 25px;
}

/* ====== DASHBOARD STYLES ====== */
#dashboardRoot {
  display: none;
  position: relative;
  z-index: 2;
  padding-bottom: 70px;
}

.container {
  position: relative;
  z-index: 2;
  max-width: 100%;
  margin: 0;
  padding: 15px;
}

.header {
  text-align: center;
  padding: 10px 0 20px;
}

.logo {
  font-family: 'Orbitron', sans-serif;
  font-size: 24px;
  color: var(--primary);
  text-shadow: 0 0 10px var(--primary);
  margin-bottom: 5px;
}

.subtitle {
  font-size: 12px;
  color: var(--secondary);
  text-shadow: 0 0 5px rgba(255, 0, 64, 0.6);
}

/* ====== CARD COMPONENT ====== */
.card {
  background: var(--card-bg);
  border: 1px solid rgba(0, 128, 255, 0.3);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  text-align: center;
  position: relative;
  z-index: 2;
  margin-bottom: 20px;
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-3px);
}

.profile {
  margin-bottom: 15px;
}

.profile img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  box-shadow: 0 0 15px rgba(0, 128, 255, 0.5);
  transition: transform 0.4s ease;
  object-fit: cover;
}

.profile img:hover {
  transform: scale(1.05);
}

.title {
  font-family: 'Orbitron', sans-serif;
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--primary);
  text-shadow: 0 0 10px var(--primary), 0 0 20px var(--secondary);
  margin-bottom: 20px;
}

/* ====== FORM STYLES ====== */
.form-group {
  position: relative;
  margin-bottom: 15px;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--primary);
}

.form-group i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  transition: color 0.3s ease;
  font-size: 16px;
}

input, select {
  width: 100%;
  padding: 12px 12px 12px 40px;
  border-radius: 8px;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
  font-family: 'Rajdhani', sans-serif;
}

select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300b4ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

input:focus, select:focus {
  box-shadow: 0 0 0 2px rgba(0, 128, 255, 0.5);
}

/* ====== BUTTON STYLES ====== */
button {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  font-weight: bold;
  border: none;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(0, 128, 255, 0.5);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  font-family: 'Rajdhani', sans-serif;
  min-height: 44px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(255, 0, 64, 0.6);
}

.buy-access {
  display: inline-block;
  margin-top: 20px;
  font-size: 13px;
  background: rgba(255, 0, 64, 0.8);
  padding: 10px 20px;
  color: var(--text);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 0 15px rgba(255, 0, 64, 0.6);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.buy-access:hover {
  background: var(--primary);
  box-shadow: 0 0 25px rgba(0, 128, 255, 0.7);
  transform: translateY(-2px);
}

/* ====== BOTTOM MENU ====== */
.bottom-menu {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 10, 0.9);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0, 128, 255, 0.3);
  display: flex;
  z-index: 10;
}

.menu-item {
  flex: 1;
  padding: 12px 5px;
  text-align: center;
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.menu-item i {
  font-size: 18px;
  margin-bottom: 5px;
}

.menu-item:hover {
  color: var(--primary);
}

.menu-item.active {
  color: var(--primary);
  background: rgba(0, 128, 255, 0.1);
}

/* ====== TAB CONTENT ====== */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ====== ACCOUNT INFO ====== */
.account-info {
  text-align: left;
  margin-bottom: 15px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-label {
  color: var(--primary);
  font-weight: bold;
}

.info-value {
  color: var(--text);
}

/* ====== SENDERS LIST ====== */
.senders-list {
  margin: 15px 0;
  text-align: left;
}

.sender-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  margin-bottom: 8px;
}

.sender-info {
  display: flex;
  flex-direction: column;
}

.sender-name {
  color: var(--text);
  font-weight: bold;
}

.sender-number {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.sender-status {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(0, 180, 255, 0.2);
  color: var(--primary);
}

.sender-status.connected {
  background: rgba(0, 255, 0, 0.2);
  color: #00ff00;
}

.sender-status.disconnected {
  background: rgba(255, 0, 0, 0.2);
  color: #ff0000;
}

.delete-sender-btn {
  background: rgba(255, 0, 64, 0.7) !important;
  border: none;
  color: white;
  padding: 5px 8px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
  width: auto !important;
  min-height: auto !important;
}

.delete-sender-btn:hover {
  background: rgba(255, 0, 64, 0.9) !important;
  transform: scale(1.05);
}

/* ====== TOOLS GRID ====== */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-top: 15px;
}

.tool-card {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 1px solid rgba(0, 128, 255, 0.2);
}

.tool-card:hover {
  background: rgba(0, 0, 0, 0.5);
  transform: translateY(-3px);
}

.tool-icon {
  font-size: 24px;
  margin-bottom: 10px;
  color: var(--primary);
}

.tool-name {
  font-size: 14px;
  color: var(--text);
}

/* ====== STATUS BOX ====== */
.status {
  margin-top: 15px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
  text-align: left;
  font-size: 13px;
}

.status h3 {
  margin-bottom: 8px;
  color: var(--primary);
}

.status p {
  color: var(--text);
  margin-bottom: 5px;
}

/* ====== PAIRING OPTIONS ====== */
.pairing-options {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.pairing-option {
  flex: 1;
  padding: 12px;
  border: 2px solid rgba(0, 128, 255, 0.3);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(0, 0, 0, 0.3);
}

.pairing-option:hover {
  background: rgba(0, 128, 255, 0.1);
  border-color: var(--primary);
}

.pairing-option.active {
  background: rgba(0, 128, 255, 0.2);
  border-color: var(--primary);
}

.pairing-option i {
  font-size: 20px;
  margin-bottom: 5px;
  display: block;
}

.qr-container {
  text-align: center;
  margin: 15px 0;
}

#qrCode {
  max-width: 200px;
  margin: 0 auto;
  border-radius: 8px;
  border: 2px solid var(--primary);
}

.pairing-instruction {
  background: rgba(0, 0, 0, 0.3);
  padding: 10px;
  border-radius: 8px;
  margin: 10px 0;
  font-size: 12px;
  text-align: center;
}

.copy-btn {
  background: rgba(0, 180, 255, 0.7) !important;
  width: auto !important;
  padding: 8px 15px !important;
  margin-top: 10px !important;
  min-height: auto !important;
}

.copy-btn:hover {
  background: rgba(0, 180, 255, 0.9) !important;
}

.retry-count {
  color: #ff9900;
  font-size: 11px;
  margin-top: 5px;
}

/* ====== TOAST & LOADING ====== */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, var(--secondary), var(--primary));
  color: white;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 0 15px rgba(0, 128, 255, 0.5);
  opacity: 0;
  animation: fadeInOut 4s ease forwards;
  z-index: 10;
  min-width: 250px;
  text-align: center;
  backdrop-filter: blur(10px);
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translate(-50%, 20px); }
  10% { opacity: 1; transform: translate(-50%, 0); }
  90% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, 20px); }
}

.loading {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 16px;
  z-index: 5;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 14px;
  flex-direction: column;
}

.loading.active {
  display: flex;
}

.spinner {
  border: 3px solid rgba(0, 180, 255, 0.3);
  border-radius: 50%;
  border-top: 3px solid var(--primary);
  width: 25px;
  height: 25px;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ====== PARTICLE BACKGROUND ====== */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}

.particle {
  position: absolute;
  background: rgba(0, 180, 255, 0.3);
  border-radius: 50%;
  animation: float 15s infinite linear;
}

@keyframes float {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

/* ====== RESPONSIVE DESIGN ====== */
@media (max-width: 480px) {
  .container { padding: 10px; }
  .card { padding: 15px; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tool-card { padding: 12px; }
  .tool-icon { font-size: 20px; }
  .tool-name { font-size: 12px; }
}

@media (min-width: 768px) {
  .container { max-width: 600px; margin: 0 auto; }
  .tools-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root { --card-bg: rgba(0, 0, 10, 0.9); }
}

/* ====== CONFIRMATION POPUP ====== */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(5px);
}

.popup-content {
  background: var(--card-bg);
  border: 1px solid var(--primary);
  border-radius: 10px;
  padding: 20px 25px;
  text-align: center;
  color: var(--text);
  width: 90%;
  max-width: 340px;
  box-shadow: 0 0 20px rgba(0, 180, 255, 0.3);
  animation: popIn 0.3s ease;
}

.popup-content p {
  margin-bottom: 20px;
  font-size: 15px;
  line-height: 1.5;
}

.popup-buttons {
  display: flex;
  justify-content: space-around;
  gap: 10px;
}

.popup-buttons button {
  flex: 1;
  padding: 10px;
  border-radius: 6px;
  border: none;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
  font-family: 'Rajdhani', sans-serif;
}

#popupCancel {
  background: rgba(255, 0, 64, 0.7);
  color: white;
}

#popupConfirm {
  background: rgba(0, 180, 255, 0.8);
  color: white;
}

#popupCancel:hover { background: rgba(255, 0, 64, 0.9); }
#popupConfirm:hover { background: rgba(0, 180, 255, 1); }

.attack-entry { background: rgba(0,0,0,0.22); padding: 10px; border-radius: 8px; margin-top:10px; }
.attack-entry-header .entry-status { color: var(--primary); margin-left:6px; font-weight:700; }
.attack-entry .entry-status[innerText="Gagal"] { color: #ff6b6b; }

#deployResult a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
#deployResult a:hover {
  text-decoration: underline;
}

/* Modal styles */
.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 9999; }
.modal-overlay { position:absolute; inset:0; background: rgba(0,0,0,0.55); backdrop-filter: blur(2px); }
.modal-content { position:relative; background: var(--bg, #0b0b0d); color: var(--text, #eaeaea); width: 92%; max-width: 420px; border-radius: 12px; padding: 18px; box-shadow: 0 10px 30px rgba(0,0,0,0.6); z-index: 2; }
.modal-header h2 { margin: 0 0 8px 0; font-size: 18px; }
.modal-body p { margin: 6px 0; line-height: 1.35; }
.modal-footer { display:flex; justify-content:flex-end; margin-top: 12px; }
.btn { background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)); border: none; padding: 8px 12px; border-radius: 8px; cursor: pointer; color: var(--text); }
.btn:active { transform: translateY(1px); }

/* ====== INFO TAB STYLES ====== */
.runtime-display {
  background: rgba(0, 180, 255, 0.1);
  border: 1px solid var(--primary);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  margin-bottom: 20px;
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  color: var(--primary);
  text-shadow: 0 0 8px var(--primary);
}

.runtime-display i {
  margin-right: 8px;
  color: var(--secondary);
}

.info-section {
  display: flex;
  align-items: flex-start;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 15px;
  border: 1px solid rgba(0, 128, 255, 0.2);
  transition: all 0.3s ease;
}

.info-section:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 128, 255, 0.2);
}

.info-icon {
  font-size: 20px;
  color: var(--primary);
  margin-right: 15px;
  min-width: 30px;
  text-align: center;
}

.info-content h3 {
  color: var(--primary);
  font-size: 14px;
  margin-bottom: 8px;
  font-family: 'Orbitron', sans-serif;
}

.info-content p {
  color: var(--text);
  font-size: 13px;
  margin-bottom: 5px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
}

.contact-links a,
.info-content a {
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  padding: 6px 10px;
  background: rgba(0, 180, 255, 0.1);
  border-radius: 6px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.contact-links a:hover,
.info-content a:hover {
  background: rgba(0, 180, 255, 0.2);
  color: var(--primary);
  transform: translateX(5px);
}

.thanks-section {
  background: linear-gradient(135deg, rgba(255, 0, 64, 0.1), rgba(0, 180, 255, 0.1));
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
  border: 1px solid rgba(255, 0, 64, 0.3);
}

.thanks-section h3 {
  text-align: center;
  color: var(--primary);
  margin-bottom: 15px;
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
}

.thanks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.thanks-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.thanks-item:hover {
  transform: scale(1.05);
  background: rgba(0, 0, 0, 0.6);
}

.thanks-item i {
  font-size: 20px;
  color: var(--primary);
  margin-bottom: 8px;
}

.thanks-item span {
  font-size: 11px;
  color: var(--text);
  line-height: 1.3;
}

.footer-info {
  text-align: center;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-info p {
  font-size: 10px;
  color: var(--primary);
  opacity: 0.7;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .thanks-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .info-section {
    flex-direction: column;
    text-align: center;
  }
  
  .info-icon {
    margin-right: 0;
    margin-bottom: 10px;
  }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}