/* Floating Action Button */
.sim-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: bold;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  box-shadow: 0 4px 15px rgba(234, 88, 12, 0.4);
  cursor: pointer;
  z-index: 9999;
  border: border border-2 border-white/20;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sim-fab:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.6);
}

/* Modal Overlay */
.sim-modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.sim-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Modal Content */
.sim-modal {
  background: #0f172a;
  color: white;
  width: 90%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  border: 1px solid rgba(255,255,255,0.1);
}
.sim-modal-overlay.active .sim-modal {
  transform: scale(1);
}
.sim-modal h2 {
  margin: 0 0 20px 0;
  font-size: 22px;
  color: #fbbf24;
  text-align: center;
  font-weight: 800;
}
.sim-modal .close-btn {
  position: absolute;
  top: 16px;
  right: 20px;
  background: transparent;
  color: #94a3b8;
  border: none;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s;
}
.sim-modal .close-btn:hover {
  color: white;
}
.sim-modal input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: white;
  margin-bottom: 16px;
  font-size: 16px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.sim-modal input:focus {
  border-color: #fbbf24;
  background: rgba(255,255,255,0.08);
}
.sim-modal button.submit-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: white;
  font-weight: bold;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(234, 88, 12, 0.3);
}
.sim-modal button.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.5);
}

#sim-result {
  margin-top: 20px;
  padding: 0;
  display: none;
  animation: fadeIn 0.4s ease forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
#sim-result.active {
  display: block;
}

/* Ad Container - Fixed Bottom */
.custom-ad-container {
  position: fixed;
  bottom: 0px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 728px;
  max-height: 110px; /* Limit height so it doesn't cover screen */
  z-index: 9998;
  text-align: center;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  background-color: #0f172a;
  overflow: hidden;
  border-top: 1px solid rgba(255,255,255,0.1);
  border-left: 1px solid rgba(255,255,255,0.1);
  border-right: 1px solid rgba(255,255,255,0.1);
  border-bottom: none;
}
.custom-ad-container > div, .custom-ad-container iframe {
  max-height: 110px !important;
  max-width: 100% !important;
  object-fit: contain;
}
.ad-label {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateY(-100%) translateX(-50%);
  background: rgba(0,0,0,0.6);
  color: #94a3b8;
  font-size: 10px;
  padding: 2px 12px;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  border-bottom: none;
}

@media (max-width: 768px) {
  .sim-fab {
    bottom: 125px; /* above the ad banner */
    right: 50%;
    transform: translateX(100%);
    margin-right: -5px;
    padding: 10px 14px;
    font-size: 13px;
    width: max-content;
  }
  .sim-fab:hover {
    transform: translateX(100%) translateY(-3px);
  }
}
