/* ============== FORM & INPUT STYLES ============== */
#formWrapper {
  font-family: 'Fredericka the Great', cursive;
  text-align: center;
  font-size: 28px;
  margin-top: 20px;
}
#formWrapper p{
    color:#000!important;
    font-family: Comic Sans MS!important;
    font-weight: bold!important;
}

/* The input box */
#inputNumber {
  font-family: 'Fredericka the Great', cursive;
  font-size: 24px;
  padding: 8px 12px;
  border: 2px solid #000;
  border-radius: 5px;
  width: 180px;
  text-align: center;
  color: #000 !important;
}

/* Generate button */
#btnGenerate {
  font-size: 26px;
  padding: 10px 20px;
  margin-left: 10px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  background: linear-gradient(45deg, #c0c0c0, #faf6f6);
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  transition: 0.4s;
  color: #000 !important;
}
#btnGenerate:hover {
  background-color: #d2cccc;
}

/* Error message */
#msgError {
  color: red;
  display: block;
  margin-top: 10px;
  font-size: 22px;
}

/* ============== TABLE CONTAINER ============== */
#containerTable {
  width: 720px;
  height: 1024px;
  margin: 20px auto;
  position: relative;
  background: url('mutiplication-table-sheet.png') no-repeat center center;
  background-size: cover;
  text-align: center;
  color: #000 !important;
}

/* Heading for the table */
#headingTable {
  font-family: 'Fredericka the Great', cursive;
  position: absolute;
  top: 1%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 25px;
  color: blue;
  text-decoration: underline;
  color: #000 !important;
}

/* Table styling */
#tableResult {
  font-family: 'Fredericka the Great', cursive;
  position: relative;
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 27px;
  line-height: 1.6;
  text-align: left;
  color: #000 !important;
  /* Table border */
  border: 2px solid #000;
  border-collapse: collapse;
}
#tableResult td {
  border: 1px solid #000;
  padding: 1px 20px; /* A little padding for aesthetics */
  text-align: center;
  color: #000 !important;
}

/* ============== DOWNLOAD BUTTONS ============== */
#sectionDownloads {
  text-align: center;
  margin-top: 20px;
}
#btnPdf,
#btnImg,
#btnPrint {
  display: none; /* Will show via JS after generation */
  font-size: 24px;
  padding: 8px 16px;
  margin: 0 10px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  /* Gradient background */
  background: linear-gradient(45deg, #035c74, #0a7e2d);
  color: #fff;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  transition: 0.4s;
}
#btnPdf:hover,
#btnImg:hover,
#btnPrint:hover {
  background: linear-gradient(45deg, #6dd5ed, #2193b0);
}

/* ============== RESPONSIVE SCALING ============== */
/* Only apply scaling on screens, not on print */
@media screen and (min-width:550px) and (max-width: 700px) { 
  #containerMain {
    transform: scale(0.8);
    transform-origin: top left;
    width: 200%; /* Compensates for the scaling effect */
    height: 200%; /* Ensures proper scaling */
  }
}
@media screen and (min-width:390px) and (max-width: 549px) {
  #containerMain {
    transform: scale(0.6);
    transform-origin: top left;
    width: 200%;
    height: 200%;
  }
}
@media screen and (max-width: 389px) {
  #containerMain {
    transform: scale(0.5);
    transform-origin: top left;
    width: 200%;
    height: 200%;
  }
}

/* For printing, remove scaling so it stays consistent on paper/PDF */
@media print {
  #containerMain {
    transform: none !important;
    width: auto !important;
    height: auto !important;
  }
}
