/* ============================================================================
   MENU SYSTEM STYLES
   Modular menu system for merged story-diagram builds
   Drop this file into any build and link in index.html
   Styling matches Green Steel Merged Story Diagram design
   ============================================================================ */

/* Main Menu Container */
.main-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #f5f5f5;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 50px;
  padding: 80px 20px 40px;
  box-sizing: border-box;
  overflow-y: auto;
  z-index: 100;
}

.main-menu.hidden {
  display: none;
}

/* Header Section */
.header-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.csiro-logo {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}

.title-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 900px;
}

.main-title {
  font-size: 46px;
  font-weight: 300;
  line-height: 1.2;
  margin: 0 0 15px 0;
  color: #333;
}

.subtitle {
  font-size: 24px;
  font-weight: 200;
  line-height: 1.4;
  margin: 0;
  color: #000;
  max-width: 90%;
}

.demo-version {
  font-size: 14px;
  font-weight: 300;
  margin: 10px 0 0 0;
  color: #888;
}

/* Buttons Section */
.buttons-section {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 60px;
  flex-shrink: 0;
}

.menu-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.menu-button:hover {
  transform: translateY(-5px);
}

.icon-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 140px;
  height: 140px;
  box-sizing: border-box;
  margin-bottom: 20px;
  transition: box-shadow 0.2s ease;
}

.menu-button:hover .icon-container {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.icon-container img {
  width: 100px;
  height: 100px;
  object-fit: contain;
}

.button-label {
  font-size: 20px;
  font-weight: 400;
  color: #333;
  text-align: center;
  max-width: 180px;
  line-height: 1.3;
}

/* Back Button (for submenu) - matches story/diagram viewer styling */
.back-button-container {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1002;
}

.back-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #e5e7eb;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.back-button:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-1px);
}

.back-button svg {
  width: 20px;
  height: 20px;
  stroke: #333;
  stroke-width: 2;
  fill: none;
}

/* Hide CSIRO logo in Methods submenu (using global fixed logo instead) */
#methodsSubmenu .csiro-logo {
  display: none;
}

#methodsSubmenu .header-section {
  align-items: center;
}

/* Global CSIRO Logo (appears in top-right during stories/submenu) */
.global-csiro-logo {
  position: fixed;
  top: 20px;
  right: 20px;
  height: 50px;
  width: auto;
  z-index: 20010;
  pointer-events: none;
  display: block;
}

/* Hide global logo when main menu is visible (not hidden) */
#mainMenu:not(.hidden) ~ .global-csiro-logo {
  display: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .main-menu {
    gap: 40px;
    padding: 80px 20px 40px;
  }

  .header-section {
    gap: 15px;
  }

  .title-section {
    max-width: 700px;
  }

  .csiro-logo {
    width: 80px;
    height: 80px;
  }

  .main-title {
    font-size: 36px;
    margin-bottom: 12px;
  }

  .subtitle {
    font-size: 18px;
  }

  .buttons-section {
    gap: 50px;
  }

  .icon-container {
    width: 120px;
    height: 120px;
    padding: 15px;
  }

  .icon-container img {
    width: 90px;
    height: 90px;
  }

  .button-label {
    font-size: 18px;
  }
}

@media (max-width: 768px) {
  .main-menu {
    gap: 30px;
    padding: 80px 20px 40px;
  }

  .header-section {
    gap: 12px;
  }

  .title-section {
    max-width: 100%;
    padding: 0 10px;
  }

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

  .main-title {
    font-size: 24px;
    margin-bottom: 10px;
  }

  .subtitle {
    font-size: 14px;
  }

  .buttons-section {
    flex-direction: column;
    gap: 30px;
  }

  .icon-container {
    width: 100px;
    height: 100px;
    padding: 10px;
  }

  .icon-container img {
    width: 80px;
    height: 80px;
  }

  .button-label {
    font-size: 16px;
  }

  .back-button-container {
    top: 15px;
    left: 15px;
  }

  .back-button {
    width: 36px;
    height: 36px;
  }

  .back-button svg {
    width: 18px;
    height: 18px;
  }

  .global-csiro-logo {
    height: 40px;
    width: auto;
  }
}

@media (max-height: 600px) {
  .main-menu {
    gap: 20px;
    padding: 20px;
  }

  .header-section {
    gap: 10px;
  }

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

  .main-title {
    font-size: 28px;
    margin-bottom: 8px;
  }

  .subtitle {
    font-size: 14px;
  }

  .buttons-section {
    gap: 30px;
  }

  .icon-container {
    width: 100px;
    height: 100px;
    padding: 10px;
  }

  .icon-container img {
    width: 80px;
    height: 80px;
  }

  .button-label {
    font-size: 16px;
  }
}

/* ============================================================================
   SCENARIOS SUBMENU STYLES
   ============================================================================ */

/* Scenarios Submenu Container - Full screen overlay with split layout */
.scenarios-submenu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #f5f5f5;
  display: flex;
  z-index: 100;
}

.scenarios-submenu.hidden {
  display: none;
}

/* Left Sidebar - Domain selection panel */
.scenarios-sidebar {
  width: 340px;
  background-color: #ffffff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  padding: 80px 20px 20px;
  box-sizing: border-box;
  overflow-y: auto;
}

.scenarios-sidebar-header {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 20px;
  padding: 0 10px;
}

.domain-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.domain-button {
  width: 100%;
  padding: 16px 20px;
  background: #ffffff;
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 400;
  color: #333;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.domain-button:hover {
  background: #f9fafb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.domain-button.selected {
  border-color: #3b82f6;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

/* Right Main Area - Scenarios display */
.scenarios-main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 40px 40px;
  box-sizing: border-box;
  overflow-y: auto;
}

.scenarios-title {
  font-size: 46px;
  font-weight: 300;
  color: #333;
  margin: 0 0 40px 0;
}

.scenarios-content {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: 1200px;
  padding-top: 40px;
}

.scenario-cards-container {
  display: flex;
  gap: 40px;
  justify-content: center;
  align-items: center;
}

.scenario-card {
  width: 280px;
  min-height: 180px;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}

.scenario-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  border-color: #3b82f6;
}

.scenario-card-content {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  text-align: center;
  line-height: 1.4;
}

/* Responsive Design for Scenarios Submenu */
@media (max-width: 1200px) {
  .scenarios-sidebar {
    width: 280px;
    padding: 60px 15px 15px;
  }

  .scenarios-main-area {
    padding: 60px 30px 30px;
  }

  .scenarios-title {
    font-size: 36px;
    margin-bottom: 40px;
  }

  .scenario-cards-container {
    flex-direction: column;
    gap: 20px;
  }

  .scenario-card {
    width: 100%;
    max-width: 400px;
    min-height: 140px;
    padding: 18px;
  }

  .scenario-card-content {
    font-size: 15px;
  }
}

@media (max-width: 768px) {
  .scenarios-submenu {
    flex-direction: column;
  }

  .scenarios-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    padding: 60px 20px 20px;
    max-height: 250px;
  }

  .scenarios-sidebar-header {
    font-size: 16px;
    margin-bottom: 15px;
  }

  .domain-list {
    flex-direction: row;
    overflow-x: auto;
    gap: 10px;
  }

  .domain-button {
    min-width: 120px;
    padding: 12px 16px;
    font-size: 14px;
  }

  .scenarios-main-area {
    padding: 40px 20px 20px;
  }

  .scenarios-title {
    font-size: 28px;
    margin-bottom: 30px;
  }

  .scenario-cards-container {
    flex-direction: column;
    gap: 20px;
  }

  .scenario-card {
    width: 100%;
    max-width: 320px;
    min-height: 120px;
    padding: 16px;
  }

  .scenario-card-content {
    font-size: 14px;
  }
}
