/* Demo Page - Overrides and demo-specific styles
 * These styles extend the landing.css base for demo-specific components.
 */

/* === Button Styling === */

.btn-small {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
  border: none;
  background-color: var(--b-btn-bg);
  color: var(--b-btn-txt);
  cursor: pointer;
  transition: var(--transition-base);
}

.btn-small:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.btn-small:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Header button override */
.main-nav .btn {
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
}

/* === Article Layout for Demo Cards === */

article header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
}

article header svg {
  align-self: center;
  margin-bottom: 0.1rem;
}

article header > :nth-child(2) {
  flex: 1;
  align-self: center;
  position: relative;
  top: 0.1rem;
}

article header .btn-small {
  align-self: center;
  margin-bottom: 0.1rem;
}

/* === Modal Styles === */

.modal {
  width: 70%;
  max-width: 1200px;
  min-width: 600px;
  padding: 0;
  margin: 5vh auto;
  border: none;
  background: transparent;
  position: relative;
  z-index: 9999;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
}

.modal article {
  position: relative;
  width: 100%;
  padding: 2rem;
  background: var(--pico-card-background-color);
  border-radius: var(--pico-border-radius);
  box-shadow: var(--pico-card-box-shadow);
}

.modal button[rel="prev"] {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  width: 2rem;
  height: 2rem;
  font-size: 1.5rem;
  z-index: 10000;
  transition: color 0.2s ease;
}

.modal button[rel="prev"]:hover {
  color: var(--pico-primary);
}

.modal pre {
  margin-top: 1.5rem;
  padding-right: 1rem;
}

/* === Auth Overlay === */

#pz-auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--b-bg-1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.3s ease;
}

#pz-auth-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

#pz-auth-overlay .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--b-line);
  border-top-color: var(--b-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

#pz-auth-overlay .status {
  margin-top: 1rem;
  color: var(--b-txt-muted);
  font-size: 0.9rem;
}

/* === Log Output Styling === */

.log-output {
  background: var(--b-bg-2);
  border: 1px solid var(--b-line);
  border-radius: 8px;
  padding: 1rem;
  max-height: 300px;
  overflow-y: auto;
}

.log-output pre {
  margin: 0;
  font-family: var(--b-font-mono, ui-monospace, monospace);
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* === Demo Content Adjustments === */

main.container h2 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

main.container h3 {
  margin-top: 2rem;
}

/* === Status Indicator === */

#status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
}

#status-icon {
  font-size: 1.5rem;
}

/* === Responsive Modal === */

@media (max-width: 768px) {
  .modal {
    width: 95%;
    min-width: auto;
    margin: 2vh auto;
  }

  .modal article {
    padding: 1.5rem;
  }
}
