/* ================================================================
   ANGAD.LOG — layout.css
   App Container, Header, Footer, Overlays, and Mobile Shell
   ================================================================ */

/* 1. Force padding and borders to shrink inside the 100% width, never expand outside it */
*, *::before, *::after {
  box-sizing: border-box !important;
}

/* 2. Lock the viewport to strictly the width of the phone screen */
html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden !important; 
  position: relative;
  margin: 0;
  padding: 0;
}

/* 3. Ensure the main wrapper doesn't accidentally stretch */
.app-container, .main-content, #view-dashboard {
  max-width: 100vw;
  overflow-x: hidden;
}

.app-container {
  max-width: 100%;
  margin: 0; 
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 1rem 1.5rem 0 1.5rem; 
  position: relative;
  z-index: 10;
}

.app-body { 
  display: flex; 
  gap: 1.5rem; 
  flex: 1; 
  overflow: hidden; 
  padding-top: 1rem; 
}

.main-content { 
  flex: 1; 
  overflow-y: auto; 
  padding-right: 10px; 
  padding-bottom: 2rem; 
}

/* ================================================================
   HEADER
   ================================================================ */
.app-header {
  position: relative;
  padding-bottom: 1rem; 
  flex-shrink: 0;
}

.header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 30px;
}

.title-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-title {
  font-family: 'Qaaxee', monospace;
  font-size: 3.5rem;
  color: var(--cream);
  letter-spacing: 2px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  text-shadow: 0 0 15px rgba(240,216,120,0.15);
  transition: color 0.15s;
}

.site-title:hover { color: #fff; }

.blink-cursor { animation: blink 1.1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.main-tabs {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.main-tab {
  font-family: 'Qaaxee', monospace;
  font-size: 14px;
  background: var(--bg-card);
  border: 2px solid var(--border-mid);
  border-radius: 6px;
  color: var(--text-dim);
  padding: 0.8rem 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.2s;
}

.main-tab:hover { 
  border-color: var(--purple-dim); 
  color: var(--text); 
}

.main-tab.active {
  border-color: var(--purple-bright);
  color: var(--purple-bright);
  background: var(--purple-faint);
}

.write-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--bg-card);
  border: 2px solid var(--border-mid);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.13s;
  margin-left: auto;
}

.write-trigger:hover { 
  border-color: var(--purple-bright); 
  color: var(--purple-bright); 
  background: var(--purple-faint); 
}

.hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  font-size: 1rem;
  border-radius: 4px;
}

/* ================================================================
   FOOTER & ARTWORK
   ================================================================ */
.app-footer { 
  margin-top: auto; 
  flex-shrink: 0; 
  position: relative; 
  /* THE FIX: Replaced negative margins with width management */
  width: 100vw;
  margin-left: -1.5rem; /* Pulled to screen edge */
}

.footer-bar {
  display: flex;
  justify-content: space-between;
  padding: 1.2rem 3rem; 
  background: var(--bg-card);
  border-top: 2px solid var(--border-mid); 
  border-radius: 0; 
  font-family: 'Qaaxee', monospace;
  font-size: 12px; /* Bumped from 8.5px */
  color: var(--text-faint);
  letter-spacing: 1.5px;
}

.cat-trigger { 
  position: absolute; 
  right: 59px; 
  bottom: 81px; 
  width: 28px; 
  height: 32px; 
  cursor: help; 
  z-index: 100; 
  background: transparent; 
  border: none; 
}

.art-placeholder { 
  pointer-events: none; 
  background-size: contain; 
  background-repeat: no-repeat; 
  image-rendering: pixelated; 
}

.art-sky { 
  position: absolute; 
  top: 0; 
  right: 2rem; 
  width: 350px; 
  height: 100%; 
  opacity: 0.8; 
}

.art-avatar { 
  width: 64px; 
  height: 64px; 
  background: var(--bg); 
  border: 1px solid var(--border-mid); 
  border-radius: 4px; 
  flex-shrink: 0; 
}

.art-plant-1 { position: absolute; bottom: 8px; right: 8px; width: 65px; height: 65px; }
.art-vine { position: absolute; bottom: -5px; right: -5px; width: 55px; height: 85px; }

.art-cityscape {
  bottom: 0;
  left: 0;
  width: 100%;
  height: 70px; 
  background-image: 
    url('../assets/skyline_left.png'),
    url('../assets/skyline_right.png'),
    url('../assets/skyline_mid.png');
  background-position: 
    bottom left,
    bottom right,
    bottom center;
  background-repeat: 
    no-repeat,
    no-repeat,
    repeat-x;
  background-size: 
    auto 100%,
    auto 100%,
    auto 100%;
  image-rendering: pixelated; 
  opacity: 1; 
  z-index: 0; 
}

.accent-moon {
  position: absolute;
  top: 12px;    
  right: 12px;  
  width: 350px;  
  height: auto;
  image-rendering: pixelated;
  z-index: 1; 
  opacity: 0.85; 
  pointer-events: none; 
}

/* ================================================================
   OVERLAYS
   ================================================================ */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 8, 20, 0.95);
  backdrop-filter: blur(10px);
  z-index: 9999 !important; 
  display: none; 
  justify-content: center;
  align-items: center;
}

.overlay.open { display: flex; }

.overlay-panel { 
  background: var(--bg-card); 
  border: 2px solid var(--border-mid); 
  border-radius: 8px; 
  padding: 2.5rem; 
  max-width: 500px; 
  width: 90%; 
  max-height: 85vh; 
  overflow-y: auto; 
}

.overlay-back { 
  font-family: 'Qaaxee', monospace; 
  font-size: 14px; /* Bumped from 12px */
  color: var(--text-faint); 
  cursor: pointer; 
  letter-spacing: 1px; 
  margin-bottom: 1.5rem; 
  display: inline-block; 
  transition: color 0.13s; 
}

.overlay-back:hover { color: var(--purple-bright); }

.overlay-header { 
  font-family: 'Qaaxee', monospace; 
  font-size: 2.2rem; 
  color: var(--purple-bright); 
  letter-spacing: 2px; 
  text-transform: uppercase; 
  margin-bottom: 1.5rem; 
}

/* About specifics */
.about-block { margin-bottom: 1.75rem; }
.about-label { 
  font-family: 'Qaaxee', monospace; 
  font-size: 12px; /* Bumped from 9px */
  color: var(--purple); 
  letter-spacing: 1.5px; 
  text-transform: uppercase; 
  margin-bottom: 0.7rem; 
}

.about-value { 
  font-size: 15.5px; 
  color: var(--text); 
  line-height: 1.8; 
}

/* Auth specifics */
.auth-prompt { 
  font-size: 18px; 
  color: var(--text-dim); 
  margin-bottom: 1rem; 
}

.pw-row { 
  display: flex; 
  gap: 0.5rem; 
  margin-bottom: 0.5rem; 
}

.pw-input { 
  flex: 1; 
  background: var(--bg); 
  border: 1px solid var(--border-mid); 
  border-radius: 4px; 
  color: var(--text); 
  font-family: 'Qaaxee', monospace; 
  font-size: 14px; 
  padding: 0.6rem 0.8rem; 
  outline: none; 
}

.pw-input:focus { border-color: var(--purple); }

.pw-btn { 
  font-family: 'Qaaxee', monospace; 
  background: var(--purple-faint); 
  border: 1px solid var(--purple-dim); 
  border-radius: 4px; 
  color: var(--purple-bright); 
  padding: 0.6rem 1rem; 
  cursor: pointer; 
  transition: all 0.15s; 
}

.pw-btn:hover { 
  background: var(--purple); 
  color: #fff; 
}

.pw-error { 
  display: none; 
  font-family: 'Qaaxee', monospace; 
  font-size: 12px; /* Bumped from 7px */
  color: var(--tc-life); 
  margin-top: 0.5rem; 
}

/* ── GLOBAL LAPTOP VIEW SCALING ── */

/* ================================================================
   MOBILE MEDIA QUERIES (Screens under 900px)
   ================================================================ */
@media (max-width: 900px) {
  /* THE FIX: Maintained flex direction to keep footer at bottom */
  .app-container { 
    padding: 0; 
    height: 100vh; 
    overflow-y: auto; 
    display: flex; 
    flex-direction: column;
  }
  
  .app-header { padding: 1rem; }
  
  .app-body { 
    flex-direction: column; 
    padding: 0 1rem; 
    overflow: visible; 
    gap: 1rem; 
  }
  .overlay-header { 
    font-family: 'Qaaxee', monospace; 
    font-size: 1.7rem; 
    color: var(--purple-bright); 
    letter-spacing: 2px; 
    text-transform: uppercase; 
    margin-bottom: 1.5rem; 
  }
  
  .main-content { 
    overflow: visible; 
    padding-right: 0; 
  }
  
  .site-title { font-size: 2.5rem; }
  .art-sky { display: none; }
  .accent-moon { width: 200px; top: 35px; }
  .hamburger { display: block; }

  /* Ensure footer spans full width without negative margins on mobile */
  .app-footer {
    width: 100%;
    margin-left: 0;
  }
}