/* Transaction Modal Visibility Fix */
/* Created by Cuserob - Visual Creation & Interface Design 🎨✨ */

/* ========================================
   HIDE TRANSACTION MODAL BY DEFAULT
   ======================================== */

/* Ensure modal is hidden unless explicitly shown */
#transaction-modal,
.transaction-modal,
.modal {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  transition: all 0.3s ease;
  z-index: 10000;
}

/* Show modal only when active class is present */
#transaction-modal.active,
.transaction-modal.active,
.modal.active {
  display: flex !important;
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
  animation: modal-fade-in 0.3s ease-out;
}

/* Modal backdrop */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-backdrop.active {
  display: block;
  opacity: 1;
}

/* Enhanced modal content styling */
.modal-content {
  background: rgba(20, 0, 40, 0.95);
  border: 2px solid #ff00ff;
  border-radius: 20px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 0 40px rgba(255, 0, 255, 0.6);
  position: relative;
}

/* Modal header kawaii style */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px dashed rgba(0, 255, 255, 0.3);
}

.modal-title {
  font-size: 1.5rem;
  background: linear-gradient(135deg, #00ffff, #ff00ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

/* Close button styling */
.close-modal,
.close-btn {
  background: transparent;
  border: 2px solid #ff00ff;
  color: #ff00ff;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  line-height: 1;
}

.close-modal:hover,
.close-btn:hover {
  background: #ff00ff;
  color: #fff;
  transform: rotate(180deg);
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.8);
}

/* Transaction status container */
.transaction-status-container {
  text-align: center;
  padding: 2rem 0;
}

/* Animated loader */
.transaction-loader {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  border: 3px solid rgba(0, 255, 255, 0.3);
  border-top: 3px solid #00ffff;
  border-radius: 50%;
  animation: loader-spin 1s linear infinite;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

/* Status message */
#transaction-status-message {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  margin-top: 1rem;
}

/* Status types */
.status-success #transaction-status-message {
  color: #00ff88;
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.8);
}

.status-error #transaction-status-message {
  color: #ff0066;
  text-shadow: 0 0 10px rgba(255, 0, 102, 0.8);
}

/* Modal footer */
.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px dashed rgba(0, 255, 255, 0.3);
}

/* Etherscan link kawaii style */
.etherscan-link {
  background: linear-gradient(135deg, #00ffff, #0099ff);
  color: #000;
  padding: 0.6rem 1.2rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 255, 255, 0.4);
}

.etherscan-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(0, 255, 255, 0.6);
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes modal-fade-in {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

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

/* ========================================
   RESPONSIVE FIXES
   ======================================== */

@media (max-width: 768px) {
  .modal-content {
    padding: 1.5rem;
    width: 95%;
  }
  
  .modal-title {
    font-size: 1.2rem;
  }
  
  .transaction-loader {
    width: 60px;
    height: 60px;
  }
}

/* ========================================
   FORCE HIDE ON PAGE LOAD
   ======================================== */

/* Extra specificity to ensure hiding */
body #transaction-modal:not(.active),
body .transaction-modal:not(.active),
body .modal:not(.active) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}