@import "theme-colors.css";

.final-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.prediction-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-tertiary);
  padding: 10px;
  border-radius: 12px;
  width: 100%;
  margin: 13px;
  margin-left: 10px;
  /*height: 44px;*/
  height: 70%;
}

.inputs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 6px 4%;
  border-radius: 6px;
  gap: 20%;
}

.input-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-primary);
  text-align: center;
}

.input-box input {
  padding: 4px 6px;
  border-radius: 4px;
  border: none;
  background: var(--popup-bg);
  color: var(--text-primary);
  width: 100%;
  text-align: center;
  height: 24px;
}

.add-btn {
  background: var(--bg-accent);   /* blue button */
  width: 30%;
  max-width: 100px;
  color: var(--text-primary);
  font-size: 18px;
  padding: 14px 14px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
}

.add-btn:hover {
  background: var(--bg-accent);
  filter: brightness(0.8);
}

.prediction-output {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  /*background: #444;   /* lighter than row */
  padding: 6px 4%;
  border-radius: 6px;
  color: var(--text-primary);
}

.prediction-output span {
  font-weight: bold;
  font-size: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.prediction-output > div {
  flex: 1;
  text-align: center;
}



/* Popup */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup.hidden {
  display: none;
}

.popup-content {
  background: var(--popup-bg);
  padding: 20px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.popup-content button {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  width: 110px;
}

#edit-btn { background: var(--bg-accent); color: var(--text-primary); }
#remove-btn { background: #dc3545; color: var(--text-primary); }
#cancel-btn { background: #6c757d; color: var(--text-primary); }

.popup-grade {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-primary);
  text-align: center;
}

.popup-weight, .popup-subject {
  font-size: 16px;
  color: var(--text-primary);
  text-align: center;
}

/* Grade buttons */
.edit-grade-btn.invisible {
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: none;
  cursor: pointer;
}

.edit-icon {
  position: absolute;
  top: -8px;
  right:-8px;
  font-size: 16px;
  color: var(--text-primary);
  font-weight: bold;
}

.grade-group {
  position: relative;
  cursor: pointer;
}

.add-to-subject-btn {
  background: var(--bg-accent);
  color: var(--text-primary);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.add-to-subject-btn:hover {
  background: var(--bg-accent);
  filter: brightness(1.1);
}

/* Grade styles */
.grade-group.predicted .grade,
.grade-group.predicted .weight {
  color: #abd2ff;
}

.grade-group.removed {
  opacity: 0.5;
}

.edit-icon svg {
  width: 12px;
  height: 12px;
  fill: var(--text-muted);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

input[type="number"], .grade-input {
  border: transparent solid 1px;
  color: var(--text-primary);
  font-size: 16px;
  text-align: center;
  outline: none;
  transition: all 0.2s;
}

input[type="number"]:hover, .grade-input:hover {
  filter: brightness(0.8);
}

input[type="number"]:focus, .grade-input:focus {
  border-color: var(--bg-accent);
  box-shadow: 0 0 6px var(--bg-accent);
}

input[type="number"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 768px) {

  .add-btn {
    width: 20%;
    max-width: 100px;
    padding: 14px 14px;
  }

  .prediction-output {
    font-size: 12px;
  }

  .input-box {
    font-size: 12px;
  }

  .final-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 93%;
    flex-wrap: wrap;
    gap: 10px;
    background: var(--bg-tertiary);
    height: 120px;
    border-radius: 12px;
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
  }

  .average-info {
    flex: 0 0 100%;
    height: 40px;
    background: transparent;
  }

  .prediction-row {
    flex: 1;
    height: 40px;
    background: transparent;
    margin: -3px;
  }

  /* Edit icon */
  .edit-icon {
    top: -6px;
    right:-6px;
    font-size: 14px;
  }

  .table {
    flex-direction: row;
    width: 95%;
    min-width: auto;
    height: auto;
    max-height: calc(100vh - 140px - 180px);
    overflow-y: auto;
  }
}