@font-face {
  font-family: 'Raleway';
  src: url('/static/fonts/Raleway-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'BEBAS';
  src: url('./fonts/BebasNeue_Bold.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}


body {
  margin: 0;
  padding: 40px;
  font-family: 'Raleway', sans-serif;
  background-color: #4d0016;
  color: white;
}



h1 {
  font-family: 'BEBAS';
  font-size: 60px;
  margin-bottom: 40px;
  text-align: center;
  text-transform: uppercase;
  color: white;
}

button {
  font-family: 'Raleway';
  padding: 10px 25px;
  font-size: 18px;
  background-color: #be0036;
  color: white;
  border: 1px solid white;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s ease;
  box-shadow:
    inset 0 10px 20px -10px rgba(255, 255, 255, 0.3),
    inset 0 -10px 20px -10px rgba(255, 255, 255, 0.3);
}

button:hover {
  background-color: white;
  color: #be0036;
}

/* Таблица */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 30px;
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  color: #111;
}

th, td {
  padding: 15px 20px;
  text-align: left;
  font-size: 18px;
}

td.event-name {
  max-width: 300px;
  word-wrap: break-word;
  white-space: normal;
}

th {
  background-color: #be0036;
  color: white;
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 0.05em;
}

tr:not(:last-child) {
  border-bottom: 1px solid #ddd;
}

.event-finished {
  background-color: rgba(255, 0, 0, 0.05) !important;
}

/* Фикс ширины колонки № */
#eventsTable th:first-child,
#eventsTable td:first-child {
  width: 50px;
}

/* Колонка с кнопками */
#eventsTable th:last-child,
#eventsTable td:last-child {
  background: none !important;
  padding: 0;
  text-align: center;
  white-space: nowrap;
}

.delete-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: #ff8aab;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  margin: 0 4px;
}

.delete-btn:hover {
  background-color: rgba(255, 50, 80, 0.2);
}

.delete-btn svg {
  width: 16px;
  height: 16px;
  color: #be0036;
}

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

.status-btn {
  font-family: 'Raleway';
  padding: 6px 12px;
  font-size: 14px;
  background-color: #ffd9dd;
  color: #be0036;
  border: 1px solid #be0036;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s ease;
  display: inline-block;
  margin: 4px 0;
}

.status-btn:hover {
  background-color: #ffccd1;
}

/* === ПОПАП ДОБАВЛЕНИЯ СОБЫТИЯ === */
#event-popup-overlay,
#popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

#popup {
  background: white;
  border-radius: 16px;
  padding: 30px 40px;
  width: 500px;
  max-width: 90%;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
  color: #111;
  animation: fadeIn 0.3s ease;
  font-family: 'Raleway', sans-serif;
}

#popup h3 {
  margin-top: 0;
  font-size: 24px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: bold;
  color: #be0036;
}

#popup input {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 15px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  transition: border-color 0.2s;
}

#popup input:focus {
  border-color: #be0036;
  outline: none;
}

#popup button {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  font-family: 'Raleway';
  background-color: #be0036;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 10px;
  transition: 0.2s;
  box-shadow: inset 0 10px 20px -10px rgba(255, 255, 255, 0.3),
              inset 0 -10px 20px -10px rgba(255, 255, 255, 0.3);
}

#popup button:hover {
  background-color: white;
  color: #be0036;
  border: 1px solid #be0036;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* === ПОПАП ДОБАВЛЕНИЯ ПОКУПКИ === */
#purchase-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#purchase-popup {
  background: white;
  padding: 30px;
  border-radius: 10px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
  max-height: 90vh;
  overflow-y: auto;
  color: #111;
}

#purchase-step-event h3,
#purchase-step-residents h3 {
  font-size: 22px;
  margin-bottom: 20px;
  color: #be0036;
  text-align: center;
}

#event-list-container button {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 12px 16px;
  font-size: 16px;
  border: 1px solid #be0036;
  background-color: #ffd9dd;
  color: #be0036;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s ease;
}

#event-list-container button:hover {
  background-color: #ffc2cc;
}

#resident-search-input {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 16px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

#resident-search-results > div,
#selected-residents-list > div {
  padding: 10px;
  border: 1px solid #eee;
  background: #fafafa;
  margin-bottom: 8px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#resident-search-results button {
  padding: 6px 10px;
  font-size: 14px;
  background-color: #be0036;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#selected-residents-list select {
  margin-left: 10px;
  padding: 6px;
  font-size: 14px;
  border-radius: 6px;
}

#save-purchase-button {
  margin-top: 20px;
  font-size: 16px;
  width: 100%;
  background-color: #be0036;
  color: white;
  padding: 12px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s ease;
}

#save-purchase-button:hover {
  background-color: white;
  color: #be0036;
  border: 1px solid #be0036;
}

#purchase-popup-overlay button:last-child {
  margin-top: 15px;
  background: transparent;
  color: #be0036;
  border: 1px solid #be0036;
  font-size: 16px;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
}

#purchase-popup-overlay button:last-child:hover {
  background-color: #ffd9dd;
}

.event-button {
    display: block;
    width: 100%;
    margin-bottom: 10px;
    padding: 10px;
    background-color: #be0036;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}
.event-button:hover {
    background-color: #a1002d;
}

.hidden {
  display: none !important;
}
