/* Global variables */
:root {
  --primary-color: #0f5197;
  --secondary-color: #ffffff;
  --error-color: #dd2d2c;
  --success-color: #28a745;
  --warning-color: #ffc107;
}

/* Reset some default styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Avenir", sans-serif;
  background-color: var(--secondary-color);
  color: #333;
  line-height: 1.6;
}
/* These styles are for the final maintenance report html file */

/* Form styles */
fieldset {
  background-color: #ffffff;
  border: 1px solid #000000;
  border-radius: 6px;
  padding: 20px;
  margin: 15px;
  width: 100%;
  margin-left: -2.5px;
}

legend {
  background-color: #ffffff;
  color: rgb(0, 0, 0);
  padding: 5px 10px;
  border-radius: 5px;
  font-weight: bold;
  border: 1px solid #000;
}

h1 {
  text-align: center;
}

input {
  margin: 5px;
  width: 100%;
  max-width: 100%;
  padding: 5px;
  overflow: hidden;
  margin: 0.5rem 0 1rem 0;
  background-color: #f5f5f5;
  border: 1px solid #ccc;
  color: #000;
}

input[readonly] {
  color: #000;
}

input[type="checkbox"] {
  width: auto !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 6px 0 0;
  flex: 0 0 auto;
}

.style-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  white-space: nowrap;
  line-height: 1;
}

.drop-down select {
  width: 100%;
  max-width: 100%;
  padding: 5px;
  background-color: white;
  border: 0.5px solid #000000;
  font-size: 16px;
  color: #000;
  height: 35px;
}

/* Dropdown to box styles */
.dropdown-to-box-group {
  display: flex;
  flex-direction: column;
  width: 100%;
  font-size: 16px;
  margin-top: 1rem;
}

.dropdown-to-box-fields {
  display: flex;
  align-items: center;
  font-size: 16px;
  gap: 0.2rem;
  width: 100%;
}

.style-select,
.style-other {
    flex: 1;
    width: 100%;
    font-size: 16px;
    max-width: 100%;
    padding: 5px;

}

.style-select select,
.style-other input {
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    font-size: 16px;
    padding: 5px;
    margin-left: -5px;
    background-color: white;
    font-size: 16px;
    height: 35px;
}

.dropdown-to-box-fields .style-select,
.dropdown-to-box-fields .style-other {
  flex: 1;
}

.dropdown-to-box-fields .style-select select,
.dropdown-to-box-fields .style-other input,
.dropdown-to-box-fields .style-other textarea {
  width: 100%;
  box-sizing: border-box;
}

.damage-form hr {
  margin: 1rem 0;
}

.furniture-other-wrapper,
.furniture-section-other-wrapper,
.damage-type-other-wrapper,
.furniture-brand-other-wrapper {
  display: none;
}

/* Button styles */
.btn {
  padding: 0.6rem 1rem;
  font-size: 15px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #fff;
  transition: filter 0.5s ease;
}

.btn:hover {
  filter: brightness(85%);
}

.btn:active {
  transform: scale(0.98);
}

.btn-success {
  background-color: #28a745;
}

.btn-danger {
  background-color: #dd2d2c;
}

.btn-primary {
  background-color: #0f5197;
}

.btn-save {
  width: 100%;
  padding: 0.9rem;
  font-size: 18px;
  font-weight: 600;
}

.damage-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.submit-wrapper {
  margin-top: 3rem;
}

/* Icon styles */
.btn .camera-icon {
  display: inline-block;
  width: 24px;
  height: 18px;
  margin-top: -2px;
  margin-left: -4px;
  margin-right: 4px;
  vertical-align: middle;
  background-image: url('../images/camera-icon.png');
  background-repeat: no-repeat;
  background-size: 24px 18px;
  background-position: center;
}

.btn .trash-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-top: -2px;
  margin-left: -4px;
  margin-right: 4px;
  vertical-align: middle;
  background-image: url('../images/trashcan.png');
  background-repeat: no-repeat;
  background-size: 18px 18px;
  background-position: center;
}
/* It ends here. */


/* These styles come from the maintenance report detail html file. */

/* Schedule panel styles */
#schedulePanel {
  margin-top: 14px;
  display: none;
  border-top: 1px solid #e6e6e6;
  padding-top: 14px;
}

.schedule-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.schedule-form-col {
  flex: 1 1 220px;
  min-width: 180px;
}

/* Modal styles */
.reject-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  padding: 20px;
  box-sizing: border-box;
}

.reject-modal-content {
  position: relative;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.reject-modal-body {
  padding: 30px;
}

.reject-modal h3 {
  margin: 0 0 20px 0;
  color: #333;
  font-size: 24px;
  text-align: center;
}

.reject-modal textarea {
  width: 100%;
  height: 120px;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  box-sizing: border-box;
}

.reject-modal-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 25px;
  flex-wrap: wrap;
}

.reject-modal-actions button {
  min-width: 120px;
  padding: 12px 24px;
}

/* Approval actions */
.approval-actions {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.approval-actions form {
  flex: 1;
}

.approval-actions button {
  width: 100%;
  padding: 10px;
}

/* ^ it ends here - adding for maintenance reasons */


a {
  text-decoration: none;
  color: var(--primary-color);
}

.download {
  text-decoration: none;
  color: var(--primary-color);
}

.download:hover {
  color: #0a3563;
}

.navbar {
  background-color: var(--primary-color);
  color: var(--secondary-color);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  vertical-align: middle;
}

.errorlist li,
ul.errorlist li {
  display: inline;
}

.messages-wrapper {
  margin: 20px 30px;
}

.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 10px;
  font-weight: 500;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-warning {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

.alert-error,
.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.button-in {
  background-color: var(--primary-color);
  color: var(--secondary-color);
  font-weight: bold;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-size: 16px;
  width: 100%;
}

.button-in:hover {
  background-color: #0a3563;
}

.button-out {
  background-color: var(--error-color);
  color: var(--secondary-color);
  font-weight: bold;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-size: 16px;
  width: 100%;
  z-index: 10;
}

.button-out:hover {
  background-color: #a61b1a;
}

.button-add {
  background-color: var(--success-color);
  color: var(--secondary-color);
  font-weight: bold;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-size: 16px;
  width: 100%;
}

.button-add:hover {
  background-color: #1e7e34;
}

.button-edit {
  background-color: var(--warning-color);
  color: #212529;
  font-weight: bold;
  border: none;
  padding: 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-size: 16px;
  width: auto;
}

.button-edit:hover {
  background-color: #d39e00;
}

.button-download {
  background-color: var(--primary-color);
  color: var(--secondary-color);
  font-weight: bold;
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-size: 16px;
  width: auto;
}

.button-download:hover {
  background-color: #0a3563;
}

.logo img {
  height: 45px;
  vertical-align: middle;
}

.card {
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  align-items: center;
  text-align: center;
  display: flex;
  flex-direction: column;
  width: 90%;
}

.card-mail {
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  align-items: flex-start;
  text-align: left;
  display: flex;
  flex-direction: column;
  width: 90%;
}

.card-login {
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  align-items: center;
  text-align: center;
  display: flex;
  flex-direction: column;
  width: 75%;
}

.report-image {
  width: 100%;
  height: 200px;
  margin-top: 1rem;
  margin-bottom: 1rem;
  overflow: hidden;
}

.report-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.reports-section {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.card-report {
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  padding: 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-align: left;
  display: flex;
  flex-direction: column;
  min-width: 370px;
  max-width: 400px;
  max-height: 475px;
  flex: 0 0 calc(25% - 0.75rem);
}

.reports-actions-section {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.card-report-action {
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  padding: 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  text-align: center;
  display: flex;
  flex-direction: column;
  min-width: 270px;
  max-width: screen-width/3;
  height: auto;
  min-height: unset;
  flex: 0 0 calc(33.33% - 0.75rem);
}

#schedulePanel {
  width: 100%;
  box-sizing: border-box;
  }

.schedule-actions {
  margin-top: 12px;
  display: flex;
  flex-direction: column; /* stack buttons vertically */
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding-bottom: 8px;
  }

.schedule-actions .button-in,
.schedule-actions .button-out {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: block;
  }

.input-label {
  font-weight: bold;
  margin-bottom: 0.25rem;
  display: block;
}

.input-field {
  width: 100%;
  padding: 0.75rem;
  margin: 0.5rem 0 1rem 0;
  border: 1px solid #ccc;
  border-radius: 0.375rem;
  font-size: 16px;
  height: auto;
}

.input-field data {
  flex: 1;
  width: auto;
  height: auto;
}

#dynamicFields {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.region-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-rows: auto;
  grid-template-rows: repeat(11, auto);
  gap: 8px;
  margin-top: 10px;
}

.region-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  box-sizing: border-box;
  white-space: nowrap;
  width: max-content;
}

.region-item input {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.text-report-title {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 1rem;
  text-align: center;
}

.text-report-info {
  font-size: 1rem;
  font-style: italic;
}

.final-report-data {
  background-color: #ffffff;
  border: 1px solid var(--primary-color);
}

.final-report-data-damage {
  background-color: #ffffff;
  border: 1px solid var(--error-color);
}

.final-report-data-optional {
  background-color: #fff;
  border: 1px solid var(--success-color);
}

.legend-panoramic {
  font-size: 1rem;
  font-weight: bold;
  background-color: var(--warning-color);
  color: #000000
}

.final-report-data-panoramic {
  background-color: #ffffff;
  border: 1px solid var(--warning-color);
}

.text-freport-group {
  margin-bottom: 1rem;
  margin-top: 1rem;
}

.text-freport {
  font-size: 1rem;
}

.text-freport-info {
  font-size: 1rem;
  font-weight: bold;
}

.legend-title {
  font-size: 1.125rem;
  font-weight: bold;
  background-color: var(--primary-color);
  color: #fff
}

.legend-damage {
  font-size: 1.125rem;
  font-weight: bold;
  background-color: var(--error-color);
  color: #fff
}

.legend-optional {
  font-size: 1.125rem;
  font-weight: bold;
  background-color: #28a74655;
  color: #000000
}

.legend-maintenance {
  font-size: 1.125rem;
  font-weight: bold;
  background-color: var(--success-color);
  color: #ffffff
}


#regionsTemplate.test-box {
  border: 1px solid #ed0808;
  border-radius: 0.375rem;
  padding: 0.5rem;
  font-size: 50px;
  width: 100%;
  box-sizing: border-box;
  background-color: #0a3563;
}

.container {
  max-width: 90%;
  margin: 2rem auto;
  padding: 0 1rem;
  align-items: center;
  text-align: left;
  display: flex;
  flex-direction: column;
}

.showData {
  display: flex;
  flex-direction: row;
  width: 100%;
  align-items: center;
  text-align: left;
  gap: 1rem;
  vertical-align: middle;
  justify-content: space-between;
}

.textData {
  width: 120px;
  display: flex;
  font-weight: bold;
}

.note {
  font-size: 0.9rem;
  color: #666;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
  text-align: center;
}

.brand-name {
  font-size: 1.5rem;
  font-weight: bold;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.brand-chip {
  display: inline-block;
  background-color: #157eee41;
  padding: 6px 10px;
  margin: 4px;
  border-radius: 16px;
  border: 1px solid #000;
  font-size: 14px;
  font-weight: bold;
  color: #000000;
}

.images-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.new-damage-evidence-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.new-damage-images-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.textarea-maintenance {
  width: 100%;
  min-height: 120px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
}

.actions {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  margin-top: 2rem;
}

.error-box {
  background-color: var(--error-color);
  color: var(--secondary-color);
  padding: 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  font-weight: bolder;
}

.pdf-viewer {
  width: 100%;
  height: 70vh;
  border: 1px solid rgb(0, 0, 0);
  border-radius: 8px;
  background-color: #ffffff;
  margin-top: 2rem;
}

.pagination {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  gap: 1.25rem;
  align-items: center;
  vertical-align: middle;
  width: 100%;
}

.pagination .page-link {
  cursor: pointer;
  font-weight: bolder;
  color: var(--primary-color);
  font-size: 2rem;
}

.pagination .page-link:hover {
  color: var(--error-color);
}

.pagination .page-link.active {
  background-color: var(--primary-color);
  color: var(--secondary-color);
  border-color: var(--primary-color);
  cursor: default;
}

.pagination .page-info {
  margin-left: 1rem;
  font-size: 1.25rem;
  margin-top: 0.25rem;
  color: #666;
}

table {
  width: 100%;
  margin-top: 1rem;
  font-size: small;
}

table .report {
  width: 100%;
  margin-top: 1rem;
  font-size: small;
}

table .users {
  width: 100%;
  margin-top: 1rem;
  font-size: small;
}

th {
  background-color: var(--primary-color);
  opacity: 0.7;
  color: var(--secondary-color);
  padding: 0.75rem;
  text-align: center;
  cursor: pointer;
}

td {
  padding: 0.75rem;
  text-align: center;
}

.arrow {
  font-size: 0.8rem;
  margin-left: 0.25rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #ddd;
  border-top-color: #0f5197;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: auto;
}

.assign-menu {
    margin: 12px 0;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
    width: 100%;
}

.hidden {
    display: none;
}

.damage-card {
  border: 1px solid #ddd;
  padding: 12px;
  margin: 14px 0;
  border-radius: 8px;
  width: 100%;
}
.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.img-grid a {
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
  display: block;
}
.img-grid img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}
.muted {
  color: #666;
  font-size: 13px;
}

/* Media Queries for responsiveness */

@media (max-width: 768px) {
  .card-login {
  width: 90%;
}

  .actions {
    flex-direction: column;
  }

  .card {
    width: 100%;
  }

  .reports-section {
    grid-template-columns: 1fr;
  }

  .card-report {
    min-width: 100%;
  }

  .report-image {
    width: 100%;
    height: 200px;
    margin-top: 1rem;
    margin-bottom: 1rem;
    overflow: scroll;
  }

  .region-grid {
    grid-template-rows: repeat(32, auto);
  }

  table.users {
    font-size: 12px;
  }

  table.users th:nth-child(2),
  table.users td:nth-child(2),
  table.users th:nth-child(4),
  table.users td:nth-child(4) {
    display: none;
  }

  /* Puse esto porque no se veían los correos */
  table.users th:nth-child(3),
  table.users td:nth-child(3) {
    display: table-cell;
  }

  table {
    font-size: 12px;
  }

  table th:nth-child(2),
  table td:nth-child(2),
  table th:nth-child(3),
  table td:nth-child(3) {
    display: none;
  }

  

  table.report {
    font-size: 12px;
  }

  table.report th:nth-child(2),
  table.report td:nth-child(2),
  table.report th:nth-child(4),
  table.report td:nth-child(4),
  table.report th:nth-child(6),
  table.report td:nth-child(6),
  table.report th:nth-child(7),
  table.report td:nth-child(7),
  table.report th:nth-child(8),
  table.report td:nth-child(8) {
    display: none;
}
}

/* Animations */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/*STYLE for error message*/
.errorlist,
ul.errorlist {
        margin: 0;
        padding: 0;
        list-style: none;
        color: #c00; /* red error text */
        animation: shake 1s ; /* Applies the animation */
}
@keyframes shake {
      10%, 90% {
        transform: translate3d(-1px, 0, 0);
      }
      20%, 80% {
        transform: translate3d(2px, 0, 0);
      }
      30%, 50%, 70% {
        transform: translate3d(-2px, 0, 0);
      }
      40%, 60% {
        transform: translate3d(2px, 0, 0);
      }
}