/**
 * TSAI Embed Plugin Styles
 * Styles for the Sales and Support modal tabs
 */

/* Prevent body scrolling when modal is open */
body.tsai-modal-open {
  overflow: hidden;
}

/* Backdrop overlay */
#slideApp-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease;
  z-index: 9998;
}

#slideApp-backdrop.visible {
  opacity: 1;
  visibility: visible;
}

/* Centered modal container */
#slideApp-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 600px;
  max-width: 95vw;
  height: 800px;
  max-height: 90vh;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  overflow: visible;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease, transform 0.6s ease;
  z-index: 9999;
}

#slideApp-container.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* Close button - positioned just above top-right corner */
#slideApp-close {
  position: absolute;
  top: -18px;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid #fff;
  color: #fff;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  z-index: 10;
  transition: background 0.3s ease, transform 0.2s ease;
}

#slideApp-close:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

/* Iframe - now takes full modal space */
#slideApp-frame {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 8px;
}

/* Shortcode chat buttons wrapper */
.tsai-chat-buttons-wrapper {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* Individual chat button styles */
.tsai-nav-sales,
.tsai-nav-support {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #1e3a8a;
  color: #fff !important;
  border-radius: 6px;
  font-weight: 500;
  text-decoration: none !important;
  transition: background 0.3s ease, transform 0.2s ease;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}

.tsai-nav-sales:hover,
.tsai-nav-support:hover {
  background: #1a3166;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.3);
}

.tsai-nav-sales:active,
.tsai-nav-support:active {
  transform: translateY(0);
}

/* Contact Form 7 Submit Button - Match Sales/Support Buttons */
.wpcf7-form input[type="submit"],
.wpcf7-submit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #1e3a8a;
  color: #fff !important;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  text-decoration: none !important;
  transition: background 0.3s ease, transform 0.2s ease;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}

.wpcf7-form input[type="submit"]:hover,
.wpcf7-submit:hover {
  background: #1a3166;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.3);
}

.wpcf7-form input[type="submit"]:active,
.wpcf7-submit:active {
  transform: translateY(0);
}

.wpcf7-form input[type="submit"]:disabled,
.wpcf7-submit:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

/* Icon styling for larger emoji */
.tsai-icon {
  font-size: 20px;
  line-height: 1;
}

/* ===============================================
   RESPONSIVE MEDIA QUERIES
   =============================================== */

/* Tablet and mobile devices */
@media (max-width: 768px) {
  #slideApp-container {
    width: 95vw;
    height: 82vh;
  }

  /* Adjust close button positioning for smaller screens */
  #slideApp-close {
    top: -16px;
    right: -2px;
    width: 32px;
    height: 32px;
    font-size: 20px;
  }
}

/* Extra-small mobile devices (phones) */
@media (max-width: 480px) {
  #slideApp-container {
    width: 98vw;
    height: 82vh;
    border-radius: 6px;
  }

  /* Make close button slightly smaller and more accessible */
  #slideApp-close {
    top: -14px;
    right: 0;
    width: 30px;
    height: 30px;
    font-size: 18px;
  }

  /* Adjust iframe border radius to match container */
  #slideApp-frame {
    border-radius: 6px;
  }
}
