/* CSS Variables */
html,
body {
  margin: 0px;
}
body {
  --background-primary: #fff;
  --font-color-primary: #333;
  --elevation-background: #f3f3f3;
  --link-color: #006eb8;
  --font-family-primary: 'Roboto', Arial;
  --handwriting-font: 'Homemade Apple', cursive;
  --primary-color: #1a73e8;
  --ink-color: #000f55;
  --bor-color: #FF00004D;
  --label-color: #333;
  --field-borders: #e0e0e0;
  --primary-button-bg: #1d1d1d;
  --primary-button-color: #eee;
  --font-color-delete: #dc3545;
  --delete-button-borders: #dc3545;

  width: 100%;
  overflow-x: hidden;
}
body.dark {
  --background-primary: #121212;
  --font-color-primary: #ccc;
  --elevation-background: #1d1d1d;
  --link-color: #09f;
  --label-color: #aaa;
  --field-borders: #222;
  --primary-button-bg: #eee;
  --primary-button-color: #111;
  --delete-button-borders: #e76f7b;
  --font-color-delete: #e76f7b;
}
@font-face {
  font-family: 'Hindi_Font';
  src: url(../fonts/QEVickyCaulfield.ttf);
}

@font-face {
  font-family: 'Hand_Font';
  src: url(../fonts/QEDaveMergens.ttf);
}
/* Default CSS Changes */
* {
  box-sizing: border-box;
}
body {
  /* Change this line */
  --handwriting-font: 'Hindi_Font', 'Roboto', Arial; 
  
  /* Keep the rest as is */
  --background-primary: #fff;
  /* ... */
}

body {
  background-color: var(--background-primary);
  color: var(--font-color-primary);
  padding: 100px 100px;
  font-size: 1.05rem;
  font-family: var(--font-family-primary);
}
a {
  text-decoration: none;
  color: var(--link-color);
}
section {
  padding: 20px 0px;
}
button {
  border: none;
  background-color: var(--elevation-background);
  color: var(--font-color-primary);
  border-radius: 6px;
  cursor: pointer;
  padding: 10px 20px;
}

h1 {
  font-size: 3rem;
}

label {
  color: var(--label-color);
  font-size: 0.75rem;
}

label.block {
  display: block;
  padding-bottom: 5px;
}

select {
  background: url('../images/dropdown.svg') no-repeat;
  background-position: calc(100% - 14px) center;
  border: none;
  color: #333;
  border-radius: 4px;
  font-size: 0.9rem;
  display: block;
  -moz-appearance: none;
  -webkit-appearance: none;
}

option {
  color: #333;
}

body.dark select {
  background: url('../images/dropdown-white.svg') no-repeat;
  background-position: calc(100% - 14px) center;
}

input {
  padding: 8px 13px;
  border-radius: 4px;
  border: 1px solid var(--elevation-background);
  color: var(--font-color-primary);
  background-color: transparent;
  display: block;
}
input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type='number'] {
  -moz-appearance: textfield !important;
  -webkit-appearance: none;
  width: 100%;
}

/* global classes */
ul.info-ul {
  padding-left: 20px;
}

ul.info-ul > li {
  padding: 5px 5px;
}

.shadow {
  box-shadow: 12px 12px 24px 0 rgba(0, 0, 0, 0.2);
}
.display-flex {
  display: flex;
}
.display-flex.padded-flex > div {
  padding: 0px 10px;
}
.display-flex.padded-flex > div:first-child {
  padding-left: unset;
}
.flex-1 {
  flex: 1;
}
.padding-around {
  padding-right: 30px;
  padding-left: 30px;
}
.padding-up-down {
  padding-top: 6px;
  padding-bottom: 7px;
}

/* Other Styles */
.generate-image-section {
  padding: 10px 10px;
  font-size: 1.2rem;
}
.generate-image-button {
  background-color: var(--primary-button-bg);
  color: var(--primary-button-color);
  font-size: 1rem;
}
.github-corner {
  position: absolute;
  top: 0;
  z-index: 99999;
  right: 0px;
}
body.dark .github-corner {
  filter: invert(100%);
}
.imp-button {
  color: var(--font-color-primary);
  border: 1px solid var(--font-color-primary);
}
.delete-button {
  color: var(--font-color-delete);
  border: 1px solid var(--delete-button-borders);
  background-color: var(--elevation-background);
}
.customization-col {
  padding: 0px 50px !important;
}

.left-margin-and-content {
  min-height: calc(100% - 50px);
}

.sponsor-name-section {
  padding: 50px 0px;
}
.sponsor-container {
  display: inline-block;
  color: var(--font-color-primary);
}
.sponsor-title {
  display: block;
  text-align: center;
  font-size: 1.6rem;
  font-weight: bold;
}

/* ================= PAGE ================= */

.page-a {
  width: 400px;
  height: calc(11.7 * 400px / 8.3);
  background: #fff;
  border: 2px solid rgba(255, 0, 0, 0.3);/*solid var(--elevation-background);*/
  font-size: 10pt;
  position: relative;
  font-family: var(--handwriting-font);
  color: var(--ink-color);
  line-height: 1.5em;
  overflow-y: auto;
  scrollbar-color: transparent;
  scrollbar-width: thin;
}

/* ================= REMOVE LINES ================= */

.page-a.lines .paper-content {
  background: none !important;
}

/* ================= LAYOUT ================= */

.left-margin-and-content {
  display: flex;
  flex: 1; /* Allows this middle section to grow */
  align-items: stretch; /* Ensures margins stretch to full height */
}

.page-a {
  display: flex;
  flex-direction: column; /* Stacks Top, Middle, and Bottom vertically */
  /* Keep your existing width/height/background */
}

/* ================= REAL MARGINS ================= */

.top-margin {
  height: 30px;
  border-bottom: 1px solid var(--bor-color);
  margin-right: 20px;
  margin-left: 20px;
  flex-shrink: 0;
  
}

.left-margin {
  width: 20px;
  border-right: 1px solid var(--bor-color);
  margin-right: 20px;
  
}
.Right-margin {
  width: 20px;
  border-right: 1px solid var(--bor-color);
  margin-right: 20px;
}
.bottom-margin {
  height: 40px;
  border-Top: 1px solid var(--bor-color);
  margin-right: 20px;
  margin-left: 20px;
  flex-shrink: 0;
}

/* ================= CONTENT ================= */

.paper-content {
  flex: 1;
  padding: 10px;
  margin: 0;

  line-height: 1.7;
  letter-spacing: 0.3px;

  outline: none;
  word-break: break-word;

  /* ✍️ handwriting feel */
  transform: rotate(-0.2deg);
}

/* ================= REMOVE OLD SYSTEM ================= */

.margined .paper-content {
  padding: 0;
}

.margined .left-margin {
  position: static;
  height: auto;
}

/* ================= OVERLAY ================= */

.overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: none;
}

.overlay.shadows {
  display: block;
  background: linear-gradient(
    rgba(0,0,0,0.03),
    rgba(0,0,0,0.08)
  );
}
/* OUTPUT */
.output {
  width: 100%;
  padding: 30px;
  white-space: nowrap;
  overflow-x: auto;
  border: 1px solid var(--elevation-background);
}
.output .close-button {
  position: absolute;
  right: -3px;
  top: -11px;
  border-radius: 100%;
  padding: 4px 10px;
  background-color: #333;
  color: #fff;
  font-size: 15pt;
  font-weight: bold;
}
.download-image-button {
  display: inline-block;
  text-align: center;
  margin-top: 10px;
  background-color: #1d1d1d;
  color: #ccc;
  font-weight: bold;
  font-size: 0.9rem;
  padding: 10px 15px;
  border-radius: 8px;
}
#download-as-pdf-button {
  display: none;
}
#download-as-pdf-button.show {
  display: inline-block;
}
#delete-all-button {
  display: none;
}
#delete-all-button.show {
  display: inline-block;
}
.output img {
  width: 300px;
  margin: 0px 10px;
}

#faq p {
  overflow-wrap: break-word;
  overflow: hidden;
  width: 100%;
}

#covid-donations ul li {
  padding: 5px 0px;
}

.donations-list {
  padding: 58px 0px;
  text-align: center;
}

@media (max-width: 768px) {
  body {
    padding: 100px 10px;
  }
  h1 {
    margin-top: 20px;
    font-size: 3rem;
  }
  .padding-around {
    padding-left: 5px;
    padding-right: 5px;
  }
  .display-flex.responsive-flex {
    flex-direction: column;
  }
  .customization-col {
    padding: 100px 5px !important;
  }
  .page-container {
    width: 100%;
    overflow-x: scroll;
  }

  .page-container-super {
    display: flex;
    flex-direction: column;
  }

  .output img {
    width: 200px;
    margin: 0px 10px;
  }

  .project-contributors {
    width: 100%;
    overflow-x: scroll;
    overflow-y: hidden;
    white-space: nowrap;
  }

  .contributor-profile {
    width: 7.5em;
    height: 150px;
  }

  .contributor-username {
    font-size: 9pt;
  }
}

fieldset {
  padding: 17px 20px;
  border-radius: 5px;
  border: 1px solid var(--field-borders);
  margin-top: 16px;
}

legend {
  font-size: 0.88rem;
  padding: 0px 6px;
  color: var(--font-color-primary);
}

select,
input {
  width: 100%;
  border: 1px solid var(--field-borders);
  padding: 10px;
  padding-right: 30px;
  color: var(--font-color-primary);
}

input[type='file']::-webkit-file-upload-button {
  display: none;
}
input[type='file']::before {
  content: 'Choose File';
  display: inline-block;
  background-color: var(--background-primary);
  white-space: nowrap;
  -webkit-user-select: none;
  cursor: pointer;
}

.postfix-input {
  position: relative;
}
.postfix-input label {
  display: block;
  margin-bottom: 5px;
}

.postfix-input::after {
  content: attr(data-postfix);
  position: absolute;
  right: 25px;
  bottom: 12px;
  font-size: 12px;
}

.upload-handwriting-container {
  margin-top: -10px;
}

.experimental {
  opacity: 0.8;
  cursor: not-allowed;
}

.category-grid {
  display: grid;
  grid-gap: 10px;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
}

.fade-in-dark,
.fade-in-light {
  transition: 0.3s ease;
}

@media (max-width: 768px) {
  .category-grid {
    grid-auto-flow: row;
    grid-auto-rows: 1fr;
  }
}

/*To generate margin between download as pdf and delete button in small screens*/
@media (max-width: 430px) {
  .delete-button {
    margin-top: 10px;
  }
}
