/* General Reset */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

body {
  line-height: 1.5;
  font-family: "Inter", 'Helvetica Neue', Arial, sans-serif;
  color: #444;
  background-color: #fefefe;
  font-size: 11pt;
}

strong {
  font-weight: bold;
}

/* --- Sticky footer with CSS Grid --- */
html            { height: 100%; }          /* ensure the viewport height is known */
body            {                           /* turn the whole page into a simple 3-row grid */
    display: grid;
    grid-template-rows: auto auto 1fr auto;      /* header … main (flexible) … footer  */
    min-height: 100vh;                      /* page is never shorter than the viewport */
    margin: 0;                              /* remove default body margin */
}

article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
  display: block;
}

ul, ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

a {
  color: #036;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Wrapper */
.wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px;
}

header {
  background-color: #ffffff;
  padding: 20px;
}

#header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}

header img {
  max-height: 123px;
}

header nav {
  border-radius: 14px;
  background-color: #F4784D;
  padding: 10px; /* Adds padding around the entire nav area */
  display: flex;
  justify-content: center; /* Centers the menu items horizontally */
  margin: 0 auto; /* Centers the entire nav element within the header */
  max-width: fit-content; /* Ensures nav doesn't stretch unnecessarily */
}

header nav ul {
  display: flex;
  gap: 2px;
  list-style: none; /* Removes default list styles */
  margin: 0;
  padding: 0;
}

header nav li {
  display: inline-block;
}

header nav a {
  color: white;
  padding: 10px 20px; /* Adds space inside each menu item */
  border-radius: 8px; /* Rounds individual links slightly */
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

header nav a:hover {
  /*background-color: #e44d26;*/ /* Darker background on hover */
  transform: scale(1.05); /* Slight zoom effect on hover */
}


/* Main Content */
main {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

main #drawbox_div {
  flex: 1;
}

main aside {
  background-color: #ffffff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
  flex: 1;
}

main #canvasDiv {
  border: 1px solid #000;
  width: 500px;
  height: 260px;
  box-shadow: 0 0 20px -5px #aaa;
}

main .tools {
  margin-top: 15px;
}

main .tools a {
  display: inline-block;
  padding: 5px;
  margin-right: 5px;
  background-color: #ffffff;
  color: #444;
  font-weight: bold;
  font-size: 0.9em;
  background-repeat: no-repeat;
  background-position: left center;
  padding-left: 36px;
  transition: background-color 0.3s ease;
}

#toolpaint {
  background-image: url('/images/pencil.svg');
}

#toolfill {
  background-image: url('/images/paint.svg');
}

#toolerase {
  background-image: url('/images/eraser.svg');
}

#clearcanvas {
  background-image: url('/images/clear.svg');
}

#sendcanvas {
  background-image: url('/images/recognize.svg');
}

/* Article */
main article {
  background-color: #ffffff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
  margin-top: 20px;
}


/*Header*/
h1, h2, h3, h4, h5, h6 {
  margin-top: 20px; /* Adds space above */
  margin-bottom: 10px; /* Keeps consistent spacing below */
  color: #333;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.75rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.2rem;
}


/* Horizontal Rule */
hr {
  border: none;
  border-top: 1px solid #ccc;
  margin: 20px 0;
  width: 100%;
  clear: both;
}


/* Footer */
footer {
  margin-top: 30px;
  text-align: center;
  padding: 10px;
  background-color: #f16529;
  color: #fff;
  font-size: 0.85em;
  flex-shrink: 0;
}

table {
  width: 100%;
  border-collapse: collapse; /* Ensures consistent spacing */
}

th, td {
  padding: 8px; /* Adds spacing inside table cells */
  border: none; /* Ensures borders remain invisible */
  text-align: left;
  vertical-align: middle; /* Proper row alignment */
}

/* Responsive Design */
@media screen and (max-width: 768px) {
  main {
    flex-direction: column;
  }

  main aside {
    order: 2;
  }

  #canvasDiv {
    order: 1;
    margin: 0 auto;
  }

  hr {
    margin: 20px auto;
    width: calc(100% - 40px);
  }
}

@media screen and (max-width: 480px) {
  .wrapper {
    padding: 10px;
  }

  header nav ul {
    flex-direction: column;
    gap: 10px;
  }

  header nav a {
    padding: 10px 20px;
    text-align: center;
  }

  #canvasDiv {
    width: 100%;
  }

  main article {
    font-size: 0.8em;
  }

  hr {
    margin: 10px auto;
  }
}

