@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  font-family: 'Poppins', sans-serif;
  color: #333;
  display: flex;
  flex-direction: column;
  align-items: center;
}
body {
   background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
}
.calculator-container {
  width: 100%;
  max-width: 480px;
  padding: 2rem;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 32px rgba(0,0,0,0.12), 0 8px 16px rgba(0,0,0,0.08);
  margin: 5% 0;
}
header { text-align: center; margin-bottom: 1rem; }
header h1 { font-size: 1.5rem; font-weight: 600; color: #1a1a1a; }
.controls { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.control-key {
  flex: 1; padding: 0.5rem;
  background-color: #eaeaea; color: #333;
  border: none; border-radius: 6px;
  font-size: 0.875rem; cursor: pointer;
  transition: background-color 0.2s;
}
.control-key:active { background-color: #d4d4d4; }
.display {
  background-color: #f9f9f9; padding: 1rem;
  border-radius: 6px; margin-bottom: 1rem;
  box-shadow: inset 0 4px 8px rgba(0,0,0,0.04);
}
#history-panel {
  font-size: 0.75rem; max-height: 4rem;
  overflow-y: auto; padding: 0.5rem;
  background: #f0f0f0; border-radius: 4px;
  margin-bottom: 0.5rem;
}
#result { font-size: 2rem; text-align: right; color: #000; }
.buttons {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}
.buttons button {
  padding: 0.75rem; font-size: 0.875rem;
  border: none; border-radius: 3px;
  cursor: pointer; transition: transform 0.1s, background-color 0.2s;
}
.buttons button:active { transform: scale(0.95); }
.key-number { background-color: #fafafa; color: #333; }
.key-number:active { background-color: #eaeaea; }
.key-function { background-color: #e8f0fe; color: #1a73e8; }
.key-function:active { background-color: #d2e3fc; }
.key-equals { background-color: #1a73e8; color: #fff; }
.key-equals:active { background-color: #1558b0; }

/* Content Area Styling */
#content {
  max-width: 800px;
  background: #fff;
  padding: 2rem;
  margin: 2rem auto;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(0,0,0,0.1);
  line-height: 1.6;
  color: #444;
}
#content h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #222;
}
#content h2 {
  font-size: 1.75rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: #1a1a1a;
}
#content h3 {
  font-size: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: #333;
}
#content p {
  margin-bottom: 1rem;
}
#content ul, #content ol {
  margin: 1rem 0 1rem 1.5rem;
}
#content li {
  margin-bottom: 0.5rem;
}
#content blockquote {
  border-left: 4px solid #1a73e8;
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
  background-color: #f1f3f4;
  color: #555;
}
#content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}
#content table th, #content table td {
  border: 1px solid #ddd;
  padding: 0.75rem;
  text-align: left;
}
#content table th {
  background-color: #f0f0f0;
}
.hidden { display: none; }


@media (max-width: 768px) {
  main.calculator-container {
    box-sizing: border-box;
    padding: 20px;
  }

  body {
    display: block;
  }

  div#content {
    /* display: none; */
    max-width: 100%;
    padding: 0;
    margin: 0;
    box-shadow: none;
  }

  .buttons button {
    padding: 5px 8px;
  }
  /* Responsive Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0;
}
.table-responsive table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}
.table-responsive th,
.table-responsive td {
  border: 1px solid #ddd;
  padding: 0.75rem;
  text-align: left;
  white-space: nowrap;
}
.table-responsive th {
  background-color: #f0f0f0;
}
}