/**
 * StyleyeS v1.8 — Layout Styles
 * Page Structure and Grid Systems
 */

/* ============================================
   BACKGROUND
   ============================================ */

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
}

.bg::before {
  content: '';
  position: absolute;
  top: -30%;
  left: -20%;
  width: 70%;
  height: 70%;
  background: radial-gradient(ellipse at center, rgba(255, 107, 53, 0.12) 0%, transparent 60%);
  filter: blur(60px);
  animation: drift1 25s ease-in-out infinite;
}

.bg::after {
  content: '';
  position: absolute;
  bottom: -20%;
  right: -20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse at center, rgba(155, 77, 202, 0.1) 0%, transparent 60%);
  filter: blur(60px);
  animation: drift2 30s ease-in-out infinite;
}

.bg-accent {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  width: 50%;
  height: 40%;
  background: radial-gradient(ellipse at center, rgba(220, 47, 90, 0.08) 0%, transparent 60%);
  filter: blur(80px);
  animation: drift3 20s ease-in-out infinite;
}

/* ============================================
   APP CONTAINER
   ============================================ */

.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-top) + 1rem) 1rem calc(var(--safe-bottom) + 1.5rem) 1rem;
  max-width: 600px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .app {
    max-width: 800px;
    padding: 2rem;
  }
}

/* ============================================
   HEADER
   ============================================ */

header {
  text-align: center;
  margin-bottom: 2rem;
  animation: fadeIn 0.8s var(--ease-out) both;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

main {
  flex: 1;
  animation: fadeUp 0.8s var(--ease-out) 0.1s both;
}

/* ============================================
   INPUT ROW
   ============================================ */

.input-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

/* ============================================
   INPUT SECTION
   ============================================ */

.input-section {
  margin-bottom: 1.25rem;
}

.input-section--wide {
  grid-column: 1 / -1;
}

.input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.input-header label {
  margin-bottom: 0;
}

/* ============================================
   FOOTER — VASEY/AI Universal Branded Footer
   ============================================ */

.app-footer {
  margin-top: 56px;
  padding-top: 32px;
  text-align: center;
  flex-shrink: 0;
  animation: fadeInUp 0.8s ease-out 0.4s both;
  /* Enhancement B: Accent Gradient Top Border */
  border-top: none;
  background-image: linear-gradient(90deg, transparent 0%, var(--accent-deep) 30%, var(--accent-primary) 50%, var(--accent-deep) 70%, transparent 100%);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: top center;
}

.footer-divider {
  /* Enhancement E: Separator Dot Cluster */
  width: auto;
  height: auto;
  background: none;
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}

.footer-divider::before,
.footer-divider::after {
  content: '';
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-deep);
}

.footer-divider span {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-deep);
}

.footer-brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.footer-logo {
  opacity: 0.45;
  transition: opacity 0.3s ease;
  display: inline-flex;
  align-items: center;
}

.footer-logo:hover {
  opacity: 0.75;
}

.footer-logo-vm {
  width: 36px;
  height: 31px;
}

.footer-logo-vai {
  width: 48px;
  height: 48px;
}

.footer-logo-sep {
  width: 1px;
  height: 24px;
  background: var(--border-glow);
}

.footer-suite-tag {
  font-family: 'Reddit Sans', var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.footer-app-tag {
  font-family: 'Space Mono', var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.7;
  margin-bottom: 16px;
}

.footer-copyright {
  font-family: 'Reddit Sans', var(--font-sans);
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.5;
  line-height: 1.6;
  padding-bottom: max(8px, var(--safe-bottom));
}

.footer-copyright a {
  color: var(--accent-dim);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-copyright a:hover {
  color: var(--accent-primary);
}

/* ============================================
   PWA SPECIFIC
   ============================================ */

/* Handle notch on modern iPhones */
@supports (padding: max(0px)) {
  .app {
    padding-left: max(1rem, var(--safe-left));
    padding-right: max(1rem, var(--safe-right));
    padding-top: max(calc(var(--safe-top) + 1rem), 1rem);
    padding-bottom: max(calc(var(--safe-bottom) + 1.5rem), 1.5rem);
  }
}

/* Standalone mode adjustments */
@media all and (display-mode: standalone) {
  .app {
    padding-top: calc(var(--safe-top) + 0.5rem);
  }
  
  header {
    margin-bottom: 1.5rem;
  }
}

/* Landscape orientation */
@media (orientation: landscape) and (max-height: 500px) {
  .app {
    padding-top: calc(var(--safe-top) + 0.5rem);
    padding-bottom: calc(var(--safe-bottom) + 0.75rem);
    padding-left: max(1rem, var(--safe-left));
    padding-right: max(1rem, var(--safe-right));
  }

  header {
    margin-bottom: 1rem;
  }

  .logo {
    width: 60px;
    height: 60px;
  }

  .title-group h1 {
    font-size: 1.75rem;
  }
}

/* Tablet and Desktop */
@media (min-width: 1024px) {
  .app {
    max-width: 900px;
  }
  
  .styles-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Large Desktop */
@media (min-width: 1440px) {
  .app {
    max-width: 1000px;
  }
  
  .styles-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}
