/* ============================
   GLOBAL
============================ */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background: #f7f9fb;
  color: #333;
}

/* Spacing for small screens so content won't touch edges */
body, .tool-card, input, textarea, select {
  padding-left: 4px;
  padding-right: 4px;
}

/* ============================
   HEADER
============================ */
header {
  background: #4bc0c8;
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h2 {
  margin: 0;
}

header nav a {
  margin-left: 1rem;
  color: white;
  text-decoration: none;
  font-weight: 500;
}

header nav a:hover {
  text-decoration: underline;
}
.header-icon {
  width: 50px;          /* adjust as needed */
  height: 50px;
  vertical-align: middle; /* aligns the icon with text */
  margin-right: 6px;    /* space between icon and text */
}
/* ============================
   DARKMODE
============================ */
body.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
}

body.dark-mode header,
body.dark-mode footer,
body.dark-mode .tool-card {
  background-color: #1e1e1e;
  color: #e0e0e0;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea,
body.dark-mode button {
  background-color: #2c2c2c;
  color: #e0e0e0;
  border: 1px solid #555;
}

body.dark-mode button {
  background-color: #333;
  color: #fff;
}

body.dark-mode a {
  color: #80cbc4;
}

/* ============================
   GRID LAYOUT FOR TOOLS
============================ */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  padding: 20px;
}

/* ============================
   TOOL CARD
============================ */
.tool-card {
  background: white;
  padding: 18px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  width: 100%;
}

/* ============================
   FORM ELEMENTS
============================ */
.tool-card input,
.tool-card select,
.tool-card textarea,
.tool-card button {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  margin-bottom: 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.tool-card button {
  background: #4bc0c8;
  color: white;
  font-weight: bold;
  cursor: pointer;
  border: none;
}

.tool-card button:hover {
  opacity: 0.85;
}

/* ============================
   AREA CALCULATOR TABLE
============================ */
#area table {
  width: 100%;
  border-collapse: collapse;
}

#area th,
#area td {
  border: 1px solid #ddd;
  padding: 6px;
  text-align: center;
}

#area input {
  width: 95%;
}

.add-row-btn {
  background: #ffb74d;
  width: 100%;
  margin-top: 10px;
}

.add-row-btn {
  margin-bottom: 10px; /* space below the button before total */
}

#areaTotalDisplay {
  margin-top: 10px; /* space above total display */
}

@media print {
  #areaTotalDisplay {
    display: none;  /* hide on-screen total when printing */
  }
}

/* ============================
   SCIENTIFIC CALCULATOR
============================ */
#scientificCalcCard {
  width: 320px;
  margin: 0 auto;
}

.calculator-display {
  background: #eee;
  width: 100%;
  height: 60px;
  border-radius: 6px;
  text-align: right;
  padding: 15px;
  font-size: 1.4rem;
  margin-bottom: 10px;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.calc-grid button {
  padding: 17px;
  border-radius: 6px;
  background: #fafafa;
  border: 1px solid #bbb;
  font-size: 1.1rem;
  cursor: pointer;
}

.calc-grid button:hover {
  background: #e0e0e0;
}

/* Big = button */
.equal-btn {
  grid-column: span 2;
  background: #4bc0c8 !important;
  color: white;
}
/* Scientific Calculator Buttons */
#scientificCalcCard .calc-grid button {
  background-color: #4bc0c8;
  color: #fff;
  border: 1px solid #000;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
}

#scientificCalcCard .calc-grid .equal-btn {
  background-color: #000;
  color: #fff;

/* ============================
   OCR
============================ */
#ocrOutput {
  height: 120px;
  resize: none;
}
/* OCR */
#ocrFile {
  width: 100%;
  margin-bottom: 0.5rem;
}

#ocrOutput {
  width: 100%;
  height: 120px;
  padding: 0.5rem;
  resize: none;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

/* OCR button */
.ocr-btn {
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: #4bc0c8;
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 4px;
}

}

/* ============================
   ABOUT / CONTACT
============================ */
.about,
.contact {
  text-align: center;
  padding: 30px 10px;
}

/* ============================
   FOOTER
============================ */
footer {
  text-align: center;
  padding: 15px;
  background: #4bc0c8;
  color: white;
  margin-top: 20px;
}
.footer-icon {
  width: 50px;       /* width of the icon */
  height: 50px;      /* height of the icon */
  vertical-align: middle; /* aligns nicely with text */
  margin-right: 6px; /* space between icon and text */
}

/* ============================
   RESPONSIVE FIXES
============================ */
@media (max-width: 480px) {

  #scientificCalcCard {
    width: 100%;
    max-width: 320px;
  }

  .calculator-display {
    height: 55px;
    font-size: 1.2rem;
  }

  .calc-grid button {
    padding: 15px;
    font-size: 1rem;
  }

  #area input {
    width: 90%;
  }
}


