/* Tool App Container - Madgicx Style */

.tool-app-container {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-app-container.active {
  opacity: 1;
  pointer-events: all;
}

.tool-app-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1;
}

.tool-app-content {
  position: relative;
  z-index: 2;
  width: 95%;
  max-width: 1400px;
  height: 90vh;
  max-height: 900px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-app-container.active .tool-app-content {
  transform: scale(1) translateY(0);
}

/* Tool App Header */
.tool-app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(30, 41, 59, 0.5);
}

.tool-app-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tool-app-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tool-app-title-group h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin: 0;
  line-height: 1.2;
}

.tool-app-title-group p {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0.25rem 0 0 0;
}

.tool-app-close {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.tool-app-close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

/* Tool App Body */
.tool-app-body {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.tool-app-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: rgba(255, 255, 255, 0.8);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: #6366F1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.tool-app-iframe-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.tool-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
}

.tool-app-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.tool-app-placeholder-content {
  text-align: center;
  max-width: 500px;
}

.tool-app-placeholder-icon {
  font-size: 64px;
  margin-bottom: 1.5rem;
  animation: float 3s ease-in-out infinite;
}

.tool-app-placeholder-content h3 {
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.75rem;
}

.tool-app-placeholder-content p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.tool-app-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* Toast Notifications */
.tool-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(20px);
  border: 1.5px solid rgba(99, 102, 241, 0.5);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3);
  z-index: 20000;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  max-width: 300px;
}

.tool-toast.show {
  opacity: 1;
  transform: translateX(0);
}

/* Responsive */
@media (max-width: 768px) {
  .tool-app-content {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  
  .tool-app-header {
    padding: 1rem 1.5rem;
  }
  
  .tool-app-title-group h2 {
    font-size: 1.25rem;
  }
}
