<style>
  .dragDrop {
    font-family: sans-serif;
    color: grey;
    border-collapse: unset;
  }

  .fileList {
    font-family: sans-serif;
    color: grey;
    font-size: 70%;
  }

  .rounded-td {
    border-collapse: unset;
    border-spacing: 10px;
    width: 300px;
    height: 150px;
    padding: 20px;
    text-align: center;
    border: 2px dashed #0dcaf0;
    border-radius: 7px;
    background-color: #fafafa;
    color: grey;
  }

  input[type="file"] {
    display: none;
  }

  .file-upload {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
  }

  button.uploadSelfie {
    background-color: #0dcaf0 !important;
    color: white;
    padding: 5px 20px;
    border: none;
    border-radius: 1px;
    cursor: pointer;
    font-size: 14px;
  }

    button.search_matches {
    background-color: black;
    color: white;
    padding: 5px 20px;
    border: none;
    border-radius: 1px;
    cursor: pointer;
/*    font-size: 14px; */
  }

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

  /* Fix for table button alignment */
.dragDrop tr td {
  text-align: center;
  min-height: 150px;
}

.dragDrop button.search_matches {
  width: 100%;
  margin: 10px auto;
  display: block;
}

/* modal during upload selfie */
.loading-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-content {
  background-color: white;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
}

.loading-content progress {
  width: 100%;
  height: 20px;
  margin-top: 10px;
}

.spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-top: 4px solid #007bff; /* Цвет индикатора */
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
/* modal during upload selfie */

/* selfie not found */
.no-matches-message {
  text-align: center;
  padding: 20px;
  margin: 20px auto;
  max-width: 500px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #f9f9f9;
}

.no-matches-message h3 {
  color: #000000;
  margin-bottom: 10px;
}

.no-matches-message p {
  color: #555;
  margin-bottom: 10px;
}

.no-matches-message button {
  margin: 10px 5px;
  padding: 8px 15px;
  background: #5bc0de;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.no-matches-message button:hover {
  background: #31b0d5;
}
/* selfie not found */

.result-container {
    margin-left: 30px;
/*    padding-top: 20px; */
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
    flex-grow: 1;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 колонки на десктопе */
    gap: 10px;
    margin-top: 10px;
    width: 100%;
    flex-grow: 1;
}

.photo-item {
    position: relative;
    text-align: center;
}

.photo-item img {
    max-width: 100%;
    border: 1px solid grey;
}

.photo-item button {
    display: block;
    margin: 5px auto;
    padding: 5px 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.photo-item button:hover {
    background-color: #45a049;
}

.photo-item .checkmark {
    position: absolute;
    bottom: 35px;
    right: 5px;
    width: 20px;
    height: 20px;
    background-color: green;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
}

.pagination button {
  margin: 0 10px;
  padding: 5px 10px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.pagination button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

.pagination span {
  margin: 0 10px;
}


.modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.8);
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
}

.modal-content {
  max-width: 90%;
  max-height: 90%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0; /* Remove padding */
  background: transparent; /* Remove white background */
}

.modal-content img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain; /* Maintain aspect ratio */
  border-radius: 5px;
}

.image-loading {
  color: white;
  font-size: 1.2rem;
  position: absolute;
}

.cart-summary {
    margin-left: auto;
    padding: 10px;
    border: 1px solid grey;
    border-radius: 5px;
    background-color: #f9f9f9;
    min-width: 200px;
/*    margin-left: 20px;
    position: sticky;
*/
    box-sizing: border-box;
    align-self: flex-start;
    width: 90%;
}

.cart-summary table {
    width: 100%;
    text-align: left;
}

.cart-summary th, .cart-summary td {
    padding: 5px;
}

.cart-summary button {
margin-top: 10px;
padding: 5px 10px;
background-color: #008CBA;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
width: 100%;
}

.cart-summary button:hover {
background-color: #006d9e;
}

@media (min-width: 769px) { /* Применяем стили для экранов шире 768px */
    .cart-summary {
        margin-left: auto; /* Прижимаем корзину вправо */
      }

     .drop-area-header {
        max-width: 300px;
      }

}

@media (max-width: 768px) { /* Измените 768px на нужную ширину */
    .file-upload {
      display: flex;
      flex-direction: column; /* Изменяем направление flex на колонку */
      align-items: stretch; /* Растягиваем элементы по ширине */
      justify-content: center;

    }
    .drop-area {
      order: 3;
      margin-bottom: 20px;
      width: 100%;
      box-sizing: border-box;
    }


    .drop-area button {
      width: 100%;
      box-sizing: border-box;
    }

    .dragDrop {
        margin: 0 auto; /* Центрируем таблицу */
        border-collapse: separate; /* Добавляем separate */
        border-spacing: 10px; /* Добавляем border-spacing */
        width: 100%;
    }


    .image-placeholder {
      margin: 0 auto;
      width: 200px;
      height: 150px;
    }


    .result-container {
      margin-left: 0;
      margin-top: 20px;
      order: 1;
      display: block;
    }

    .photo-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .photo-item img {
        width: 100%;
        height: auto;
    }

    .rounded-td {
        width: 100%;
        /*  height: auto; */
        min-height: 150px;
        min-width: auto;
    }
}

    /* Better checkmark positioning */
    .photo-item .checkmark {
        bottom: 40px;
        right: 10px;
    }

    /* Add hover effect for search button */
    button.search_matches:hover {
      background-color: #333;
    }

    .photo-item-name {
      margin-bottom: 0px;
    }

    .cart-summary {
      margin-left: 0; /* Убираем левый отступ */
      margin-top: 20px; /* Добавляем верхний отступ */
      order: 2;
      margin-bottom: 20px;
      width: 100%;
    }
}
</style>