body {
  margin: 0;
  padding: 20px;
  background-color: #f4f4f4;
  font-family: Arial, sans-serif;
  text-align: center;
}

h1 {
  margin-bottom: 30px;
  color: #333;
}

/* Başlık ve Sıfırla butonu düzeni */
.baslik-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

/* Başlık ortalanmış olacak */
.baslik-container h1 {
  margin: 0;
}

/* Sıfırla Butonu */
.sifirla-btn {
  position: absolute;
  top: 0%;
  transform: translateY(-50%);
  left: 50%;
  max-width: 80px;
  width: 100%;
  display: flex;
  justify-content: flex-start;
  padding-left: 0;
}

.sifirla-btn button {
  background-color: #dc3545;
  color: #fff;
  padding: 14px 20px;
  font-size: 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.sifirla-btn button:hover {
  background-color: #c82333;
}

/* Tablo Stili */
table {
  margin: 0 auto 24px;
  width: 100%;
  max-width: 1000px;
  border-collapse: separate;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

th, td {
  padding: 12px;
  border: 1px solid #928b8b1f;
  text-align: center;
}

th {
  background-color: #007BFF;
  color: #fff;
  font-size: 16px;
}

tr:nth-child(even) {
  background-color: #f9f9f9;
}

tr:hover {
  background-color: #f1f1f1;
}

/* ————— Desktop: bağımsız kolon genişlikleri ————— */
.table-container table {
  table-layout: auto;
}
table th:nth-child(1),
table td:nth-child(1) {
  width: 85%;
}
table th:nth-child(2),
table td:nth-child(2) {            
  width: 13%;
}
table th:nth-child(3),
table td:nth-child(3) {
  width: 20%;
}
.table-container td:nth-child(1) input[type="text"] {
  width: 100%;
  box-sizing: border-box;
}
.table-container td:nth-child(2) input[type="number"] {
  width: 77%;                   
  box-sizing: border-box;
  max-width: 80%;
}
.table-container td:nth-child(3) .not-secici {
  width: 101%;
  box-sizing: border-box;
}

/* Buton Konteyneri */
.btn-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

/* Genel Buton Stilleri */
button {
  background-color: #28a745;
  border: none;
  color: #fff;
  padding: 12px 18px;
  font-size: 16px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #218838;
}

/* "Geri Al" butonuna özel stil */
.restore-btn {
  background-color: orange;
  display: none;
}

.restore-btn:hover {
  background-color: darkorange;
}

/* Sonuç Yazısı Stili */
.result {
  margin-top: 20px;
  font-size: 22px;
  font-weight: bold;
  color: #333;
}

/* Input ve Select Alanları */
input, select {
  padding: 8px;
  border: 2px solid #ccc;
  border-radius: 5px;
  font-size: 16px;
  text-align: center;
  width: 86%;
  max-width: 63px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

input[type="text"] {
  max-width: 570px;
}

/* Sayısal inputların yukarı/aşağı oklarını kaldır */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield; /* Firefox için */
}

/* Kaldır Butonu */
.remove-btn {
  background-color: red;
  color: #fff;
  border: none;
  padding: 7px 7px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.remove-btn:hover {
  background-color: darkred;
}

/* Not Seçici */
.not-secici {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
}

.not-secici button {
  background-color: #0004ff00;
  border: none;
  color: #0056ff;
  padding: 6px 6px;
  margin: 2px 3;
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  line-height: 0.5;
}

.not-secici button:hover {
  background-color: #0056b3;
}

.not-secici input {
  width: 50px;
  padding: 6px;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: white;
}

.not-menusu {
  position: absolute;
  top: 100%;
  background-color: #fff;
  border: 1px solid #ccc;
  max-height: 150px;
  overflow-y: auto;
  z-index: 10;
  width: 80px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.not-menusu div {
  padding: 6px;
  cursor: pointer;
}

.not-menusu div:hover {
  background-color: #f0f0f0;
}

.arrow-buttons {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.arrow-btn {
  background-color: #28a745;
  border: none;
  color: white;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.arrow-btn:hover {
  background-color: #218838;
}

.baslik-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 30px;
}

.baslik-wrapper h1 {
  margin: 0 auto;
}

.sifirla-btn {
  position: absolute;
  left: 50%;
  transform: translateX(-300px);
  background-color: #dc3545;
  color: white;
  padding: 14px 20px;
  font-size: 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.sifirla-btn:hover {
  background-color: #c82333;
}

.restore-header {
  position: absolute;
  right: 49.5%;
  transform: translateX(300px);
  display: none;
  padding: 14px 19px;
  font-size: 16px;
  background-color: orange;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.restore-header:hover {
  background-color: darkorange;
}

/* Yeni sistem seçim modali */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: white;
  padding: 30px 40px;
  border-radius: 10px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.sistem-secimleri {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.modal-content button {
  padding: 10px 20px;
  font-size: 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background-color: #007BFF;
  color: white;
  transition: background-color 0.3s ease;
}

.modal-content button:disabled {
  background-color: #aaa;
  cursor: not-allowed;
}

/* Not Sistemi Seçim Ekranı */
.sistem-secimi-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sistem-secimi-kutu {
  background-color: #fff;
  padding: 30px;
  border-radius: 12px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.secenekler {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}

.sistem-btn {
  padding: 12px;
  border: 2px solid #007bff;
  border-radius: 8px;
  background-color: white;
  color: #007bff;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sistem-btn.selected {
  background-color: #007bff;
  color: white;
}

.onayla-btn {
  padding: 10px 20px;
  font-size: 16px;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.onayla-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .baslik-wrapper {
      flex-direction: column;
      gap: 10px;
  }
  .sifirla-btn,
  .restore-header {
      position: static;
      transform: none;
      margin-top: 10px;
  }
  table {
      font-size: 14px;
  }
  th, td {
      padding: 8px;
  }
  .btn-container {
      flex-direction: column;
      gap: 10px;
  }
}

@media (max-width: 480px) {
  input[type="text"], select, input[type="number"] {
      width: 70%;
      max-width: 100%;
  }
  .not-secici {
      display: flex;
      flex-direction: column;
      align-items: center;
  }
  .not-secici .arrow-btn:nth-child(1) {
      order: 0;
      margin-bottom: 4px;
  }
  .not-secici .not-input {
      order: 1;
  }
  .not-secici .arrow-btn:nth-child(3) {
      order: 2;
      margin-top: 4px;
  }
}

@media (max-width: 768px) {
  /* 1. Scroll kapsayıcısı: momentum scroll ve hafif çerçeve */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
  }
  /* WebKit scrollbar */
  .table-container::-webkit-scrollbar {
    height: 6px;
  }
  .table-container::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 3px;
  }
  /* Firefox scrollbar */
  .table-container {
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.2) transparent;
  }

  /* 2. Tablo düzeni: fixed layout, genişlik içeriğe göre */
  .table-container table {
    table-layout: fixed;
    width: auto;
    box-shadow: none;
    border-radius: 8px;
  }

  /* 3. Sütun genişlikleri */
  .table-container th:not(:first-child),
  .table-container td:not(:first-child) {
    width: 100px;
    min-width: 100px;
  }

  .table-container th:first-child,
  .table-container td:first-child {
    width: auto;
    min-width: 100px;
  }

  /* 4. Mobilde daha sıkı padding ve okunabilirlik için font küçültme */
  .table-container th,
  .table-container td {
    padding: 8px;
    font-size: 14px;
  }
}

.not-secici {
    position: relative;
    display: flex;
    align-items: center;
    
}

.not-input {
    width: 70px;
    text-align: center;
    padding: 5px;
    font-size: 16px;
    cursor: pointer;
}

.arrow-wrapper {
    display: flex;
    flex-direction: column;
    margin-left: 4px;
}

.arrow-btn {
    width: 20px;
    height: 20px;
    font-size: 12px;
    padding: 0;
    line-height: 1;
    cursor: pointer;
}

/* Mobilde oklar altlı üstlü ve sağda dursun */
@media (max-width: 768px) {
    .not-secici {
        flex-direction: row;
        align-items: center;
    }

    .arrow-wrapper {
        flex-direction: column;
        margin-left: 4px;
    }
}
