/* Reset & Background */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: #0a0a0a;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* Loader */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out;
}

#loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader-content {
  text-align: center;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: #7C3AED;
  animation: spin 1s ease-in-out infinite;
  margin: 0 auto 20px;
}

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

#loader p {
  font-size: 1.2rem;
  opacity: 0.9;
  letter-spacing: 0.5px;
}

/* Header */
header {
  padding: 0.75rem 1.5rem;
  background: #0a0a0a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.2);
  position: relative;
  z-index: 100;
  height: 60px;
}

header .logo {
  height: 35px;
  width: auto;
}

.beta-badge {
  background: linear-gradient(135deg, #7C3AED, #6D28D9);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Frame Container - Key styling for hiding Figma UI */
.frame-container {
  width: 100vw;
  height: calc(100vh - 60px); /* Account for header height */
  position: relative;
  overflow: hidden;
  background: #0a0a0a;
  opacity: 0; /* Initially hidden, will be set to 1 via JS */
  transition: opacity 0.5s ease-in;
}

/* Wrapper to mask the Figma embed UI */
.iframe-wrapper {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.frame-container iframe {
  border: none;
  width: 100vw;
  height: calc(100vh + 100px); /* Extra height to ensure full coverage */
  position: absolute;
  top: -50px; /* Hide top Figma embed UI (adjust as needed) */
  left: 0;
  transform-origin: center;
  pointer-events: auto;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  header {
    padding: 0.5rem 1rem;
    height: 50px;
  }
  
  header .logo {
    height: 28px;
  }
  
  .beta-badge {
    padding: 4px 12px;
    font-size: 0.65rem;
  }
  
  .frame-container {
    height: calc(100vh - 50px);
  }
  
  .frame-container iframe {
    height: calc(100vh + 150px);
    top: -70px; /* More aggressive masking for mobile */
  }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .frame-container iframe {
    height: calc(100vh + 120px);
    top: -60px;
  }
}

/* Alternative approach for stubborn Figma embeds */
.frame-container.zoom-approach iframe {
  width: 110vw;
  height: 110vh;
  top: -5vh;
  left: -5vw;
  transform: scale(1.05);
  transform-origin: center center;
}

/* Loading state for iframe */
.frame-container::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: #7C3AED;
  animation: spin 1s linear infinite;
  z-index: -1;
}