/*************************************************************
   All styles apply ONLY inside #pepdraw-container
**************************************************************/

/* Root block of PepDraw */
#pepdraw-container {
  /* You can add your own padding, background, font, etc. */
  font-family: Arial, sans-serif;
  background: transparent; /* or #FFF if needed */
  color: #2e2e2e;
  margin: 0;
  padding: 0;
}

/* Entire #forminput block */
#pepdraw-container #forminput {
  display: flex;          /* Enable flex container */
  flex-direction: column; /* Elements are arranged top to bottom */
  gap: 10px;              /* Spacing between label and input field */
  margin: 10px 0;         /* General margins around the form */
}

/* Label to make it block and separated from the field */
#pepdraw-container #forminput .label-block {
  display: block;
  font-weight: bold;
}

/* Block where the input field and button are side by side */
#pepdraw-container #forminput .input-row {
  display: flex;
  flex-direction: row;
  gap: 10px;             /* Spacing between field and button */
  align-items: center;   /* Vertical alignment to center */
}

/* Input field */
#pepdraw-container #forminput input[type="text"] {
  padding: 5px;
  font-size: 14px;
  box-sizing: border-box;
  flex: 1 1 auto;        /* Expand if needed */
  max-width: 600px;      /* Optional width limitation */
}

/* Button */
#pepdraw-container #forminput button {
  padding: 5px 10px;
  background-color: #095c8d;
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  flex: 0 0 auto;        /* Do not stretch the button */
}

/* Hover effect for button */
#pepdraw-container #forminput button:hover {
  background-color: #052d44;
}

/* On mobile: prevent wrapping so field and button stay in one line */
@media (max-width: 600px) {
  #pepdraw-container #forminput {
    flex-wrap: nowrap;       /* Prevent wrapping */
    width: 100%;             /* Expand to full width */
  }
  /* Input field shrinks to fit button */
  #pepdraw-container #forminput input[type="text"] {
    flex: 1 1 auto;          /* Allow shrinking/expanding */
    width: auto;             /* Remove fixed 400px */
    min-width: 0;            /* Allow shrinking if needed */
    margin-right: 0;         /* Remove if previously set */
  }
  #pepdraw-container #forminput button {
    flex: 0 0 auto;          /* Button does not shrink */
  }
}

/* General table styles inside PepDraw */
#pepdraw-container table {
  border-collapse: collapse;
}
#pepdraw-container td,
#pepdraw-container th {
  vertical-align: top;
  padding: 5px;
}

/* Override background and text for Natural Amino Acids */
#pepdraw-container tr.natural th {
  background-color: #4CAF50; /* Green */
  color: #fff;               /* White text */
}

/* Override background and text for Special Amino Acids */
#pepdraw-container tr.special th {
  background-color: #FFA500; /* Orange */
  color: #fff;               /* White text */
}

/* Amino acid keyboard */
#pepdraw-container .AA {
  width: 72px;
  height: 34px;
  background-color: #095c8d;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin: 2px;
  font-size: 14px;
}
#pepdraw-container .AA:hover {
  background-color: #052d44;
}

/* Table headers inside keypad */
#pepdraw-container fieldset {
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 10px;
}
#pepdraw-container legend {
  font-weight: bold;
  padding: 0 5px;
}
#pepdraw-container th {
  text-align: left;
  background-color: #2a5192;
  color: #fff;
}

/* Properties table */
#pepdraw-container #properties th {
  background-color: transparent; 
  color: #2e2e2e;
  font-weight: normal;
  font-size: 14px;
  padding: 3px;
}
#pepdraw-container #properties td {
  color: #2e2e2e;
  font-size: 14px;
  padding: 3px;
  word-wrap: break-word;
}

/* Peptide Structure header */
#pepdraw-container h1 {
  font-size: 20px;
  margin: 20px 0 10px 0;
  color: #13347f;
  font-weight: normal;
  border-bottom: 1px solid #cad8e8;
  padding-bottom: 5px;
}

/* Drawing block */
#pepdraw-container #drawing {
  background-color: #fff;
  text-align: center;
  padding: 20px 0;
  margin-bottom: 20px;
}
#pepdraw-container #drawing #pep {
  font-size: 16px;
  color: #2e2e2e;
}

/* Remove spinners in Chrome, Safari, Opera */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Remove spinners in Firefox */
input[type=number] {
  -moz-appearance: textfield; 
}

/* Flex container for responsive layout */
#pepdraw-responsive {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

/* Left column - keyboard */
#pepdraw-responsive #keypad {
  flex: 0 0 auto;
  margin-right: 1em;
}

/* Right column - properties */
#pepdraw-responsive #properties {
  flex: 1 1 auto;
}

/* On mobile devices – stack blocks vertically */
@media (max-width: 600px) {
  #pepdraw-responsive {
    flex-direction: column;
  }
  #pepdraw-responsive #keypad,
  #pepdraw-responsive #properties {
    width: 100%;
    margin-right: 0;
  }
}

@media (max-width: 600px) {
  /* Reduce button width */
  #pepdraw-container .AA {
    width: 60px;
    /* If needed, adjust height as well */
    /* height: 30px; */
  }
  /* Remove padding from table cells inside PepDraw container */
  #pepdraw-container td {
    padding: 0px;
  }
}

.label-block {
  display: block;
  margin-bottom: 5px; /* Adjusts spacing between label and input field */
}
