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: collapse;
  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: 8%;
}
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="text"] {
  width: 50px;
  max-width: 40px;
  box-sizing: border-box;
  padding: 8px 6px;
  text-align: center;
}
.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-top: 20px;
  margin-bottom: 24px;
}

/* Genel Buton Stilleri */
button {
  background-color: #00a2e8;
  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: #28a745;
}

/* "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: #fe7f27;
  color: #fff;
  border: none;
  padding: 7px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  white-space: nowrap;     /* Yazı + simge tek satırda kalır */
  width: auto;             /* Buton içeriğe göre genişlesin */
  min-width: 80px;         /* Gerekirse sabit minimum genişlik */
  display: inline-flex;    /* Yazı + ikon yatay hizalanır */
  align-items: center;     /* Dikey ortalama */
  justify-content: center; /* Ortala */
  gap: 6px;                /* Yazı ile simge arasında boşluk */
}

.remove-btn:hover {
  background-color: #f27824;
}

/* 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: 28px;
  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: 430px;
  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; /*28a745*/
  border-radius: 8px;
  background-color: white;
  color: #007bff;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sistem-btn.selected {
  background-color: #28a745;
  color: white;
  border-color: #28a745;
}

.sistem-btn:not(.selected):hover {
  background-color: #007bff;
  color: white;
}

.sistem-btn.selected:hover {
  background-color: #28a745;
  color: white;
}

.onayla-btn {
  padding: 10px 20px;
  font-size: 16px;
  background-color: #028ac5;
  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: 480px) {
  input[type="text"], select, input[type="number"] {
      width: 49.5%;
      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;
  }
  /* Mobil: Ders Adı input’unun başlangıç ve maksimum genişliği */
  .table-container td:nth-child(1) input[type="text"] {
  width: 95px;             /* Başlangıç genişliği */
  min-width: 95px;
  max-width: 300px;         /* En fazla 300px */
  transition: width 0.2s ease;
  box-sizing: content-box;  /* scrollWidth hesaba katılsın */
  }
}

@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;
  }

    
  /* 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;
    white-space: nowrap
  }
  /* 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: 20px;
  }

  .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 {
        flex-direction: row;
        justify-content: center;  /* ortalamak istersen */
    }

    .arrow-wrapper {
        flex-direction: column;
        margin-left: 4px;
    } 
    .not-secici .not-input {
    order: 0;                 /* önce input */
    flex: 1;                  /* kalan alana yayılabilir */
  }
  .not-secici .arrow-wrapper {
    order: 1;                 /* sonra oklar */
    margin-left: 8px;         /* input ile arada boşluk */
    display: flex;
    flex-direction: column;   /* yukarı/aşağı okları dikey tutar */
    gap: 4px;
  }
    /* Not sütununu genişlet */
  .table-container th:nth-child(3),
  .table-container td:nth-child(3) {
    width: 60%;      /* İhtiyaca göre %60’ı ayarlayabilirsiniz */
    min-width: 80px;
  }
  /* İşlem sütununu daralt */
  /* İşlem sütununu daha da daralt */
.table-container th:nth-child(4),
.table-container td:nth-child(4) {
  width: 14%;
  min-width: 38px;
  padding: 4px;
  text-align: center;
}
  /* Not input’unu sütuna göre tam genişlikte yap */
  .table-container td:nth-child(3) .not-secici,
  .table-container td:nth-child(3) .not-input {
    width: 100%;
    box-sizing: border-box;
  }
    
  .remove-btn {
  font-size: 14px;
  padding: 6px 8px;
  min-width: auto;
  white-space: nowrap;
  gap: 4px;
  }
}

.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;
}

input[type="number"].zero-value {
  color: #999;
}

#notSecimModal .modal-content {
  max-height: 80vh;
  overflow-y: auto;
}

#notSecimModal .modal-content button.varsayilan-btn {
  width: 90px;                       /* Normal seçeneklerin 2 katı */
  background-color: orange !important;/* “Geri Al” butonuyla aynı renk */
  color: white !important;
}

#notSecenekleri button {
  padding: 10px 14px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#notSecenekleri button:hover {
  background-color: #0056b3;
}

tr.dragging {
  opacity: 0.5;
  background-color: #ccc;
}

.drag-col {
  width: 40px;
}

.bottom-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.bottom-btn {
  padding: 14px 20px;
  font-size: 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: auto; /* otomatik genişlik */
  min-width: 120px; /* istersen minimum sabitle */
}

.bottom-btn:hover {
  opacity: 0.9;
}

.bottom-btn.restore-btn {
  background-color: #fe7f27;
  color: white;
  display: none;
}

.bottom-btn.yinele-btn {
  background-color: #fe7f27;
  color: white;
  display: none;
}

.bottom-btn:first-child {
  background-color: #fe7f27;
  color: white;
}

.drag-header-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 0;
}

.drag-header-icon span {
  display: block;
  width: 16px;
  height: 2.5px;
  background-color: white; /* Başlık alanı mavi olduğu için beyaz */
  border-radius: 1px;
}

body.gecikmeli-giris * {
  visibility: hidden;
}

.footer-credit {
  font-size: 1rem;
  margin-top: -1em;   /* üst boşluk */
  margin-bottom: 2em;  /* alt boşluk: tabloya biraz mesafe */
  text-align: center;
}

/* Üç çizgiden oluşan drag-handle */
.drag-handle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;       /* Çizgiler arasındaki dikey boşluk */
  cursor: grab;
  opacity: 0.8;
  margin: auto;
}

/* Normalde açık el */
.drag-handle {
  cursor: grab;
}

/* Mousel-down / drag-start sırasında kapalı el */
.drag-handle:active,
.dragging .drag-handle {
  cursor: grabbing;
}

.drag-handle span {
  display: block;
  width: 16px;    /* çizgi uzunluğu */
  height: 2.5px;    /* çizgi kalınlığı */
  background-color: gray;
  border-radius: 1px;
}

.buton-ikon {
  margin-left: 8px;
  font-weight: bold;
  font-size: 1.1em;
}

button .buton-ikon {
  display: inline-block;
  margin-left: 8px;
  vertical-align: middle;
  font-weight: bold;
  font-size: 1.1em;
  line-height: 1;
}
