/* Modal Overlay Effect */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 50;
  display: none;
}

/* First Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 450px;
  height: auto;
  border-radius: 15px;
  padding: 20px;
  background-color: #1f1f1f;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}

.modal-content {
  background-color: #666670;
  margin: auto;
  padding: 10px;
  width: 100%;
  box-shadow: 0px 4px 8px rgba(0,0,0,0.4);
  border-radius: 8px;
  margin-bottom: 12px;
}

.close-section, .close-section-2 {
  display: flex;
  align-items: center;
}

.close-button, .second-close-button {
  padding: 8px 16px;
  background-color: #3a3b3a;
  border-radius: 10px;
  color: #adb3ad;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  transition: background 0.2s ease;
}

.close-button:hover, .second-close-button:hover {
  background-color: #4a4b4a;
  color: white;
}

.flex-section-A {
  display: flex;
  padding: 16px 0;
  background-color: #242222;
  align-items: flex-start;
  justify-content: flex-start;
  border-radius: 10px;
  margin: 8px 0;
}

.connection-box {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  margin: 10px;
  border: 2px solid #09c228;
  border-radius: 20px;
  justify-content: space-between;
  padding: 6px 12px;
}

.modal-connection-status {
  color: #09c228;
  padding: 10px;
  text-align: left;
  flex-grow: 0;
  font-size: 14px;
}

.flex-section {
  display: flex;
  justify-content: center;
  margin-top: 10px;
  padding: 10px;
  background-color: #4a4a53;
  border-radius: 15px;
}

.connection-box-left {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: center;
  gap: 12px;
}

.text-content {
  flex: 5;
  padding-left: 15px;
}

.modal-connection-status-2a {
  font-size: 15px;
  font-weight: 500;
  color: white;
  margin-bottom: 4px;
}

.modal-connection-status-2b {
  color: #b3a9a9;
  font-size: 12px;
  font-weight: 400;
}

.logo-content { flex: 1; }

.modal-logo, .modal-logo-2 {
  border-radius: 20px;
  width: 55px;
  height: 55px;
  object-fit: contain;
}

/* Error state */
.modal-connection-status-3a {
  flex: 1;
  text-align: center;
  font-size: 15px;
  color: #df2911;
  padding: 8px;
}

.modal-connect-button-3b {
  margin: 10px;
  background: linear-gradient(135deg, #08c427 0%, #06a020 50%, #047a18 100%);
  border: none;
  border-radius: 15px;
  flex: 1;
  color: white;
  font-weight: 500;
  cursor: pointer;
  padding: 10px 14px;
  font-size: 13px;
  font-family: 'Poppins', sans-serif;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(8, 196, 39, 0.3);
}

.modal-connect-button-3b:hover {
  background: linear-gradient(135deg, #06a020 0%, #047a18 50%, #035412 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(8, 196, 39, 0.4);
}

/* Second Modal (Import Form) */
.third-modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 450px;
  height: auto;
  background-color: #363232;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

.third-modal-content {
  background-color: #666670;
  margin: auto;
  padding: 10px;
  width: 100%;
  box-shadow: 0px 4px 8px rgba(0,0,0,0.4);
  border-radius: 8px;
  margin-bottom: 12px;
}

.flex-section-B {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background-color: #333;
  border-radius: 10px;
  margin-bottom: 8px;
}

.text-content-2 { flex: 2; }

.newModalheader {
  color: #fcf8f8;
  font-size: 15px;
  text-align: left;
  font-weight: bold;
  padding-top: 8px;
}

.second-close {
  color: #aaa;
  float: right;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  margin-right: 10px;
}

.second-close:hover { color: white; }

/* Form tabs */
.form-head {
  display: flex;
  justify-content: center;
  height: 44px;
  flex-direction: row;
  background-color: #333;
  align-items: center;
  border-radius: 8px;
  margin-bottom: 4px;
}

.form-header {
  cursor: pointer;
  flex: 1;
  color: #aaa;
  text-align: center;
  padding: 10px;
  transition: color 0.3s ease;
  font-weight: 400;
  font-size: 13px;
  font-family: 'Poppins', sans-serif;
}

.form-header:hover { color: white; }

.form-header.active {
  color: rgb(76, 201, 38);
  font-size: 14px;
  font-weight: 700;
}

/* Form section */
.form-section {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #333;
}

.form-slider {
  display: none;
  width: 100%;
  opacity: 1;
  justify-content: center;
}

.form-slider.active { display: block; opacity: 1; }

.forms {
  width: 100%;
  padding: 10px;
  text-align: center;
  background-color: #333;
}

textarea {
  width: 90%;
  height: 130px;
  box-sizing: border-box;
  border: 2px solid rgb(175, 159, 159);
  border-radius: 10px;
  background-color: #444;
  resize: none;
  color: rgb(234, 240, 240);
  padding: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
}

textarea:focus {
  outline: none;
  border-color: #62d3ff;
  background-color: #3a3a3a;
}

#key { height: 55px; }

input[type=password] {
  width: 85%;
  height: 45px;
  margin: 10px auto;
  display: block;
  box-sizing: border-box;
  border: 2px solid rgb(175, 159, 159);
  border-radius: 10px;
  background-color: #444;
  color: aliceblue;
  padding-left: 12px;
  font-family: 'Poppins', sans-serif;
}

input[type=password]:focus {
  outline: none;
  border-color: #62d3ff;
}

.form-note-1, .form-note-2, .form-note-3 {
  font-size: 12px;
  text-align: center;
  padding: 8px 20px 16px 20px;
  background-color: #333;
  border-radius: 0 0 8px 8px;
  line-height: 1.4;
}

.form-note-1 { color: #09c228; }
.form-note-2 { color: #d1bd07; }
.form-note-3 { color: #09c228; }

/* Connect button */
.form-button-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #333;
  padding: 12px;
  border-radius: 0 0 10px 10px;
}

.form-button {
  width: 80%;
  background: linear-gradient(135deg, #467e94 0%, #3a6b7f 50%, #2d5a6a 100%);
  border: none;
  border-radius: 15px;
  padding: 12px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(70, 126, 148, 0.3);
}

.form-button::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.form-button:hover {
  background: linear-gradient(135deg, #3a6b7f 0%, #2d5a6a 50%, #1f4958 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(70, 126, 148, 0.4);
}

.form-button:hover::before { left: 100%; }

.form-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Custom Alert */
.custom-alert {
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: transparent;
  pointer-events: none;
}

.custom-alert-content {
  background-color: #272424;
  margin: 12% auto;
  padding: 16px;
  border-radius: 8px;
  width: 50%;
  text-align: center;
  border: 1px solid #444;
  pointer-events: auto;
}

.custom-alert p {
  font-size: 13px;
  color: #f5f0f0;
  margin-bottom: 8px;
}

.hidden { display: none !important; }

.progress-container {
  width: 100%;
  background-color: #333;
  border-radius: 4px;
  margin-top: 8px;
}

.progress-bar {
  width: 0%;
  height: 8px;
  background-color: #10dd10;
  border-radius: 4px;
  transition: width 0.1s ease;
}

/* Spinner */
.fa-spinner { color: rgb(44, 185, 16); margin-right: 8px; }

@media (max-width: 768px) {
  .modal, .third-modal { width: 85%; }
  .custom-alert-content { width: 75%; }
}

@media (max-width: 576px) {
  .modal, .third-modal { width: 95%; }
  .custom-alert-content { width: 88%; }
  .newModalheader { font-size: 13px; }
}
