/* General container styling */
#opinion-container,
#container-misljenja {
  margin-top: 28px;
  max-width: 80%;
  margin-bottom: 72px;
  width: 100%;
}

label {
  margin: 0;
}

/* Navbar (header) styling */
.navbar-dark.bg-dark {
  background-color: #033e7c !important;
  color: white !important;
}

.navbar-dark .navbar-nav .nav-link {
  color: white !important;
}

.navbar-dark .navbar-nav .nav-link:hover {
  font-weight: 600;
}

.breadcrup {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  padding-top: 12px;
  padding-bottom: 12px;
}

.breadcrup a {
  color: white;
}

.breadcrup a:hover {
  text-decoration: none;
  font-weight: 500;
}

.breadcrup p {
  margin: 0;
  font-weight: bold;
}

/* Footer styling */
footer {
  left: 0;
  right: 0;
  position: fixed;
  padding: 10px;
  bottom: 0;
  width: 100%;
  background-color: #033e7c;
  color: white;
  align-items: center;
  display: flex;
  justify-content: center;
}

.footer-details {
  font-size: 14px;
}

.footer-details p,
.footer-details p a {
  margin: 0 auto;
  text-decoration: none;
  color: white;
}

.footer-details p:first-of-type a {
  width: min-content;
}

/* General button styling */
.primary-button {
  padding: 10px 16px;
  font-size: 16px;
  border-radius: 5px;
  background: #033e7c;
  color: #fff;
  border: 1px solid #033e7c;
  width: fit-content;
  height: max-content;
}

.primary-button:hover {
  background-color: #0254a2;
  border-color: #0254a2;
}
.edit-button-container {
  display: flex;
  margin-top: 16px;
  align-self: end;
}

.secondary-button {
  padding: 10px 16px;
  font-size: 16px;
  border-radius: 5px;
  background: #6c757d;
  color: #fff;
  border: 1px solid #6c757d;
  width: max-content;
}

.secondary-button:hover {
  background-color: #5a6268;
  border-color: #5a6268;
}

button:focus {
  outline: none;
}

/* Opinion CRUD container styling */
.opinion-crud-container {
  border: 1px solid #ced4da;
  border-radius: 5px;
  padding: 36px 32px;
}

/* Divider styling */
.divider {
  width: 100%;
  height: 1px;
  background: #dee2e6;
  margin: 20px 0px;
}

/* Main container for the opinion upload section */
.opinion-upload-section {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  margin-top: 20px;
}

/* Container for the file upload section */
.file-upload-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: space-between;
  height: 100%;
}

/* Container for opinion type radio selection */
.opinion-type-selection {
  display: flex;
  gap: 4px;
  flex-direction: column;
}

/* Styling for radio buttons */
#opinion-radio,
#recommendation-radio,
#yes-radio,
#no-radio {
  accent-color: #033e7c;
}

/* Opinion attributes section */
.opinion-attributes-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.attributes-container {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.attribute-row {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.attribute-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.additional-docs-section {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.additional-docs-section p {
  margin-bottom: 0px;
}

.additional-docs-title span {
  font-weight: 400;
  font-size: 12px;
}

.no-docs-para {
  font-size: 12px;
  color: #aaaaaa;
}

/* Input and select styling for uniform height */
.attribute-label {
  margin: 0;
}

.attribute-input,
.attribute-select {
  width: 100%;
  border-radius: 5px;
  border: 1px solid #ced4da;
  padding: 8px 12px;
  height: 46px;
  box-sizing: border-box;
}

.attribute-textarea {
  width: 100%;
  border-radius: 5px;
  border: 1px solid #ced4da;
  padding: 8px 12px;
  box-sizing: border-box;
  resize: none;
}

.attribute-input::placeholder {
  color: #999;
}

.attribute-input:focus-visible,
.attribute-select:focus-visible,
.attribute-textarea:focus-visible {
  outline: none;
}

.form-control:focus {
  box-shadow: none !important;
  border: 1px solid #ced4da !important;
}

/* Multilingual section styling */
.multilingual-section {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
}

.multilingual-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Wrapper for the table to enable horizontal scrolling */
.geographic-names-table-section {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  border: 1px solid #ddd;
  border-radius: 5px;
  margin-bottom: 16px;
}

/* Table styling for Geographic Names */
.geographic-names-table-section {
  border: 1px solid #ddd;
  border-radius: 5px;
}

.misljenje-td {
  text-align: center !important;
  vertical-align: middle !important;
}

.geographic-names-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 5px;
  overflow: hidden;
}

/* Header styling */
.geographic-names-table th,
.geographic-names-table td {
  padding: 12px 8px;
  text-align: left;
}

.geographic-names-table th {
  background-color: #f9f9f9;
  font-weight: bold;
  color: #333;
  border-bottom: 1px solid #ddd;
}

/* Cell styling */
.geographic-names-table td {
  color: #555;
  border-bottom: 1px solid #ddd;
}

.table-cell {
  border: 1px solid #ddd; /* Add borders for all cells */
  padding: 12px 8px;
  text-align: left;
}

/* Alerts */
.no-display {
  display: none;
}

/* Search container */
.search-misljenje-container {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.input-misljenja {
  width: 100%;
  border-radius: 5px;
  border: 1px solid #ced4da;
  padding: 10px 12px;
}

.input-misljenja:focus-visible {
  outline: none;
}

.add-new-misljenje-btn {
  padding: 10px 16px;
  font-size: 16px;
  border-radius: 5px;
  border: 1px solid #033e7c;
  background: #033e7c;
  color: #fff;
  flex-shrink: 0;
  width: fit-content;
  height: max-content;
}

.add-new-misljenje-btn:focus {
  outline: none;
}

.add-new-misljenje-btn:hover {
  background-color: #0254a2;
  color: #fff;
  text-decoration: none;
}

/* Uploaded PDF file styling */
.file-display {
  display: none;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  display: none;
}

.loaded-misljenje-file {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  padding-right: 16px;
  gap: 8px;
  max-width: 100%;
}

.attacked-file {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.attacked-file-icon {
  height: 24px;
  width: 24px;
}

.delete-file-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

.delete-file-button img {
  width: 14px;
  height: 14px;
}

.delete-file-button:focus {
  outline: none;
}

/* ADDITIONAL DOCS */
/* Additional documents container - hidden by default */
#uploaded-docs-list {
  display: none;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 120px;
}

#existing-docs-list {
  display: none;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 120px;
}

/* Styling for each uploaded additional document */
.uploaded-doc {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  gap: 4px;
}

.uploaded-doc-details {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 90%;
}

.uploaded-doc-icon {
  height: 24px;
  width: 24px;
}

.attacked-file-name {
  margin: 0;
  font-size: 16px;
  text-overflow: ellipsis;
  overflow: hidden;
  text-decoration: underline;
  cursor: pointer;
  white-space: nowrap;
  color: #212529;
}

.attacked-file-name:hover {
  color: #033e7c;
}

.delete-file-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

.delete-file-button img {
  width: 14px;
  height: 14px;
}

.delete-file-button:focus {
  outline: none;
}

/* Submit buttons container styling */
.submit-buttons-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  justify-content: end;
}

.delete-button {
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 5px;
  background: #dc3545; /* Bootstrap's "danger" color */
  color: #fff;
  border: 1px solid #dc3545;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: max-content;
}

.delete-button:hover {
  background: #c82333; /* Slightly darker shade */
  border-color: #bd2130;
}

.delete-button:focus {
  outline: none;
}

.edit-button {
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 5px;
  background: #0254a2;
  color: #fff;
  border: 1px solid #0254a2;
  margin-right: 8px;
  cursor: pointer;
}

.edit-button:hover {
  background-color: #033e7c;
  border-color: #033e7c;
}

/* Update table cell styling to accommodate both buttons */
.geographic-names-table td:last-child {
  white-space: nowrap;
  min-width: 140px;
}

.required-fields-paragraph {
  color: #ff0000;
  font-size: 12px;
  margin-bottom: 0px;
  text-align: right;
}

.geo-ime-err-paragraph {
  color: #ff0000;
  font-size: 12px;
  margin-bottom: 0px;
  text-align: right;
}

/* filter section */

.table-filter-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.date-range-container {
  position: relative;
  display: flex;
  align-items: center;
}
#clear-date-range {
  position: absolute;
  right: 0px;
  font-size: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 400;
  margin-right: 8px;
  padding-right: 0px;
  height: 100%;
  background: none;
  border: none;
  display: none;
}
#clear-date-range span {
  height: 74%;
  color: #666666;
}

.attribute-label .date-range-label {
  font-size: 12px;
  color: #aaaaaa;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .geographic-names-table th,
  .geographic-names-table td {
    font-size: 14px;
    padding: 8px;
  }
  .filter-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .geographic-names-table-section {
    border: none;
  }
  .geographic-names-table {
    display: block;
    border: 0;
  }

  .geographic-names-table tbody {
    display: block;
  }

  .geographic-names-table tr {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
  }

  .geographic-names-table td {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    text-align: left;
    gap: 10px;
  }

  .geographic-names-table td::before {
    content: attr(data-label);
    font-weight: bold;
    color: #333;
    width: 50%;
    flex-shrink: 0;
  }

  .geographic-names-table th {
    display: none; /* Hide table headers */
  }
}

/* Responsive adjustments */
@media (max-width: 1023px) {
  footer {
    justify-content: center;
  }
  .footer-details {
    flex-basis: 40%;
    text-align: center;
    font-size: 10px;
  }
  .opinion-attributes-section,
  .search-misljenje-container {
    flex-direction: column;
  }
  .file-upload-section {
    margin-top: 24px;
  }
  #uploaded-docs-list {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .file-upload-section,
  .multilingual-section,
  .opinion-upload-section {
    display: flex;
    flex-direction: column;
    margin-top: 0px;
    width: 100%;
  }

  .opinion-type-selection {
    width: 100%;
  }

  .submit-buttons-container {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }

  #opinion-container,
  #container-misljenja {
    max-width: 95%;
  }
}

@media (max-width: 576px) {
  #opinion-container {
    padding: 16px;
  }

  .attributes-container {
    grid-template-columns: 1fr;
  }

  .breadcrup {
    flex-wrap: nowrap;
    font-size: 0.9rem;
  }

  .breadcrup a,
  .breadcrup p {
    flex-wrap: nowrap;
  }

  .geographic-names-table th,
  .geographic-names-table td {
    font-size: 14px;
    padding: 8px;
  }

  .primary-button,
  .secondary-button,
  .delete-button {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  footer {
    display: none;
  }

  .opinion-crud-container {
    padding: 16px;
  }

  .file-upload-section {
    margin-top: 16px;
  }
}

.editing-row {
  background-color: #e8f4ff !important;
  border-left: 3px solid #0254a2 !important;
}

.editing-row td {
  background-color: #e8f4ff !important;
}

/* Container for edit buttons */
.edit-buttons-container {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #0254a2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Style for disabled button */
.primary-button:disabled {
  background-color: #cccccc;
  border-color: #cccccc;
  cursor: not-allowed;
}

.search-section {
  width: 100%;
  margin-top: 16px;
}

.search-section .input-container {
  width: 100%;
}

.view-geo-names {
  white-space: nowrap;
  min-width: 120px;
}

#geoNamesModal .modal-dialog {
  max-width: 500px;
}

#geoNamesModal .modal-body {
  max-height: 70vh;
}

#geoNamesModal li {
  padding: 8px;
  border-bottom: 1px solid #eee;
}

#geoNamesModal li:last-child {
  border-bottom: none;
}

/* Custom Modal Styles */
.custom-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.custom-modal-content {
  position: relative;
  background-color: #fff;
  margin: 50px auto;
  padding: 0;
  width: 90%;
  max-width: 500px;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.custom-modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #033e7c;
  color: white;
  border-radius: 4px 4px 0 0;
}

.custom-modal-body {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
}

.close-modal {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: white;
  padding: 0;
  line-height: 1;
}

.close-modal:hover {
  opacity: 0.8;
}

/* Style for the button in the table */
.view-geo-names {
  padding: 6px 12px;
  background: #033e7c;
  border: 1px solid #033e7c;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  min-width: 120px;
}

.view-geo-names:hover {
  background: #0254a2;
  border: 1px solid #0254a2;
}

/* Style for the content inside modal */
.geo-name-group {
  margin-bottom: 20px;
}

.geo-name-group h6 {
  color: #033e7c;
  text-transform: capitalize;
  margin-bottom: 10px;
  font-weight: 600;
}

.geo-name-item {
  padding: 8px;
  border-bottom: 1px solid #eee;
}

.geo-name-item:last-child {
  border-bottom: none;
}

.geo-name-text {
  font-weight: 500;
  margin-bottom: 4px;
}

.geo-name-lang {
  color: #666;
  font-size: 0.9em;
}
