:root {
  --primary-color: #003366;
  --hover-color: #005599;
  --text-color: #222;
  --bg-color: #f9f9f9;
  --accent-bg: #eef0f3;
  --link-color: #ccc;
}

body {
  margin: 0;
  font-family: 'Futura', 'Jost', 'Gill Sans MT', 'Roboto', 'Trebuchet MS', sans-serif;
  font-size: clamp(14px, 1.5vw, 18px);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* Header */
.site-header {
  background-color: var(--primary-color);
  color: white;
  padding: 1rem 2rem 0.5rem 1.5rem;
  /*padding: clamp(0.75rem, 2vw, 1.5rem);
  flex-wrap: wrap;*/
  justify-content: space-between;
  /*position: sticky;*/
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
}

.logo {
  display: block;
  text-decoration: none;
  max-width: 180px;
  font-size: clamp(14px, 1.8vw, 18px);
  padding: 2px 15px 5px 2px;
  border-bottom: 1px solid #fff;
}

.logo a {
  color: white !important;
  text-decoration: none;
}

.logo a:visited,
.logo a:hover,
.logo a:active,
.logo a:focus {
  color: white !important;
  text-decoration: none;
}

.navigation {
  background-color: var(--accent-color);
  padding: 0.5rem 1rem;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  overflow-x: auto;
}

.navigation a {
  color: white;
  margin: 0 1rem;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.navigation a:hover {
  color: var(--secondary-color);
}

.navigation .active {
  color: var(--secondary-color);
  text-decoration: 2px solid #003366 underline;
}

.main-nav {
  width: 81%;
  display: flex;
  gap: 1.1rem;
  flex-wrap: nowrap;
  font-weight: bold;
  align-items: center;
  overflow-x: auto;
}

.main-nav a,
.dropbtn {
  color: white;
  background: none;
  border: none;
  font-family: inherit;
  font-size: clamp(14px, 1.5vw, 16px);
  cursor: pointer;
  padding: 0.7rem 0.5rem 0 0rem;
}

.main-nav a:focus-visible,
.dropbtn:focus-visible,
.sidebar a:focus-visible,
.calc-button:focus-visible {
  outline: 2px dashed var(--hover-color);
  outline-offset: 2px;
}

.dropdown {
  position: relative;
}

.dropdown-content {
  display: none;
  position: absolute;
  text-align: right;
  right: 18px;
  background-color: white;
  min-width: 300px;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
  z-index: 1;
  font-weight: bold;
}

.dropdown-content a {
  color: var(--primary-color);
  padding: 0.9rem 1rem;
  text-decoration: none;
  display: block;
  font-size: clamp(13px, 1.3vw, 15px);
}

/* Desktop dropdown hover - only for larger screens */
@media (min-width: 768px) {
  .dropdown:hover .dropdown-content {
    display: block;
  }
}

/* Responsive Navigation Styles */
/* Desktop Navigation - Default (768px and above) */
.desktop-nav {
  display: flex;
}

.mobile-menu {
  display: none;
}

/* Mobile Navigation - Screens smaller than 768px */
@media (max-width: 767px) {
  .site-header {
    padding: 1rem 1rem 0.5rem 1rem;
  }

  /* Hide desktop navigation on mobile */
  .desktop-nav,
  .main-nav {
    display: none !important;
  }

  /* Show mobile hamburger menu */
  .mobile-menu {
    display: block;
    position: relative;
  }

  /* Mobile hamburger button styling */
  .mobile-menu .dropbtn {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
  }

  /* Mobile dropdown content positioning */
  .mobile-menu .dropdown-content {
    display: none;
    /* Hidden by default, controlled by JavaScript */
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    min-width: 216px;
    max-width: 300px;
    background-color: white;
    box-shadow: 0px 7px 16px rgba(0, 0, 0, 0.2);
    border-radius: 0 0 8px 8px;
    z-index: 1000;
    text-align: left;
  }

  /* Mobile navigation links styling */
  .mobile-menu .dropdown-content a {
    color: var(--primary-color);
    padding: 1rem 1.5rem;
    text-decoration: none;
    display: block;
    font-size: 16px;
    font-weight: bold;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
  }

  .mobile-menu .dropdown-content a:hover {
    background-color: #f8f9fa;
    color: var(--hover-color);
    padding-left: 2rem;
  }

  .mobile-menu .dropdown-content a:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
  }
}

/* Layout */
.main-wrapper {
  display: flex;
  flex-direction: column;
  /*padding: clamp(0.5rem, 2vw, 2rem);*/
  padding: clamp(1.5rem, 2vw, 1rem);
  gap: 2rem;
}

@media (min-width: 768px) {
  .main-wrapper {
    flex-direction: row;
  }
}

.calculator-area {
  flex: 2;
  height: 441px;
  max-height: 441px;
  min-width: 281px;
  max-width: 567px;
  background: #fff;
  padding: 1.5rem;
  border: 2px solid #073366;
  background: linear-gradient(145deg, #f0f0f0, #ffffff);
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  position: relative;
  /*flex: 2;
  height: 441px;
  max-height: 441px;
  min-width: 370px;
  background: #fff;
  padding: 1.5rem;
  border: 2px solid #073366;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  overflow-y: auto;*/
}

.extra-tools {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  display: flex;
  gap: 1rem;
  z-index: 10;
}

.extra-link {
  color: #666;
  text-decoration: none;
  font-size: 12px;
  font-weight: normal;
  text-transform: lowercase;
  transition: color 0.3s ease;
  cursor: pointer;
}

.extra-link:hover {
  color: #003366;
  text-decoration: underline;
}

.calculator-area-right {
  flex: 2;
  margin-left: 2rem;
  background: #fff;
  padding: 2rem 2rem 1rem 2rem;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  background: linear-gradient(145deg, #f0f0f0, #ffffff);
}

.sidebar {
  background-color: var(--accent-bg);
  margin: 0.5rem;
  padding: 1rem 1rem 0rem 2rem;
  border: 2px solid #073366;
  border-radius: 10px;
}

.sidebar h3 {
  margin-top: 0;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
  text-decoration: 1px solid underline;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar li {
  margin-bottom: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
}

.sidebar a {
  color: var(--primary-color);
  text-decoration: none;
}

.sidebar a:hover {
  text-decoration: underline;
}

.sidebar li::after {
  content: attr(data-description);
  display: block;
  font-size: 0.9em;
  font-weight: normal;
  color: #555;
  margin-top: 0.25rem;
}

h1,
h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(18px, 2vw, 24px);
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
  color: var(--primary-color);
}

.small {
  font-size: 0.6em;
  font-weight: bold;
  color: #222;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}

.sublabel {
  font-size: 0.75em;
  color: #666;
  font-style: italic;
  margin-top: -11px;
  display: block;
}

.htitle-place {
  padding-top: 2rem;
  margin: 1rem 0 0 1.5rem;
  font-size: clamp(20px, 2vw, 28px);
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
  border: 2px solid #073366;
  /* Example border */
  border-radius: 10px;
  /* Adjust the radius for the desired roundness */
  background-color: white;
  padding: 0.5rem 2rem 0 0.5rem;
  /* top, right, bottom, left */
  display: inline-block;
  /* To fit the text's width */
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
  /* Example shadow */
}

.horizontal-line {
  width: 72%;
  margin: 0;
  padding-bottom: 1.8rem;
}

.two-column-list {
  columns: 2;
  -webkit-columns: 2;
  -moz-columns: 2;
  column-gap: 2rem;
  /* Optional: space between columns */
  list-style: disc inside;
  padding: 0;
  margin: 0;
}

.formula {
  font-size: clamp(16px, 1.6vw, 20px);
  font-style: italic;
  margin-bottom: 1rem;
}

.calc-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  /*gap: 0.25rem;*/
}

/* Input Container Styling */
.input-container {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  background-color: #fafafa;
  position: relative;
}

.input-container-label {
  position: absolute;
  top: -0.5rem;
  left: 1rem;
  background-color: #fafafa;
  padding: 0 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary-color);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.input-container .input-group {
  margin-bottom: 0.5rem;
}

.input-group label {
  font-weight: 600;
  text-shadow: 3px 3px 5px rgba(0, 0, 0, 0.5);
  /*margin-bottom: 0.25rem;*/
  text-align: left;
}

.input-group .input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding-bottom: 11px;
}

.input-group input {
  max-width: 56%;
  flex: 1;
  padding: 0.5rem 0.5rem 0.5rem 0.9rem;
  font-family: 'Futura', 'Jost', 'Gill Sans MT', 'Roboto', 'Trebuchet MS', sans-serif;
  font-size: 1.4rem;
  font-weight: bold;
  text-rendering: geometricPrecision;
  border: 2px solid #010d1b;
  border-radius: 0 0 1.8rem 0;
}

.input-group select {
  flex: 1;
  padding: 0.5rem 0.5rem 0.5rem 0.9rem;
  font-family: 'Futura', 'Jost', 'Gill Sans MT', 'Roboto', 'Trebuchet MS', sans-serif;
  font-size: 1.4rem;
  font-weight: bold;
  text-rendering: geometricPrecision;
  color: #073366;
  border-color: #073366;
  border-radius: 0 0 1.8rem 0;
}

.input-group textarea {
  max-width: 56%;
  flex: 1;
  padding: 0.5rem 0.5rem 0.5rem 0.9rem;
  font-family: 'Futura', 'Jost', 'Gill Sans MT', 'Roboto', 'Trebuchet MS', sans-serif;
  font-size: 1.4rem;
  font-weight: bold;
  text-rendering: geometricPrecision;
  border: 2px solid #010d1b;
  border-radius: 0 0 1.8rem 0;
  resize: vertical;
  min-height: 60px;
  color: var(--text-color);
  background-color: white;
}

.unit {
  color: #666;
  font-size: 0.9em;
}

.calc-button {
  padding: 0.75rem 1.5rem 0.6rem 1rem;
  font-family: inherit;
  font-size: clamp(18px, 1.5vw, 16px);
  letter-spacing: 0.05rem;
  font-weight: bold;
  text-shadow: 3px 3px 5px rgba(0, 0, 0, 0.5);
  background-color: #9fc0e6;
  color: var(--primary-color);
  border: 2px solid #010d1b;
  border-radius: 9px;
  cursor: pointer;
  width: fit-content;
  transition: background-color 0.7s ease;
}

.calc-button:hover {
  color: white;
  background-color: var(--primary-color);
}

.calculator-description {
  margin: 1rem 0;
  padding: 1rem 1.2rem;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-left: 4px solid var(--primary-color);
  border-radius: 0 8px 8px 0;
  color: #495057;
  font-size: 0.95em;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
  line-height: 1.6;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.calculator-description p {
  margin: 0;
  font-style: italic;
}

.result {
  font-weight: bold;
  font-size: clamp(16px, 1.6vw, 20px);
  text-shadow: 3px 3px 5px rgba(0, 0, 0, 0.5);
  margin-top: 1rem;
  overflow: visible;
}

#result-value {
  overflow: visible;
}

.output-group {
  margin-bottom: 0.5rem;
}

.output-group label {
  font-weight: bold;
}

.output-group span {
  margin-left: 1rem;
}

.site-footer {
  background-color: var(--primary-color);
  color: white;
  text-align: center;
  padding: 2rem 0 1rem 0;
  margin-top: 1rem;
}

.site-footer nav {
  margin-top: 0rem;
}

.site-footer a {
  color: var(--link-color);
  margin: 0 1rem;
  font-size: 0.9em;
}

.form-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: left;
  background: linear-gradient(145deg, #f0f0f0, #ffffff);
  border-radius: 1rem;
  /*padding: 1rem 1rem 1rem 2rem;*/
  /*box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);*/
}

.dropdown-box {
  position: relative;
}

.dropdown-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: #000204;
}

.search-input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #010d1b;
  border-radius: 0 1.8rem 0 0;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 1rem;
  font-weight: bold;
  color: #f9f9f9;
  background-color: #003366;
}

.options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 999;
  max-height: 300px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid;
  border-color: var(--primary-color);
  border-top: none;
  border-radius: 0 0 9px 9px;
  display: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.option {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  display: block;
}

.option:last-child {
  border-bottom: none;
}

.option:hover {
  background-color: #f0f0f0;
}

.submit-row {
  text-align: center;
  margin-top: 20px;
}

::placeholder {
  font-size: 1rem;
  color: #666;
  opacity: 1;
  /* Firefox */
}

::-ms-input-placeholder {
  /* Edge 12 -18 */
  font-size: 1rem;
  color: #666;
  opacity: 1;
  /* Firefox */
}

@media (max-width: 767px) {
  .site-header {
    padding: 1rem 1rem 0.5rem 0.5rem;
    flex-wrap: nowrap;
  }

  .main-nav {
    display: none !important;
  }

  .form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .htitle-place {
    margin: 0.5rem 0 0 0.5rem;
  }

  .main-wrapper {
    display: flex;
    flex-direction: column;
    padding: clamp(0.5rem, 2vw, 1rem);
  }

  .form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: left;
    background: white;
    border-radius: 1rem;
  }

  .calculator-area {
    padding: 0.5rem;
  }

  .dropdown-box {
    width: 100%;
    position: relative;
  }

  .search-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid;
    border-color: var(--primary-color);
    border-radius: 0 1.8rem 0 0;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 1.1rem;
  }

  .sidebar {
    padding: 0.5rem;
  }

  .sidebar h3 {
    line-height: 1.5rem;
  }
}

/* ========================================
   CALCULATOR STYLES FROM INDEX.PHP
   ======================================== */

.calculator-container {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  background-color: var(--bg-color);
  margin: 9px 20px 20px 29px;
}

/* Canvas Container */
.canvas-container {
  position: relative;
  background: white;
  border-radius: 15px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  padding: 20px;
  border: 3px solid var(--primary-color);
}

.canvas-controls {
  display: flex;
  gap: 11px;
  margin-bottom: 15px;
  justify-content: center;
}

.control-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.control-btn:hover {
  background: var(--hover-color);
}

.calculator {
  width: 450px;
  min-width: 333px;
  max-width: 450px;
  background: linear-gradient(145deg, #f0f0f0, #ffffff);
  border-radius: 12px;
  border: 2px solid #ddd;
  padding: 10px 10px 5px 10px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

.unified-display {
  height: 204px;
  /* Reduced by 15% from original combined height (120px + 9rem ≈ 264px) */
  border: 2px solid var(--primary-color);
  border-radius: 10px;
  margin-bottom: 15px;
  background-color: #f8f9fa;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.history-display {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 14px;
  color: #555;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  /* Align content to bottom */
  border-bottom: 0.5px solid #ccc;
}

.history-item {
  padding: 5px 0;
  border-bottom: 1px solid #e0e0e0;
  word-break: break-all;
}

.history-item:last-child {
  border-bottom: none;
}

.main-input {
  font-family: 'Futura', 'Jost', 'Gill Sans MT', 'Roboto', 'Trebuchet MS', sans-serif !important;
  font-size: 2.25rem;
  /* Reduced by 15% from original 3rem */
  font-weight: bold;
  text-align: right;
  padding: 18px 18px 2px 18px;
  /* Reduced by 15% from original 20px */
  border: none;
  /* background-color: #d3d5e2; */
  color: #2b2f2b;
  box-sizing: border-box;
  letter-spacing: 2px;
  text-shadow: 0 0 10px #ededf2;
  width: 100%;
  outline: none;
  overflow: hidden;
  white-space: nowrap;
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(5, 60px);
  gap: 12px;
}

.btn {
  height: 60px;
  border: none;
  border-radius: 9px;
  font-size: 1.5rem;
  font-weight: bold;
  font-family: 'Futura', 'Jost', 'Gill Sans MT', 'Roboto', 'Trebuchet MS', sans-serif !important;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-number {
  background-color: #f8f9fa;
  color: var(--primary-color);
  border: 2px solid #e9ecef;
}

.btn-number:hover {
  background-color: #e9ecef;
}

.btn-operator {
  background-color: var(--primary-color);
  color: white;
}

.btn-operator:hover {
  background-color: var(--hover-color);
}

.btn-secondary {
  background-color: #c32310;
  color: white;
}

.btn-secondary:hover {
  background-color: #8f1101;
}

.btn-equals {
  background-color: #28a745;
  color: white;
  font-size: 2rem !important;
  grid-column: 4;
  grid-row: 4 / 6 !important;
  height: auto !important;
}

.btn-equals:hover {
  background-color: #218838;
}

.btn-zero {
  grid-column: span 2;
}

/* Custom scrollbar for history */
.history-display::-webkit-scrollbar {
  width: 6px;
}

.history-display::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.history-display::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 3px;
}

.history-display::-webkit-scrollbar-thumb:hover {
  background: var(--hover-color);
}

/* ========================================
   CALCULATOR RESPONSIVE DESIGN
   ======================================== */

/* Responsive design for calculator */
@media (max-width: 480px) {
  .calculator-container {
    padding: 10px;
  }

  .canvas-container {
    padding: 15px;
  }

  .canvas-controls {
    gap: 8px;
  }

  .control-btn {
    padding: 6px 12px;
    font-size: 11px;
  }

  .calculator {
    width: 100%;
    padding: 15px;
  }

  .unified-display {
    height: 180px;
    /* Reduced proportionally for mobile */
  }

  .calculator {
    padding: 11px 7px 2px 7px;
  }

  .main-input {
    height: 4.1rem;
    font-size: 2rem;
    font-family: 'Futura', 'Jost', 'Gill Sans MT', 'Roboto', 'Trebuchet MS', sans-serif !important;
    padding: 11px 11px 0px 2px;
  }

  .calculator-container {
    margin: 3px 2px 20px 2px;
  }

  .two-column-list {
    columns: 1;
    -webkit-columns: 1;
    -moz-columns: 1;
  }

  .button-grid {
    grid-template-rows: repeat(5, 50px);
  }

  .btn {
    height: 50px;
    font-size: 1.2rem;
    font-family: 'Futura', 'Jost', 'Gill Sans MT', 'Roboto', 'Trebuchet MS', sans-serif !important;
  }

  .btn-equals {
    font-size: 2rem !important;
    grid-row: 4 / 6 !important;
    height: auto !important;
  }

  .legal-container {
    padding: 15px 25px 10px 20px;
    background: #f8f9fa;
  }
}

/* Color Display Styles */
.color-display-container {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.color-sample {
  width: 60px;
  height: 60px;
  border: 2px solid #333;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.color-values {
  font-family: 'Futura', 'Jost', 'Gill Sans MT', 'Roboto', 'Trebuchet MS', sans-serif;
  font-size: 0.9em;
  line-height: 1.4;
  color: #333;
}

.color-palette-container {
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.palette-display {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.palette-color {
  width: 40px;
  height: 40px;
  border: 2px solid #333;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.palette-color:hover {
  transform: scale(1.1);
}

.palette-values {
  font-family: 'Futura', 'Jost', 'Gill Sans MT', 'Roboto', 'Trebuchet MS', sans-serif;
  font-size: 0.85em;
  color: #333;
  word-break: break-all;
}

.color-list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.color-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px;
}

.color-sample-small {
  width: 30px;
  height: 30px;
  border: 2px solid #333;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.color-item span {
  font-family: 'Futura', 'Jost', 'Gill Sans MT', 'Roboto', 'Trebuchet MS', sans-serif;
  font-size: 0.9em;
  color: #333;
}

/* Enhanced textarea focus styles */
.input-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 5px rgba(0, 51, 102, 0.3);
}

/* Responsive styles for color displays */
@media (max-width: 768px) {
  .color-display-container {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .palette-display {
    justify-content: center;
  }

  .palette-color {
    width: 35px;
    height: 35px;
  }

  .color-sample {
    width: 50px;
    height: 50px;
  }

  .color-values,
  .palette-values {
    font-size: 0.8em;
  }

  .input-group textarea {
    max-width: 100%;
    font-size: 1.2rem;
  }

  .legal-container {
    padding: 25px 45px 15px 25px;
    background: #f8f9fa;
  }
}

.legal-container {
  padding: 50px 180px 15px 25px;
  background: #f8f9fa;
}

/* ===================================
   EVERYDAY CALCULATOR SPECIFIC STYLES
   =================================== */

/* Enhanced textarea styles for EVERYDAY Calculator */
.input-row textarea {
  width: 63%;
  padding: 12px 16px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  background-color: #ffffff;
  color: #333333;
  outline: none;
  transition: all 0.3s ease;
  resize: vertical;
  min-height: 45px;
  line-height: 1.4;
  box-sizing: border-box;
}

.input-row textarea:focus {
  border-color: #4a90e2;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
  background-color: #fafbfc;
}

.input-row textarea:hover {
  border-color: #c1c7cd;
}

.input-row textarea::placeholder {
  color: #8a9ba8;
  font-style: italic;
}

.input-row textarea:invalid {
  border-color: #e74c3c;
}

.input-row textarea:invalid:focus {
  border-color: #e74c3c;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Proper spacing for textarea inputs */
.input-group:has(textarea) {
  margin-bottom: 20px;
}

/* Sublabel styling for EVERYDAY Calculator */
.input-row .sublabel {
  color: #666;
  font-size: 12px;
  display: block;
  margin-top: 4px;
  line-height: 1.3;
  font-style: italic;
  width: 100%;
  clear: both;
}

/* Enhanced input row layout for sublabels */
.input-group .input-row {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
}

.input-row input,
.input-row select,
.input-row textarea {
  width: 54%;
  margin-bottom: 0;
  border: 2px solid #073366;
}

/* Force sublabels to be on new lines */
.input-row .sublabel {
  order: 2;
  align-self: flex-start;
  margin-left: 0;
  padding-left: 0;
}

/* Dark mode support for EVERYDAY Calculator */
@media (prefers-color-scheme: dark) {
  .input-row textarea {
    background-color: #2c3e50;
    border-color: #34495e;
    color: #ecf0f1;
  }

  .input-row textarea:focus {
    border-color: #3498db;
    background-color: #34495e;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
  }

  .input-row textarea::placeholder {
    color: #7f8c8d;
  }

  .input-row .sublabel {
    color: #95a5a6;
  }
}

/* Responsive adjustments for EVERYDAY Calculator */
@media (max-width: 768px) {
  .input-row textarea {
    font-size: 14px;
    padding: 10px 12px;
    min-height: 40px;
  }
}

/* Gradient Generator Styles */
.gradient-result {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-top: 10px;
}

.gradient-preview {
  border: 2px solid #ddd;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.gradient-code {
  margin-bottom: 15px;
}

.gradient-code label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.code-block {
  display: flex;
  align-items: center;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 12px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.code-block code {
  flex: 1;
  background: none;
  border: none;
  font-size: 14px;
  color: #495057;
}

.copy-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  margin-left: 10px;
  transition: background-color 0.3s ease;
}

.copy-btn:hover {
  background: var(--hover-color);
}

.color-info {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.color-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.color-sample-small {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid #ddd;
  display: inline-block;
}

/* Text Shadow Generator Styles */
.text-shadow-result {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-top: 10px;
}

.text-shadow-preview {
  border: 2px dashed #ccc;
}

.text-shadow-code {
  margin-bottom: 15px;
}

.text-shadow-code label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.shadow-details {
  color: #666;
  font-style: italic;
  text-align: center;
  margin-top: 10px;
}

/* Color List Container (existing color generators) */
.color-list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  background: #fff;
  border-radius: 8px;
  padding: 15px;
  border: 1px solid #ddd;
}

/* Responsive adjustments for new calculators */
@media (max-width: 768px) {

  .gradient-result,
  .text-shadow-result {
    padding: 15px;
  }

  .color-info {
    flex-direction: column;
    gap: 10px;
  }

  .code-block {
    flex-direction: column;
    gap: 10px;
  }

  .copy-btn {
    width: 100%;
    margin-left: 0;
  }

  .text-shadow-preview {
    font-size: 1.8em !important;
    padding: 20px 15px !important;
  }
}




@media (max-width: 375px) {
  .calculator-container {
    padding: 10px;
  }

  .canvas-container {
    padding: 15px;
  }

  .canvas-controls {
    gap: 8px;
  }

  .control-btn {
    padding: 6px 12px;
    font-size: 11px;
  }

  .calculator {
    width: 100%;
    padding: 15px;
  }

  .unified-display {
    height: 180px;
    /* Reduced proportionally for mobile */
  }

  .calculator {
    padding: 11px 7px 2px 7px;
  }

  .main-input {
    height: 4.1rem;
    font-size: 2rem;
    font-family: 'Futura', 'Jost', 'Gill Sans MT', 'Roboto', 'Trebuchet MS', sans-serif !important;
    padding: 11px 11px 0px 2px;
  }

  .calculator-container {
    margin: 3px 2px 20px 2px;
  }

  .two-column-list {
    columns: 1;
    -webkit-columns: 1;
    -moz-columns: 1;
  }

  .button-grid {
    grid-template-rows: repeat(5, 50px);
  }

  .btn {
    height: 50px;
    font-size: 1.2rem;
    font-family: 'Futura', 'Jost', 'Gill Sans MT', 'Roboto', 'Trebuchet MS', sans-serif !important;
  }

  .btn-equals {
    font-size: 2rem !important;
    grid-row: 4 / 6 !important;
    height: auto !important;
  }

  .legal-container {
    padding: 15px 25px 10px 20px;
    background: #f8f9fa;
  }
}

/* ===================================
   DIGITAL CALCULATOR SPECIFIC STYLES
   =================================== */

/* Text Shadow Generator Styles */
.text-shadow-container {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 12px;
  padding: 25px;
  margin: 15px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid #e1e8ed;
}

.text-shadow-preview {
  background: white;
  border-radius: 8px;
  padding: 30px 20px;
  margin-bottom: 20px;
  text-align: center;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.text-shadow-css {
  background: #2d3748;
  border-radius: 8px;
  padding: 20px;
  color: white;
}

.css-code-container {
  margin-bottom: 15px;
}

.css-code-container label {
  display: block;
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.css-code {
  background: #1a202c;
  border: 1px solid #4a5568;
  border-radius: 6px;
  padding: 15px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Courier New', monospace;
}

.css-code:hover {
  background: #2d3748;
  border-color: #63b3ed;
}

.css-code code {
  color: #90cdf4;
  font-size: 16px;
  word-break: break-all;
}

.copy-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.css-code:hover .copy-icon {
  opacity: 1;
}

.shadow-details {
  color: #a0aec0;
  font-size: 13px;
  line-height: 1.4;
}

/* Responsive adjustments for digital calculator */
@media (max-width: 768px) {
  .text-shadow-container {
    padding: 15px;
  }

  .text-shadow-preview h2 {
    font-size: 1.8rem !important;
  }

  .text-shadow-preview p {
    font-size: 1rem !important;
  }

  .css-code code {
    font-size: 14px;
  }
}


/* ===================================
   ALGEBRA CALCULATOR SPECIFIC STYLES
   =================================== */

/* Section header styles for algebra calculator dropdowns */
.section-header {
  font-weight: bold;
  background-color: #f0f0f0;
  color: #333;
  padding: 9px 11px;
  margin: 4px 0 2px 0;
  border-bottom: 1px solid #ddd;
  cursor: default;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Calculator option styles for algebra calculator dropdowns */
.calculator-option {
  padding-left: 16px;
}

.calculator-option:hover {
  background-color: #e8f4f8;
}

/* ===================================
   CONTACT FORM SPECIFIC STYLES
   =================================== */

.contact-container {
  max-width: 810px;
  margin: 50px auto;
  padding: 30px;
  background: #ffffff;
  border-radius: 11px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  font-family: 'Futura', 'Jost', 'Gill Sans MT', 'Roboto', 'Trebuchet MS', sans-serif;
}

.contact-container h1 {
  color: #2c3e50;
  text-align: center;
  margin-bottom: 10px;
  font-size: 2.5em;
}

.contact-container>p {
  text-align: center;
  color: #666;
  margin-bottom: 30px;
  font-size: 1em;
  line-height: 1.6;
}

.contact-container .form-group {
  margin-bottom: 20px;
}

.contact-container .form-group label {
  display: block;
  margin-bottom: 9px;
  font-weight: 600;
  color: #2c3e50;
  font-size: 1em;
}

.contact-container .form-group input,
.contact-container .form-group select,
.contact-container .form-group textarea {
  width: 50%;
  padding: 12px 16px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  background-color: #ffffff;
  color: #333333;
  outline: none;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.contact-container .form-group input:focus,
.contact-container .form-group select:focus,
.contact-container .form-group textarea:focus {
  border-color: #4a90e2;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
  background-color: #fafbfc;
}

.contact-container .form-group textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

.otp-container {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 10px;
}

.otp-input {
  width: 145px;
  flex: 1;
}

.send-otp-btn {
  width: 145px;
  max-width: 145px;
  background: #4a90e2;
  color: white;
  border: none;
  padding: 11px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Futura', 'Jost', 'Gill Sans MT', 'Roboto', 'Trebuchet MS', sans-serif;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.send-otp-btn:hover:not(:disabled) {
  background: #357abd;
  transform: translateY(-1px);
}

.send-otp-btn:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  transform: none;
}

.timer-display {
  font-size: 11px;
  color: #e74c3c;
  margin-left: 10px;
  font-weight: 600;
}

.checkbox-group {
  margin: 25px 0;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #4a90e2;
}

.checkbox-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 15px;
  gap: 12px;
}

.checkbox-item:last-child {
  margin-bottom: 0;
}

.checkbox-item input[type="checkbox"] {
  width: auto;
  margin: 0;
  min-width: 18px;
  height: 18px;
  margin-top: 2px;
}

.checkbox-item label {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #555;
  cursor: pointer;
  flex: 1;
}

.checkbox-item label a {
  color: #4a90e2;
  text-decoration: none;
  font-weight: 600;
}

.checkbox-item label a:hover {
  text-decoration: underline;
}

.contact-container .submit-btn {
  display: inline-block;
  font-family: 'Futura', 'Jost', 'Gill Sans MT', 'Roboto', 'Trebuchet MS', sans-serif;
  background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 600;
  transition: all 0.3s ease;
  margin-top: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.contact-container .submit-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #357abd 0%, #2c5f94 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(74, 144, 226, 0.3);
}

.contact-container .submit-btn:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.contact-container .error-message {
  color: #e74c3c;
  font-size: 14px;
  margin-top: 8px;
  display: none;
}

.contact-container .success-message {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
}

.required {
  color: #e74c3c;
}

.verification-status {
  display: inline-block;
  margin-left: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.verification-pending {
  background: #fff3cd;
  color: #856404;
}

.verification-success {
  background: #d4edda;
  color: #155724;
}

.verification-failed {
  background: #f8d7da;
  color: #721c24;
}

/* Responsive styles for contact form */
@media (max-width: 768px) {
  .contact-container {
    margin: 20px;
    padding: 20px;
  }

  .otp-container {
    flex-direction: column;
    align-items: stretch;
  }

  .send-otp-btn {
    margin-top: 10px;
  }
}

/* Category Header Styles */
.category-header {
  display: flex;
  gap: 2rem;
  align-items: center;
  padding: 0.5rem 0;
  /*justify-content: space-between;*/
  /* margin-bottom: 1.5rem; */
  /* border-bottom: 2px solid var(--primary-color); */
}

.category-header h2 {
  margin: 0;
  color: var(--primary-color);
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: bold;
}

.category-dropdown-box {
  display: flex;
  flex-direction: column;
  min-width: 200px;
}

.category-dropdown-box label {
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.category-select {
  padding: 8px 12px;
  border: 2px solid var(--primary-color);
  border-radius: 6px;
  background-color: white;
  font-family: inherit;
  font-size: 14px;
  font-weight: bold;
  color: var(--primary-color);
  cursor: pointer;
  transition: all 0.3s ease;
}

.category-select:hover {
  background-color: var(--accent-bg);
  border-color: var(--hover-color);
}

.category-select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.2);
  border-color: var(--hover-color);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .category-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .category-dropdown-box {
    min-width: auto;
    width: 100%;
  }
}

/* ===================================
   HOMEPAGE MOBILE SPECIFIC STYLES
   =================================== */

/* Homepage-specific mobile layout adjustments */
@media (max-width: 767px) {

  /* Hide the entire basic calculator container on mobile for homepage only */
  body.homepage-body .calculator {
    display: none !important;
  }

  /* Ensure the calculator-area-right takes full width on mobile when basic calc is hidden */
  body.homepage-body .calculator-container {
    justify-content: center;
  }

  body.homepage-body .calculator-area-right {
    margin-left: 0 !important;
    width: 100%;
    max-width: none;
  }
}

/* Default calculator link visibility for all pages */
.extra-tools a[href="#calculator"] {
  display: inline-block;
}

/* Desktop styles - hide calculator link only on homepage */
@media (min-width: 768px) {
  body.homepage-body .extra-tools a[href="#calculator"] {
    display: none;
  }
}

/* Mobile styles - show calculator link on all pages */
@media (max-width: 767px) {
  .extra-tools a[href="#calculator"] {
    display: inline-block;
  }

  .download-preview-container {
    padding: 0px !important;
  }

  .download-preview {
    padding: 0px !important;
  }

  .download-modal-body {
    padding: 2px !important;
  }

  .legal-container {
    padding: 10px !important;
  }

  /* Homepage-specific mobile styles */
  body.homepage-body .calculator-area-right {
    padding: 0px !important;
  }
}

/* reCAPTCHA Styling for DCalculator.net */
.recaptcha-wrapper {
  margin: 15px 0 !important;
  display: flex !important;
  justify-content: center !important;
  padding: 15px !important;
  border: 2px solid #e0e0e0 !important;
  border-radius: 8px !important;
  background-color: #fafafa !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.recaptcha-wrapper:hover {
  border-color: #003366 !important;
  box-shadow: 0 4px 8px rgba(0, 51, 102, 0.1) !important;
}

/* reCAPTCHA success state */
.recaptcha-wrapper.success {
  border-color: #28a745 !important;
  background-color: #d4edda !important;
}

/* reCAPTCHA error state */
.recaptcha-wrapper.error {
  border-color: #dc3545 !important;
  background-color: #f8d7da !important;
}

/* reCAPTCHA expired state */
.recaptcha-wrapper.expired {
  border-color: #ffc107 !important;
  background-color: #fff3cd !important;
}

/* reCAPTCHA container responsive design */
@media (max-width: 480px) {
  .recaptcha-wrapper {
    padding: 10px !important;
    margin: 10px 0 !important;
  }

  .recaptcha-wrapper>div {
    transform: scale(0.85);
    transform-origin: center;
  }
}

/* Form submission states when reCAPTCHA is required */
.calc-button:disabled,
.submit-button:disabled,
button[type="submit"]:disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  background-color: #6c757d !important;
}

.calc-button:disabled:hover,
.submit-button:disabled:hover,
button[type="submit"]:disabled:hover {
  background-color: #6c757d !important;
  transform: none !important;
}

/* reCAPTCHA loading indicator */
.recaptcha-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 78px;
  background-color: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  color: #6c757d;
  font-size: 14px;
}

.recaptcha-loading::after {
  content: "Loading reCAPTCHA...";
}

/* reCAPTCHA info message */
.recaptcha-info {
  margin: 10px 0;
  padding: 8px 12px;
  background-color: #e7f3ff;
  border: 1px solid #b3d9ff;
  border-radius: 4px;
  color: #004085;
  font-size: 13px;
  text-align: center;
}

/* High volume calculation notice */
.high-volume-notice {
  margin: 15px 0;
  padding: 12px 15px;
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  color: #856404;
  font-size: 14px;
  text-align: center;
}

.high-volume-notice strong {
  color: #664d03;
}

/* reCAPTCHA iframe styling override */
.g-recaptcha iframe {
  border-radius: 4px !important;
}