/* ── IFRAME PANEL (Split-screen Cyberday app) ────────── */

/* Panel container — hidden by default */
.iframe-panel {
  display: none;
  flex-direction: column;
  width: 0;
  min-width: 0;
  background: var(--bg-app);
  border-left: 1px solid var(--grey-border);
  overflow: hidden;
}

/* When active */
.app-layout.iframe-open .iframe-panel {
  display: flex;
  width: 70%;
}

/* Constrain main-content when iframe is open */
.app-layout.iframe-open .main-content {
  flex: none;
  width: 30%;
  min-width: 280px;
}

/* Reduce content-wrap padding in narrow mode */
.app-layout.iframe-open .content-wrap {
  max-width: 100%;
  padding: 28px 24px 0;
}

.app-layout.iframe-open .section-footer {
  padding: 24px 24px 40px;
  max-width: 100%;
}

/* ── PANEL HEADER ────────────────────────────────────── */
.iframe-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(6, 12, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  height: 40px;
}

.iframe-panel-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: #94A3B8;
  letter-spacing: 0.3px;
}

.iframe-header-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.iframe-close-btn,
.iframe-fullscreen-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  width: 28px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748B;
  transition: all 0.15s ease;
  padding: 0;
}

.iframe-close-btn:hover,
.iframe-fullscreen-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #E2E8F0;
}

.iframe-fullscreen-btn.active {
  background: rgba(59,130,246,0.2);
  border-color: rgba(59,130,246,0.4);
  color: #93C5FD;
}

.iframe-close-btn svg,
.iframe-fullscreen-btn svg {
  width: 14px;
  height: 14px;
}

/* ── IFRAME ──────────────────────────────────────────── */
.iframe-scale-wrapper {
  flex: 1;
  overflow: hidden;
  position: relative;
}

#cyberday-iframe {
  width: 133.33%;
  height: 133.33%;
  border: none;
  background: #fff;
  transform: scale(0.75);
  transform-origin: top left;
  position: absolute;
  top: 0;
  left: 0;
}

/* ── TOPBAR TOGGLE BUTTON ────────────────────────────── */
.iframe-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  color: #93C5FD;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-body);
  transition: all 0.2s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

.iframe-toggle:hover {
  background: rgba(59,130,246,0.2);
  border-color: rgba(59,130,246,0.4);
}

.iframe-toggle svg {
  width: 16px;
  height: 16px;
}

/* Show toggle only when a task section is active */
.iframe-toggle.visible {
  display: flex;
}

/* Active state when panel is open */
.iframe-toggle.active {
  background: rgba(59,130,246,0.25);
  border-color: #3B82F6;
  color: #BFDBFE;
}

/* ── FULLSCREEN MODE ─────────────────────────────────── */
.app-layout.iframe-fullscreen .main-content {
  display: none;
}

.app-layout.iframe-fullscreen .iframe-panel {
  display: flex;
  width: 100%;
  border-left: none;
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 1024px) {
  .app-layout.iframe-open .iframe-panel {
    position: fixed;
    top: var(--topbar-h);
    right: 0;
    bottom: 0;
    width: 55%;
    z-index: 100;
    box-shadow: -4px 0 24px rgba(0,0,0,0.3);
  }
  .app-layout.iframe-open .main-content {
    flex: 1;
    width: auto;
  }
}

@media (max-width: 820px) {
  .app-layout.iframe-open .iframe-panel {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    z-index: 150;
  }
  .app-layout.iframe-open .main-content {
    flex: 1;
    width: auto;
  }
  .iframe-toggle-label {
    display: none;
  }
}
