/* header section */

header {
  display: flex;
  justify-content: space-between;
  background-color: #fff;
  padding: 15px 30px 15px 50px;
  margin-bottom: 15px;
  z-index: 1003;
}

body {
  font-family: Arial, sans-serif;
  background-color: #f5f5f5;
  margin: 0;
  padding: 0;
}

header {
  display: flex;
  flex-flow: row-reverse;
  background-color: #fff;
  padding: 15px 30px 15px 50px;
  margin-bottom: 50px;
  z-index: 1003;
}

h1 {
  font-size: 25px;
  margin: 0;
  flex: auto;
}

h3 {
  font-size: 12px;
  text-align: center;
  margin: 5px 2px 5px 2px;
}

.version {
  font-size: 15px;
  color: gray;
  display: flex;
  justify-content: left;
  margin-bottom: 5px;
}

.horzline {
  content: " ";
  display: block;
  border-top: 0.5px solid #111;
  width:100%!important;
}

.sidepanel  {
  width: 250px;
  position: fixed;
  z-index: 1;
  height: 0;
  top: 80px;
  background-color: rgb(230, 230, 230);
  overflow-x: hidden;
  transition: 0.5s;
  padding-top: 0;
  white-space: nowrap;
  
}

.sidepanel a {
  padding: 0px 8px 8px 30px;
  text-decoration: none;
  font-size: 18px;
  color: #5e5e5e;
  display: block;
  transition: 0.3s;
  
}

.sidepanel a:hover {
  color: #111;
  text-shadow: 0px 0px 1px black;
  transition-timing-function: ease-in-out;
  transition: 0.6s;
}

.sidepanel .closebtn {
  position: absolute;
  top: 0;
  right: 25px;
  font-size: 36px;
  text-align: left;
}

.openbtn {
  font-size: 20px;
  cursor: pointer;
  background-color: #111;
  color: white;
  padding: 10px 15px;
  border: none;
}

.openbtn:hover {
  background-color:#444;
}

.menu-height-1-line {
  padding: 10px 0px 10px 0px;
  height: 20px;
}

.menu-height-2-line {
  padding: 10px 0px 10px 0px;
  height: 40px;
}

/* Header Section End */

/* Page Header */

.page-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    justify-content: space-between;
}

.title-input {
  flex: 1;
  padding: 5px;
  border: none;
  font-size: 24px;
  font-weight: bold;
  background: none;
  outline: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.author-input {
  flex: 1;
  padding: 5px;
  border: none;
  font-size: 14px;
  background: none;
  outline: none;
  color: #666;
}

.title-author {
    display: flex;
    flex-direction: column;
  
}

.page-controls {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.page-indicator-num {
  width: 18px;
  text-align: center;
  font-size: 14px;
  font-weight: bold;
  padding: 5px;
  background: #d3d3d3;
  border-radius: 3px;
  margin-right: 5px;
}

.prev-nav,
.next-nav {
  display: flex;
  flex-direction: row;
  cursor: pointer;
}

.menu-icons {
    display: flex;
    justify-content: end;
    gap: 20px;
    flex: fit-content;
    margin-top: 30px;
}

.menu-icons span {
  cursor: pointer;
  display: flex;
  justify-content: center;
}

/* Page Header end */


.page-container {
  width: 90%;
  margin: auto;
  padding: 10px;
  background: none;
}

/* Storyboard Grid Layout */
.storyboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 10px;
}

/* Card Styling */
.card {
  background: white;
  padding: 10px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Image Upload Box - Fixed 16:9 Aspect Ratio */
.card-image {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.uploaded-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Hide "Click to Upload" in Print */
@media print {
  .image-placeholder {
    display: none !important;
  }
}

/* Card Header */
.card-header {
  display: flex;
  align-items: center;
  margin-top: 0px;
}

/* Fixed Card Number Grey Box */
.card-number {
  width: 18px;
  text-align: center;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  padding: 5px;
  background: #d3d3d3;
  border-radius: 3px;
  margin-right: 5px;
}

/* Card Title Input */
.card-title {
  flex: 1;
  padding: 5px;
  border: none;
  font-size: 16px;
  /* Fixed height and overflow handling */
  height: 40px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  outline: none !important;
}

/* Description Box */
.description {
  display: flex;
  align-items: center;
  margin-top: 10px;
}

.description-text {
  flex: 1;
  padding: 5px;
  border: none;
  font-size: 14px;
  resize: none;
  /* Fixed height with overflow hidden */
  height: 80px;
  overflow: hidden;
  white-space: normal;
  text-overflow: ellipsis;
  outline: none !important;
}

/* Hide Empty Titles & Descriptions in Print */
@media print {
  .card-title:empty, 
  .description-text:empty {
    display: none;
  }
}

/* Convert Inputs to Static Text in Print */
@media print {
  .card-title-static,
  .description-text-static {
    display: block !important;
    font-weight: normal;
    margin-bottom: 5px;
    color: black !important;
    white-space: pre-wrap;
  }
  /* Hide Inputs & Textareas in Print */
  .card-title,
  .description-text {
    display: none !important;
  }
}

/* Context Menu */
.context-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 30px;
  z-index: 1001;
}

.context-menu {
    display: none;
    position: absolute;
    bottom: 10px;
    right: 10px;
    border: 0.1px solid #111;
    background: rgb(244, 244, 244);
    padding: 5px;
    z-index: 1002;
    pointer-events: auto;

}

.context-menu-option {
    cursor: pointer;
    padding: 5px 5px;
    pointer-events: auto;
    font-size: 14px;
    display: flex;
    align-items: center;

}

.context-menu-option:hover {
  background-color: #eee;
}

.context-menu-text {
    display: flex;
    padding-left:10px;
}

.material-symbols-outlined {
    display: inline-flex;

}

/* REMOVE ARROWS ONLY IN PRINT */
@media print {
  .page-controls span {
    display: none !important;
  }
}
