/* === protocol.css === */

/* === Общий контейнер === */
.protocols {
  max-width: 1200px;
  margin: 20px auto;
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
  font-family: "Segoe UI", sans-serif;
}

.protocols h3 {
  margin-bottom: 20px;
  font-size: 1.5rem;
  color: #2c3e50;
  text-align: center;
  font-weight: 600;
}

/* === Фильтры === */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  justify-content: center;
}

.filters input[type="text"],
.filters select {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.filters input[type="text"]:focus,
.filters select:focus {
  border-color: #2c3e50;
  outline: none;
}

/* === Таблица === */
.protocol-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.93rem;
}

.protocol-table th {
  background: #2c3e50;
  color: #fff;
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
}

.protocol-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #e0e0e0;
}

.protocol-table tr:nth-child(even) {
  background: #f9fafb;
}

.protocol-table tr:hover {
  background: #eef4f8;
}

/* Ссылки на PDF */
.protocol-table a {
  color: #0077cc;
  text-decoration: none;
  font-weight: 500;
}

.protocol-table a:hover {
  text-decoration: underline;
}

/* Кнопки действий */
.protocol-table button {
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: 0.2s;
}

.protocol-edit {
  background: #2d89ef;
  color: #fff;
}

.protocol-delete {
  background: #d9534f;
  color: #fff;
}

.protocol-edit:hover {
  background: #1a6fd1;
}

.protocol-delete:hover {
  background: #c9302c;
}

/* === Модалка === */
#protocol_modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#protocol_modal .modal-content {
  background: #fff;
  padding: 25px;
  border-radius: 10px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  position: relative;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {opacity: 0; transform: translateY(-15px);}
  to {opacity: 1; transform: translateY(0);}
}

#protocol_modal h4 {
  margin-bottom: 15px;
  color: #2c3e50;
  text-align: center;
}

#protocol_modal form label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: #333;
}

#protocol_modal input[type="text"],
#protocol_modal input[type="date"],
#protocol_modal select,
#protocol_modal input[type="file"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-top: 4px;
}

#protocol_modal button {
  margin-top: 8px;
  padding: 8px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: 0.2s;
}

#protocol_modal button[type="submit"] {
  background: #2d89ef;
  color: #fff;
}

#protocol_modal #protocol_modal_close {
  background: #bbb;
  color: #fff;
}

#protocol_modal button:hover {
  opacity: 0.85;
}

/* === Форма добавления === */
.protocol-add {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin: 25px auto;
  max-width: 1000px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}

.protocol-add h4 {
  text-align: center;
  color: #2c3e50;
  margin-bottom: 15px;
  font-size: 1.2rem;
  font-weight: 600;
}

#protocol_add_form label {
  display: block;
  margin-bottom: 12px;
  color: #333;
  font-size: 0.9rem;
}

#protocol_add_form input[type="text"],
#protocol_add_form input[type="date"],
#protocol_add_form select,
#protocol_add_form input[type="file"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-top: 4px;
  font-size: 0.9rem;
}

#protocol_add_form button[type="submit"] {
  background: #2d89ef;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
}

#protocol_add_form button[type="submit"]:hover {
  background: #1a6fd1;
}

/* === Таблица множественного выбора === */
.protocol-multi-block {
  margin-top: 20px;
}

.protocol-multi-block h4 {
  margin-bottom: 10px;
  color: #2c3e50;
}

.protocol-multi-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 8px;
  overflow: hidden;
  min-width: 800px;
}

.protocol-multi-table th {
  background: #2c3e50;
  color: #fff;
  padding: 8px 10px;
  text-align: left;
}

.protocol-multi-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e0e0e0;
}

.protocol-multi-table select,
.protocol-multi-table input[type="text"] {
  width: 100%;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 0.9rem;
}

.protocol-multi-table .remove_row {
  background: #d9534f;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  transition: 0.2s;
}

.protocol-multi-table .remove_row:hover {
  background: #c9302c;
}

#add_protocol_row {
  background: #2d89ef;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
}

#add_protocol_row:hover {
  background: #1a6fd1;
}

/* === Горизонтальный скролл === */
.protocol-multi-block > div {
  overflow-x: auto;
  border: 1px solid #ddd;
  border-radius: 8px;
}

/* === Адаптивность === */
@media (max-width: 900px) {
  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  .protocol-table th,
  .protocol-table td {
    font-size: 0.85rem;
    padding: 8px;
  }
}

@media (max-width: 600px) {
  .protocols {
    padding: 10px;
  }

  .protocol-table,
  .protocol-table thead,
  .protocol-table tbody,
  .protocol-table th,
  .protocol-table td,
  .protocol-table tr {
    display: block;
  }

  .protocol-table thead {
    display: none;
  }

  .protocol-table tr {
    background: #fff;
    margin-bottom: 12px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    padding: 8px 10px;
  }

  .protocol-table td {
    border: none;
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
  }

  .protocol-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #2c3e50;
  }

  .protocol-table button {
    font-size: 0.8rem;
    padding: 5px 8px;
  }
}
