/* ========================================================================== */
/* BASE STYLES */
/* ========================================================================== */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f5f7fa;
  display: flex;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  font-size: 16px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ========================================================================== */
/* SIDEBAR */
/* ========================================================================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 200px;
  height: 100%;
  background: #4a90e2;
  padding: 20px 0;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  z-index: 1000;
}

.sidebar a {
  display: block;
  color: white;
  text-decoration: none;
  font-size: 16px;
  padding: 15px 20px;
  transition: background 0.3s;
}
.sidebar a:hover {
  background: rgba(255, 255, 255, 0.2);
}

.sidebar .app-download {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

.sidebar .app-download img {
  width: 120px;
}

/* Overlay for modal and mobile nav */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
  opacity: 0;
  transition: opacity 0.3s;
}
body.sidebar-open .sidebar-overlay {
  display: block;
  opacity: 1;
}

/* ========================================================================== */
/* CONTENT AREA */
/* ========================================================================== */
.content {
  flex: 1;
  margin-left: 200px;
  padding: 20px;
  transition: margin-left 0.3s ease;
}

/* ========================================================================== */
/* CARD COMPONENT */
.card {
  background: #fff;
  border-radius: 15px;
  padding: 20px;
  margin: 20px auto;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  max-width: 900px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ========================================================================== */
/* BUTTON */
.try-button {
  display: inline-block;
  padding: 12px 25px;
  background: #007bff;
  color: #fff;
  font-size: 16px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s;
}
.try-button:hover {
  background: #0056b3;
}

/* ========================================================================== */
/* TABLES */
.table-container {
  width: 100%;
  max-width: 900px;
  margin: 20px auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-container img {
  margin: 0 auto; /* centers block images */
  display: block; /* already set globally */
}
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}
th, td {
  border: 1px solid #e0e0e0;
  padding: 12px;
  text-align: center;
  word-break: break-word;
}
th {
  background: #f8f8f8;
  font-weight: bold;
}
tr:hover {
  background: #f0f0f0;
}

/* Remove table striping */
tr:nth-child(even), tr:nth-child(odd) {
  background: none;
}

/* Center headings */
#userstories h3,
#visualexamples h3 {
  text-align: center;
}

/* Widen stories and card boxes */
#userstories .story,
.cb-linkbox {
  max-width: 900px;
  margin: 0 auto 20px auto;
}

/* ========================================================================== */
/* MODAL */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal .container {
  background-color: #fff;
  border-radius: 10px;
  padding: 16px;
  width: min(92vw, 560px);
  max-height: 92dvh;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: auto; /* allow scroll if content gets taller than viewport */
}


.modal iframe {
  min-height: 640px;
  width: 100%;
  border: none;
  display: block;
  /* height will be set by JS based on the iframe document content */
  min-height: 520px; /* avoids a flash of tiny height before JS runs */
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: #ff4444;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 18px;
  line-height: 30px;
  text-align: center;
  cursor: pointer;
}
.close-btn:hover {
  background: #cc0000;
}

body.modal-open {
  overflow: hidden;
}

/* ========================================================================== */
/* HAMBURGER MENU (Mobile) */
/* ========================================================================== */
.hamburger {
  display: none;
  font-size: 28px;
  background: none;
  border: none;
  margin: 10px;
  color: #333;
  cursor: pointer;
  z-index: 3001;
}

@media (max-width: 768px) {
  body {
    font-size: 15px;
  }

  .hamburger {
    display: block;
  }

  .sidebar {
    left: -240px;
    width: 240px;
    transition: left 0.3s ease;
  }

  .sidebar.active {
    left: 0;
  }

  .content {
    margin-left: 0 !important;
    padding: 15px;
  }

  .sidebar-overlay {
    display: none;
  }

  body.sidebar-open .sidebar-overlay {
    display: block;
  }

  .table-container {
    max-width: 100%;
    margin: 10px auto;
  }

  th, td {
    padding: 8px;
    font-size: 0.85em;
  }

  .sidebar .app-download img {
    width: 100px;
    margin: 5px 0;
  }

  .table-of-images-container img {
    max-width: 100%;
    height: auto;
  }
  .card.introduction {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }

  .card.introduction h1,
  .card.introduction h2 {
    font-size: 1.5em;
    margin: 0;
  }
}
