* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

header {
  height: 60px;
  flex-shrink: 0;
  background-color: #4a90e2;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

footer {
  height: 40px;
  flex-shrink: 0;
  background-color: #333;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  font-size: 12px;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 15px;
  background-color: #f5f5f5;
  overflow: hidden;
  gap: 15px;
}

.control-panel {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.content-container {
  flex: 1;
  background-color: white;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 10px;
  position: relative;
}

.item-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding-right: 5px;
}

.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid #eee;
  flex-shrink: 0;
}

.pagination-controls {
  display: flex;
  gap: 5px;
}

.page-btn {
  padding: 5px 10px;
  border: 1px solid #ddd;
  background-color: white;
  cursor: pointer;
  border-radius: 3px;
}

.page-btn.active {
  background-color: #4a90e2;
  color: white;
  border-color: #4a90e2;
}

.page-btn:disabled {
  background-color: #f9f9f9;
  color: #ccc;
  cursor: not-allowed;
}

.rows-per-page {
  font-size: 13px;
}

.button-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  padding: 8px 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s;
}

.btnx {
  background-color: #4caf50;
  color: white;
}

.btnx:disabled {
  background-color: #cccccc;
  color: #888888;
  cursor: not-allowed;
}

.search-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 5px;
}

.search-btn {
  background-color: #4a90e2;
  color: white;
  padding: 8px 15px;
}

.selectall-btn {
  background-color: #00b8be;
  color: white;
  padding: 8px 15px;
}

@media (max-width: 768px) {
  .button-container,
  .search-container {
    flex-direction: column;
  }

  .pagination-container {
    flex-direction: column;
    gap: 10px;
  }
}

.result-group {
  margin-bottom: 15px;
}

.result-group h4 {
  margin-bottom: 5px;
  border-bottom: 1px solid #eee;
}

.result-row {
  font-size: 12px;
  padding: 3px 0;
  display: flex;
  justify-content: space-between;
}

.result-success {
  color: green;
}

.result-error {
  color: red;
}

.spinner-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.8);
  z-index: 10;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 10px;
    gap: 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid #eee;
}

.item-details {
    flex: 1 1 260px;
    min-width: 0;
    line-height: 1.5;
}

.info {
  font-size: 12px;
  font-weight: 700;
}

.open-link-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 24px; /* long space on both sides, between details/button and button/checkbox */
    flex-shrink: 0;
}

.home-message, .env-label {
  font-weight: bold;
}

.env-label.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.open-link-btn, .show-btn {
    font-size: 12px;
    font-weight: bold;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background-color: #4a90e2;
    color: white;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease;
    margin: 5px;
}

.open-link-btn:hover, .show-btn:hover {
    background-color: #3a7bc8;
}

.checkbox-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.item-checkbox {
    width: 26px;
    height: 26px;
    cursor: pointer;
}

/* Responsive adjustments */
@media (min-width: 1400px) {
    .item {
        padding: 16px 20px;
    }
    .item-details {
        font-size: 12px;
    }
}
@media (max-width: 768px) {
    .item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .item-details {
        flex: 1 1 auto;
    }
    .open-link-container {
        margin: 0;
        justify-content: flex-start;
    }
    .checkbox-container {
        justify-content: flex-start;
    }
    .open-link-btn, .show-btn {
        width: 100%;
        padding: 10px;
    }
}
@media (max-width: 480px) {
    .item-details {
        font-size: 11px;
    }
    .item-checkbox {
        width: 22px;
        height: 22px;
    }
}

.modal-overlay {
  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;
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: white;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.modal-message {
  overflow-y: auto;
  flex: 1;
  margin-bottom: 15px;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #4caf50;
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2196f3;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.env-switch-container {
  display: flex;
  align-items: center;
  gap: 10px;
}