body {
  font-family: Plus Jakarta Sans;
  background-color: #f0f2f5;
  margin: 0;
  color: #333;
}

html.modal-open {
  overflow: hidden;
}

.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

.inner-section {
  max-width: 1200px;
  margin: 0 auto;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.grid-wrapper-two-columns {
  display: flex;
  gap: 30px;
}

.col-6 {
  flex: 1;
  min-width: 0;
}

.grid-wrapper {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.col-12 {
  width: 100%;
}

@media (max-width: 860px) {
  body {
    padding: 10px;
    font-size: 14px; 
  }

  .inner-section {
    padding: 15px; 
  }

  .grid-wrapper-two-columns {
    flex-direction: column;
    gap: 20px; 
  }

  .grid-wrapper {
    flex-direction: column; 
    gap: 10px; 
  }

  .col-6 {
    width: 100%; 
  }

  
  input#autocomplete {
    width: calc(100% - 55px) !important; 
  }

  .reset-button {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  
  .compress-wrapper {
    flex-direction: row; 
    align-items: center; 
    justify-content: flex-start; 
    gap: 8px; 
  }

  .compress-wrapper .button-label {
    margin-left: 0; 
    text-align: left;
    width: auto; 
    font-size: 14px; 
  }

  .switch {
    margin-right: 0; 
  }

  
  .grid-wrapper .col-6:has(#downloadBtn),
  .grid-wrapper .col-6:has(#downloadWebpBtn) {
    width: 100%; 
  }

  .button, .button-secondary {
    padding: 10px 12px; 
    font-size: 14px; 
  }

  .button svg {
    width: 16px;
    height: 16px;
  }

  
  #image-table {
    border: 1px solid #e2e8f0; 
    border-radius: 8px;
    overflow: hidden; 
    table-layout: auto; 
  }

  #image-table thead {
    display: none; 
  }

  #image-table tr {
    display: block; 
    margin-bottom: 15px; 
    border: 1px solid #e2e8f0; 
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    background-color: #fff;
  }

  #image-table tr:hover {
    background-color: #fff; 
  }

  #image-table td {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    position: relative;
    border-bottom: 1px dotted #e2e8f0; 
    padding: 8px 15px; 
    font-size: 13px;
    white-space: normal; 
  }

  #image-table td:last-child {
    border-bottom: none; 
  }

  #image-table td::before {
    content: attr(data-label); 
    position: static; 
    width: auto; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    color: #64748b;
    text-align: left; 
    font-size: 13px;
  }

  
  #image-table td{
    gap: 8px; 
    align-items: flex-start;
  }

  
  #image-table td::before{
    white-space: normal;   
    flex: 1 1 auto;        
    min-width: 0;
  }

  
  #image-table td .table-tag{
  
    max-width: auto;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-left: auto;     
  }

  
  #image-table td[data-label="Thumbnail"] .table-tag{
    max-width: 100%;
  }
}

input[type="text"], textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus, textarea:focus {
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
  outline: none;
}

input[readonly] {
  background-color: #f8f8f8;
  cursor: not-allowed;
}

textarea#photoDescription {
  height: 90px;
}

.button, .button-secondary {
  width: 100%;
  background-color: #0f172a;
  color: #fff;
  border: none;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s ease;
  font-family: 'Plus Jakarta Sans', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.button:hover {
  background-color: #1e293b;
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.button:disabled {
  background-color: #94a3b8;
  cursor: not-allowed;
}

.button-icon {
  width: 20px;
  height: 20px;
  color: currentColor;
}

.reset-button {
  background-color: #fff;
  border: 1px solid #ccc;
  color: #555;
  padding: 0;
  width: 45px;
  height: 45px;
  font-size: 24px;
  border-radius: 6px;
  position: absolute;
  right: 0;
  top: 0;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
}

.reset-button:hover {
  background-color: #f4f4f4;
  border-color: #bbb;
}

.dropzone {
  border: 2px dashed #ccc;
  padding: 24px;
  background-color: #f9f9f9;
  text-align: center;
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.2s, border-color 0.2s;
}

.dropzone p {
  margin: 0;
  font-size: 16px;
  color: #555;
  font-weight: 600;
}

.dropzone.dragover {
  background-color: #e9eef5;
  border-color: #0f172a;
}

.compress-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 30px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #E2E8F0;
  transition: 0.1s;
  border-radius: 30px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  border-radius: 50%;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.2s;
}

.switch input:checked + .slider {
  background-color: #b5f34d;
}

.switch input:checked + .slider:before {
  transform: translateX(26px);
}

.button-label {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-left: 5px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

#image-table-section {
  margin-top: 30px;
}

.table-container {
  max-height: 1500px;
  overflow-y: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#image-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  table-layout: fixed; 
}

#image-table thead {
  background-color: #f8fafc;
}

#image-table th, #image-table td {
  padding: 9px 9px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

#image-table th {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  color: #64748b;
}

#image-table tbody tr:hover {
  background-color: #f8fafc;
}

#image-table .thumbnail {
  width: 90px;
  height: 90px;
  object-fit: cover;
  padding: 0;
  border-radius: 6px;
  background-color: #f0f2f5;
}

#image-table .filename-col strong {
  display: block;
  color: #333;
  font-weight: 700;
  font-size: 14px;
}

#image-table .filename-col .file-type {
  display: block;
  color: #64748b;
  font-size: 12px;
}

.table-tag {
  display: inline-block; 
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  margin: 2px 0;
  white-space: nowrap;     
  overflow: hidden;        
  text-overflow: ellipsis; 
  box-sizing: border-box;
  text-align: left;
  max-width: 100%;         
}

#image-table td[data-label="Image Title"] .table-tag,
#image-table td[data-label="Image Description"] .table-tag {
  
  max-width: 170px;        
  white-space: nowrap;     
  overflow: hidden;        
  text-overflow: ellipsis; 
  margin-right: 0;         
}

#image-table td[data-label="Coordinates"] .table-tag {
   
    max-width: auto;         
    white-space: nowrap;     
    overflow: hidden;        
    text-overflow: ellipsis; 
    text-align: right;
    margin-right: 0;         
}

.coord-tag {
  background-color: #e3d0ff;
  color: #4a008a;
  font-weight: 700;
  font-size: 13px;
}

.documentname-tag {
  background-color: #b3e7ff;
  color: #00568a;
  font-weight: 700;
  font-size: 13px;
}

.description-tag {
  background-color: #ffc9ff;
  color: #8a008a;
  font-weight: 700;
  font-size: 13px;
}

.action-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.btn-edit, .btn-delete {
  background-color: transparent;
  border: 1px solid transparent;
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
}

.btn-edit svg,
.btn-delete svg {
  width: 18px;
  height: 18px;
  color: #64748b;
}

.btn-edit:hover {
  background-color: transparent;
  border-color: #93c5fd;
}

.btn-delete:hover {
  background-color: transparent;
  border-color: #fca5a5;
}

.btn-edit:hover svg {
  color: #2563eb;
}

.btn-delete:hover svg {
  color: #ef4444;
}

#no-images-message {
  text-align: center;
  padding: 40px;
  color: #64748b;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 9999 !important;
}

.modal-backdrop:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.some-other-section {
    z-index: 1 !important;  
  }

.modal-content {
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  transform: scale(0.95);
  transition: transform 0.3s ease;
  position: relative;
  z-index: 9999 !important;
}

.modal-backdrop:not(.hidden) .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.modal-header h4 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #333;
}

.close-button {
  background: none;
  border: none;
  font-size: 32px;
  cursor: pointer;
  color: #94a3b8;
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.close-button:hover {
  color: #333;
  background-color: #f0f2f5;
}

.modal-body label {
  display: block;
  margin-top: 16px;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 14px;
  color: #333;
}

.modal-body input[type="text"],
.modal-body textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: none;
}

  .modal-body input[type="text"]:focus,
  .modal-body textarea:focus {
    border-color: #0f172a;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
    outline: none;
  }

  .field-hint {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
    margin-bottom: 10px;
  }

  .modal-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
  }

  .modal-footer .button, .modal-footer .button-secondary {
    width: auto;
    padding: 10px 20px;
  }

  
  .hidden {
    display: none !important;
  }