/* =========================================
   1. RESET & BASE STYLES
   ========================================= */
body {
  margin: 0;
  padding: 0;
  background-color: #008080; /* Classic Windows 95 Teal */
  font-family: "Times New Roman", Times, serif; /* Default web font */
  color: #000;
  /* Optional: Force a scrollbar to prevent layout jump */
  overflow-y: scroll; 
}

/* Links in the main text should look standard */
a {
  color: #0000EE; /* Default Blue */
}
a:visited {
  color: #551A8B; /* Default Purple */
}

/* =========================================
   2. THE MAIN "BROWSER WINDOW" CONTAINER
   ========================================= */
.site-window {
  max-width: 900px;
  margin: 20px auto;
  background-color: #c0c0c0; /* The universal Windows Grey */
  border: 2px solid #dfdfdf;
  border-right-color: #404040;
  border-bottom-color: #404040;
  box-shadow: 4px 4px 10px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  /* Min-height ensures it looks like a window even with little content */
  min-height: 80vh; 
}

/* =========================================
   3. HEADER / TITLE BAR
   ========================================= */
.site-header {
  background: #000080; /* Title Bar Blue */
  color: #fff;
  padding: 4px 8px;
  font-family: "MS Sans Serif", Arial, sans-serif;
  font-weight: bold;
  font-size: 14px;
  border-bottom: 2px solid #dfdfdf;
  /* Flexbox to align marquee nicely if needed */
  display: flex;
  align-items: center;
}

marquee {
  width: 100%;
  font-family: "Courier New", monospace;
  font-weight: normal;
}

/* =========================================
   4. THE "FRAMESET" LAYOUT (CSS GRID)
   ========================================= */
.frameset {
  display: grid;
  grid-template-columns: 220px 1fr; /* Fixed sidebar, flexible content */
  gap: 4px;
  padding: 4px;
  flex-grow: 1; /* Fills the rest of the .site-window */
}

/* =========================================
   5. SIDEBAR & NAVIGATION
   ========================================= */
.sidebar {
  background: #fff;
  border: 2px inset #dfdfdf; /* Sunken look */
  padding: 10px;
  overflow-y: auto;
  font-family: "MS Sans Serif", Arial, sans-serif;
}

.nav-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.nav-list li {
  margin-bottom: 6px;
}

.nav-header {
  font-weight: bold;
  text-align: center;
  background-color: #000080;
  color: white;
  margin: 15px 0 5px 0;
  padding: 2px;
  font-size: 12px;
  border: 1px solid #fff;
  box-shadow: 1px 1px 0 #000;
}
/* Remove margin for the first header */
.nav-header:first-child { margin-top: 0; }

/* The "3D Button" Link Style */
.nav-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background-color: #c0c0c0;
  border: 2px outset #ffffff;
  border-right-color: #404040;
  border-bottom-color: #404040;
  text-decoration: none;
  color: black;
  padding: 4px 8px;
  font-size: 13px;
}

.nav-btn:hover {
  background-color: #d0d0d0;
  cursor: pointer;
}

/* Active / Pressed State */
.nav-btn:active, 
.nav-btn.active {
  border: 2px inset #ffffff;
  border-right-color: #dfdfdf; 
  border-bottom-color: #dfdfdf;
  background-color: #a0a0a0;
  padding-left: 6px; /* Text shift effect when pressed */
  padding-top: 5px; 
}

.nav-icon {
  width: 14px;
  height: 14px;
  margin-right: 6px;
  image-rendering: pixelated;
  vertical-align: middle;
}

/* =========================================
   6. MAIN CONTENT AREA
   ========================================= */
.content {
  background: #fff;
  border: 2px inset #dfdfdf; /* Sunken look */
  padding: 20px;
  overflow-y: auto;
}

/* Content Typography */
.content h1 {
  font-family: Arial, Helvetica, sans-serif;
  text-align: center;
  border-bottom: 2px groove #dfdfdf;
  padding-bottom: 10px;
  margin-top: 0;
}

.content h2, .content h3 {
  font-family: Arial, Helvetica, sans-serif;
  color: #000080;
}

.content p {
  line-height: 1.5;
  margin-bottom: 15px;
}

/* =========================================
   7. RETRO UI COMPONENTS
   ========================================= */

/* The Fancy Horizontal Rule */
hr.fancy-rule {
  border: 0;
  height: 2px;
  border-top: 1px solid #808080;
  border-bottom: 1px solid #fff;
  margin: 10px 0;
}

/* Retro Data Tables */
table.retro-table {
  width: 100%;
  border-collapse: collapse;
  border: 2px outset #c0c0c0;
  margin-bottom: 20px;
}
table.retro-table th, 
table.retro-table td {
  border: 1px inset #c0c0c0;
  padding: 6px;
  font-size: 14px;
}
table.retro-table th {
  background: #000080;
  color: white;
  font-family: Arial, sans-serif;
}

/* Generic "Click Me" Buttons (for forms etc) */
.btn-retro {
  background: #c0c0c0;
  border: 2px outset #fff;
  border-right-color: #404040;
  border-bottom-color: #404040;
  color: black;
  text-decoration: none;
  padding: 4px 10px;
  font-family: Arial, sans-serif;
  font-size: 13px;
  cursor: pointer;
  display: inline-block;
}
.btn-retro:active {
  border: 2px inset #fff;
}

/* =========================================
   BOOK PAGE STYLES
   ========================================= */

/* Flex container for the top section */
.book-header {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  align-items: flex-start;
}

/* 3D Border for the cover */
.book-cover {
  width: 200px;
  height: auto;
  border: 2px outset #fff; /* Makes it pop out */
  background: #000;
  display: block;
}

/* Mobile: Stack them */
@media (max-width: 600px) {
  .book-header {
    flex-direction: column;
    align-items: center;
  }
  .book-cover {
    width: 150px;
  }
  .book-info {
    width: 100%;
  }
}

/* The "Buy" Button - Make it chunky */
.btn-buy {
  font-weight: bold;
  font-size: 16px;
  padding: 8px 20px;
  background-color: #c0c0c0;
  border: 3px outset #fff;
}
.btn-buy:active {
  border: 3px inset #fff;
}

/* Fieldset for Synopsis/Reviews */
.retro-fieldset {
  border: 2px groove #dfdfdf;
  padding: 10px 15px;
  margin-bottom: 20px;
  background-color: #f0f0f0; /* Slightly lighter grey for readability */
}

.retro-fieldset legend {
  font-family: Arial, sans-serif;
  font-weight: bold;
  color: #000080;
  padding: 0 5px;
}

/* =========================================
   8. MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 600px) {
  body {
    background-color: #c0c0c0; /* Remove teal on mobile for space */
    padding: 0;
  }

  .site-window {
    margin: 0;
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    border: none;
    box-shadow: none;
  }

  .frameset {
    grid-template-columns: 1fr; /* Single column stack */
    grid-template-rows: auto 1fr;
    gap: 0;
    padding: 0;
  }

  /* Make sidebar scroll horizontal or collapsible on mobile? 
     Let's keep it simple: vertical stack */
  .sidebar {
    border: none;
    border-bottom: 2px solid #000;
    max-height: 200px; /* Limit height so content isn't pushed too far down */
    padding: 10px;
  }
  
  .content {
    border: none;
    padding: 15px;
  }
}