/* Base Styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 20px;
  line-height: 1.6;
  background-color: #f4f1eb;
}

.container, .calculator-container, .typing-test-container {
  background-color: #fff;
  padding: 20px 25px; /* slightly more horizontal padding */
  border-radius: 10px;
  max-width: 1250px;
  margin: 10px auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

label {
  font-size: 16px;
  color: #5f4b3a;
  font-weight: 500;
  display: block;
  margin-bottom: 8px;
  cursor: pointer; /* add pointer for better UX */
}

/* Form Elements */
input, select, button, textarea {
  width: 100%;
  padding: 14px;
  margin: 8px 0;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid #d0b79b;
  background-color: #f8f4eb;
  box-sizing: border-box;
  transition: all 0.3s ease;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  border-color: #b3741e; /* darker gold-brown */
  background-color: #fff;
  box-shadow: 0 0 5px #b3741e;
  outline: none;
}

input[type="text"]:hover, .matrix-block input:hover,
input[type="text"]:focus, .matrix-block input:focus {
  border-color: #b3741e;
  box-shadow: 0 0 5px #b3741e;
  outline: none;
}

textarea {
  height: 300px;
  font-family: 'Courier New', Courier, monospace;
}

/* Buttons */
button, .reset-btn, .add-btn, .remove-row {
  color: white;
  border: none;
  border-radius: 8px;
  padding: 16px;
  font-size: 18px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
  margin-top: 20px;
}

button {
  background-color: #A52A2A;
}

button:hover {
  background-color: #704c29;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

button:focus, .reset-btn:focus, .add-btn:focus, .remove-row:focus {
  outline: 3px solid #f39c12; /* warm focus ring */
  outline-offset: 2px;
  box-shadow: 0 0 8px rgba(243, 156, 18, 0.6);
}

.reset-btn {
  background-color: #6c757d;
  font-size: 16px;
  padding: 14px 16px;
}

.reset-btn:hover {
  background-color: #495057;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.add-btn {
  background-color: #FF7F50;
  padding: 14px 16px;
}

.add-btn:hover {
  background-color: #FF8C00;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.remove-row {
  background-color: #d9534f;
  padding: 14px 16px;
}

.remove-row:hover {
  background-color: #c9302c;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Results and Feedback */
#result, #mergeMessage, #splitMessage, #areaOutput, #dimensionOutput, #summary, #output {
  margin-top: 5px;
  padding: 8px;
  background-color: #e1f7d5;
  border: 2px solid #4caf50;
  border-radius: 8px;
  font-weight: bold;
  color: #28a745;
  box-sizing: border-box;
  display: block;
  animation: fadeIn 0.5s ease-out;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.error {
  color: red;
  font-weight: bold;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Additional Layout */
.calculation-steps, .stats, .step {
  font-size: 14px;
  margin-top: 5px;
  padding: 8px;
  background-color: #f9f9f9;
  border-radius: 4px;
  color: #555;
  font-style: italic;
  box-sizing: border-box;
}

.stats p {
  margin: 5px 0;
}

#quote {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 20px;
  color: #333;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

th, td {
  border: 1px solid #ddd;
  padding: 12px;
  text-align: center;
}

th {
  background-color: #003d7a; /* darker blue for better contrast */
  color: white;
}

input[type="text"], .matrix-block input {
  width: 100%;
  padding: 8px;
  border: 1px solid #d0b79b;
  border-radius: 4px;
  text-align: center;
}

/* Quiz Styles */
.quiz-container {
  background-color: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 80%;
  max-width: 800px;
  margin: 20px auto;
}

h1 {
  font-size: 24px;
  text-align: center;
  color: #333;
  margin-bottom: 20px;
}

p.intro {
  font-size: 16px;
  margin-bottom: 20px;
  text-align: center;
}

form {
  display: flex;
  flex-direction: column;
}

.question {
  margin-bottom: 15px;
  font-size: 18px;
}

.question p {
  margin-bottom: 10px;
  font-weight: 600;
  color: #4a3d2a;
}


.feedback {
  font-size: 16px;
  font-weight: bold;
  margin-top: 5px;
  transition: all 0.3s ease-in-out;
  opacity: 0;
  animation: fadeIn 0.5s forwards;
}

.no-answer { color: #ff9900; }
.correct { color: #28a745; }
.wrong { color: #dc3545; }

.result {
  font-size: 18px;
  text-align: center;
  margin-top: 20px;
  background-color: #eafaf1;
  border: 1px solid #b5dfc1;
  padding: 12px;
  border-radius: 6px;
  color: #207a40;
  font-weight: bold;
}

/* Matrix & Graph */
.matrix-container {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.matrix-block {
  text-align: center;
  padding: 10px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.matrix-block table {
  margin-top: 10px;
  border-collapse: collapse;
}

.matrix-block td {
  padding: 5px;
}

.matrix-container select {
  width: 70px;
  padding: 8px;
}

.control-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

#graph-container {
  margin-top: 40px;
  width: 100%;
  max-width: 700px;
}

canvas {
  background: white;
  display: block;
  margin: 25px auto;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0,0,0,0.1);
  max-width: 100%;
}

/* Print Styles */
@media print {
  .container > h2,
  .container > .form-group,
  .container > .btn {
    display: none;
  }
  .result-table {
    display: block;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .container, .calculator-container {
    padding: 15px;
  }
  h2 { font-size: 24px; }
  label, input, select, button, textarea {
    font-size: 16px; /* increased for readability */
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .container, .calculator-container {
    width: 100%;
    padding: 10px;
  }
  button {
    padding: 14px;
    font-size: 18px; /* increased for better touch */
  }
}

/* Utility Classes */
.hidden { display: none; }
#insulationFields { display: none; }

/* Typing Test */
.typing-test-container {
  font-family: monospace;
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: 1.2px;
  padding: 20px;
  max-width: 800px;
  margin: 40px auto;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.typing-test-container button {
  width: auto;
  padding: 12px 25px;
  font-size: 16px;
  margin-top: 20px;
  background-color: #A52A2A;
}

.typing-test-container button:hover {
  background-color: #704c29;
  transform: translateY(-2px);
}

.mcq-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

.mcq-options li {
  margin: 0;
}

.mcq-option {
  display: flex;
  align-items: center;         /* ✅ Vertically align circle and text */
  gap: 8px;                    /* ✅ Space between circle and text */
  padding: 10px 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #f9f9f9;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.mcq-option:hover {
  background-color: #f0f0f0;
  border-color: #bbb;
}

.mcq-option input[type="radio"] {
  accent-color: #4caf50;       /* Optional: custom color for the circle */
  transform: scale(1.2);       /* Optional: make the circle bigger */
  cursor: pointer;
}
@media (max-width: 600px) {
  .mcq-options {
    flex-direction: column;
  }

  .mcq-option {
    width: 100%;
  }
}


/* End of CSS */
