body {
  font-family: Arial, sans-serif;
  background: #0f172a;
  margin: 0;
  color: white;
  height: 100vh;
}

/* Container */
.big-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  text-align: center;
}

/* Tabs */
.tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  gap: 10px;
}

.tab {
  padding: 8px 15px;
  border-radius: 8px;
  border: none;
  background: #1e293b;
  color: white;
  cursor: pointer;
}

.tab.active {
  background: #38bdf8;
  color: black;
}

.hidden {
  display: none;
}

/* Truth Table */
table {
  margin: 20px auto;
  border-collapse: collapse;
  background: #1e293b;
  border-radius: 8px;
  overflow: hidden;
}

th,
td {
  padding: 10px 15px;
  border: 1px solid #334155;
  text-align: center;
}

th {
  background: #38bdf8;
  color: black;
}

tr:nth-child(even) {
  background: #0f172a;
}

/* Input */
.input-section {
  margin-bottom: 20px;
}

/* Input fields */
input {
  padding: 10px;
  width: 200px;
  border-radius: 8px;
  border: none;
  outline: none;
}

/* Buttons */
button {
  padding: 10px 15px;
  margin-left: 10px;
  border: none;
  background: #38bdf8;
  color: black;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
}

button:hover {
  background: #0ea5e9;
}

/* Variable selector */
.variable-selector {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.variable-selector label {
  font-weight: bold;
}

.variable-selector select {
  padding: 5px 10px;
  border-radius: 5px;
  border: none;
  background-color: #1e293b;
  color: #f1f5f9;
  font-size: 16px;
  cursor: pointer;
}

.custom-dropdown {
  position: relative;
  width: 120px;
  cursor: pointer;
  user-select: none;
}

.custom-dropdown .selected {
  padding: 6px 10px;
  border-radius: 5px;
  background: #1e293b;
  color: white;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.custom-dropdown .selected .arrow {
  font-size: 12px;
  margin-left: 10px;
}

.custom-dropdown .options {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #1e293b;
  border-radius: 5px;
  display: none;
  z-index: 100;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.custom-dropdown .options div {
  padding: 6px 10px;
}

.custom-dropdown .options div:hover {
  background: #334155;
}

/* K-map grid */
.kmap-container {
  display: grid;
  justify-content: center;
  margin: 20px 0;
}

/* For dynamic grid, we’ll override columns/rows in JS */
.kmap-row {
  display: flex;
  justify-content: center;
}

/* Cells */
.cell {
  width: 60px;
  height: 60px;
  margin: 2px;
  border-radius: 8px;
  background: #1e293b;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

.cell:hover {
  background: #334155;
}

/* Labels (if used) */
.label {
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  font-weight: bold;
}

/* Result area */
.result {
  margin-top: 20px;
}

.footer {
  margin-top: 30px;
  padding: 15px 0;
  text-align: center;
  background-color: #1e293b;
  color: #94a3b8;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

/* ----------------- Responsive ----------------- */

/* Tablets (up to 768px) */
@media (max-width: 768px) {
  body {
    height: auto;
    padding: 20px;
  }

  .big-container {
    flex-direction: column;
    align-items: center;
  }

  input {
    width: 150px;
    font-size: 14px;
  }

  button {
    padding: 8px 12px;
    margin-left: 5px;
    font-size: 14px;
  }

  .variable-selector {
    flex-direction: column;
    gap: 5px;
  }

  .cell {
    width: 60px;
    height: 60px;
    font-size: 16px;
  }

  .label {
    font-size: 14px;
  }

  .footer {
    font-size: 12px;
    padding: 10px 0;
  }
}

/* Phones (up to 480px) */
@media (max-width: 480px) {
  input {
    width: 120px;
    font-size: 13px;
  }

  button {
    padding: 6px 10px;
    font-size: 13px;
  }

  .cell {
    width: 50px;
    height: 50px;
    font-size: 14px;
  }

  .label {
    font-size: 12px;
  }

  .footer {
    font-size: 11px;
    padding: 8px 0;
  }
}
