/* /style/unit_converter.css */

.unit-converter-page {
  padding: 2rem;
  max-width: 860px;
  margin: auto;
  color: #f0f0f0;
  background-color: #1e1e1e;
  font-family: 'Segoe UI', sans-serif;
}

.unit-converter-page h1 {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 2rem;
}

/* Controls Panel */
.controls {
  background-color: #2b2b2b;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.control-group {
  margin-bottom: 1rem;
}

.control-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: bold;
}

.control-group select,
.control-group input,
.control-group textarea {
  width: 100%;
  padding: 0.6rem;
  background-color: #1a1a1a;
  color: #fff;
  border: 1px solid #444;
  border-radius: 6px;
  font-size: 1rem;
}

.control-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* Unit Row */
.unit-row {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.unit-row .control-group {
  flex: 1;
}

.swap-button-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Toggle Row */
.toggle-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.toggle-group input[type="checkbox"] {
  margin-right: 0.5rem;
  transform: scale(1.2);
}

/* Buttons */
.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.button-group button {
  flex: 1;
  padding: 0.6rem 1rem;
  background-color: #3a3a3a;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
}
.button-group button:hover {
  background-color: #555;
}

/* Result Output */
.result-area {
  margin-top: 2rem;
  background-color: #2b2b2b;
  border-radius: 12px;
  padding: 1rem;
}
.result-area h2 {
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
}
#resultOutput {
  font-size: 1.1rem;
  color: #aaffaa;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-y: auto;
  max-height: 250px;
  background-color: #1a1a1a;
  padding: 0.8rem;
  border-radius: 8px;
}

/* History */
.history-area {
  margin-top: 2rem;
  background-color: #2b2b2b;
  border-radius: 12px;
  padding: 1rem;
}
.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.history-header h2 {
  margin: 0;
  font-size: 1.2rem;
}
#clearHistoryBtn {
  background: #444;
  color: #fff;
  border: none;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
}
#clearHistoryBtn:hover {
  background: #666;
}
#conversionHistory {
  list-style: none;
  margin-top: 0.8rem;
  padding-left: 1rem;
  max-height: 200px;
  overflow-y: auto;
}
#conversionHistory li {
  margin-bottom: 0.5rem;
  color: #ccc;
  font-size: 0.95rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #3a3a3a;
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.95rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  z-index: 1000;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-10px);
}

/* Help Section */
.tool-section.how-to-use {
  margin-top: 3rem;
  padding: 1rem;
  border-top: 1px solid #444;
}
.tool-section.how-to-use h2 {
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
}
.tool-section.how-to-use ul {
  padding-left: 1.2rem;
}
.tool-section.how-to-use li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}
.tool-section.how-to-use li::marker {
  color: #888;
}

/* Styled Checkboxes */
.checkbox-wrapper {
  position: relative;
  padding-left: 28px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  font-size: 1rem;
  line-height: 100%;
  user-select: none;
}
.checkbox-wrapper input[type="checkbox"] {
  opacity: 0;
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  margin: 0;
}
.checkbox-wrapper .custom-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid #888;
  background-color: #1a1a1a;
  border-radius: 4px;
  display: inline-block;
  margin-right: 0.5rem;
  position: absolute;
  left: 0;
  top: 0;
}
.checkbox-wrapper input[type="checkbox"]:checked + .custom-checkbox {
  background-color: #4caf50;
  border-color: #4caf50;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='3.5 8.5 6.5 11.5 12.5 5.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px;
}

#swapUnits {
  font-size: 1.4rem;
  padding: 0.6rem 0.6rem;
  border: none;
  border-radius: 50%;
  background-color: #3d3d3d;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 0 4px rgba(0,0,0,0.4);
  transition: background-color 0.3s, transform 0.2s;
  line-height: 100%;
}
#swapUnits:hover {
  background-color: #5a5a5a;
  transform: rotate(180deg);
}

/* How to Use Section */
.tool-section.how-to-use {
  margin-top: 3rem;
  padding: 1.5rem;
  background-color: #2a2a2a;
  border-radius: 12px;
  border-top: 1px solid #444;
}
.tool-section.how-to-use h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}
.tool-section.how-to-use ul {
  padding-left: 1.2rem;
}
.tool-section.how-to-use li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}
.tool-section.how-to-use li::marker {
  color: #888;
}
