/* ---------- 1. ПОДКЛЮЧЕНИЕ ШРИФТОВ ---------- */
<?php foreach ($availableFonts as $fontName => $font): ?>
@font-face {
    font-family: '<?= htmlspecialchars($fontName) ?>';
    src: url('<?= $font['path'] ?>') format('truetype');
}
<?php endforeach; ?>

/* ---------- 2. CSS-ПЕРЕМЕННЫЕ ---------- */
:root{
  --accent-blue:#1976d2;
  --accent-red:#e53935;
  --gap:8px;
}

/* ---------- 3. ОБЩИЕ СТИЛИ ---------- */
* {box-sizing: border-box}
.ip-and-clear {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
.clear-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px 6px;
    font-size: 14px;
}
.clear-btn:hover {
    background-color: #f0f0f0;
}
body {
  font-family: Arial, sans-serif;
#  background-color: rgb(0 0 0 / 0%);
#  color: #333;
  margin: auto;
  padding: 20px;
  font-size: 14px;
  width: 90%;
}

h1, h2 {
  text-align: center;
  margin-top: 1px;
  margin-bottom: 1px;
  border-bottom: 2px solid #ddd;
  padding-bottom: 1px;
  color: #000;
}

/* ---------- 4. ШАПКА ---------- */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 20px;
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

.nav-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}
.icon-button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
    transition: background 0.2s;
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.25);
}

.logo-container {flex: 0 0 auto}
.logo {
  width: auto;
  max-width: 100%;
}
.contact-info {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  text-align: right;
}
.contact-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: var(--gap);
}
.contact-row .phone,
.contact-row .email {
  font-size: 14px;
  color: #333;
  text-decoration: none;
  white-space: nowrap;
}
.contact-row .phone:hover,
.contact-row .email:hover {text-decoration: underline}

/* ---------- 5. ВЕРХНЯЯ ПАНЕЛЬ ---------- */
.top-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}
.search-container {
  flex: 0 0 30%;
  min-width: 280px;
}
.number-input-container {
  flex: 0 0 30%;
  text-align: right;
  min-width: 200px;
}

/* ---------- 6. ПОЛЯ ВВОДА ---------- */
.input-text,
.input-field {
  width: 100%;
  max-width: 300px;
  padding: 10px 14px;
  font-size: 16px;
  border: 2px solid var(--accent-blue);
  border-radius: 8px;
  outline: none;
  background: #f8f9fa;
  box-shadow: 0 2px 4px rgba(25,118,210,.1), inset 0 0 0 1px #fff;
  transition: all .3s ease;
}
.input-text:focus,
.input-field:focus {
  border-color: #1565c0;
  box-shadow: 0 0 8px rgba(25,118,210,.3), inset 0 0 0 1px #fff;
}

/* ---------- 7. КНОПКИ ---------- */
.btn {
  font-size: 16px;
  padding: 10px 20px;
  border-radius: 8px;
  transition: all .3s ease;
  border: none;
  cursor: pointer;
  font-weight: 500;
  box-shadow: 0 4px 6px rgba(0,0,0,.1), inset 0 -3px 0 rgba(255,255,255,.4);
}
.btn.primary {
  background: linear-gradient(145deg, #e53935, #c62828);
  color: white;
}
.btn.primary:hover {
  background: linear-gradient(145deg, #c62828, #e53935);
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(211,47,47,.3), inset 0 -3px 0 rgba(255,255,255,.4);
}
.btn.secondary {
  background: linear-gradient(145deg, #1976d2, #1565c0);
  color: white;
  font-size: 15px;
  padding: 8px 16px;
  box-shadow: 0 4px 6px rgba(25,118,210,.2), inset 0 -3px 0 rgba(255,255,255,.4);
}
.btn.secondary:hover {
  background: linear-gradient(145deg, #1565c0, #1976d2);
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(25,118,210,.3), inset 0 -3px 0 rgba(255,255,255,.4);
}

/* ---------- 8. КНОПКА «ПОЗВОНИТЬ» ---------- */
.clickable-number {
  cursor: pointer;
  margin-left: 8px;
  background: transparent;
  border: none;
  font-size: 18px;
  line-height: 1;
  color: var(--accent-blue);
  transition: color .2s ease;
}
.clickable-number:hover {color: #1565c0}

/* ---------- 9. НАВИГАЦИОННАЯ ПАНЕЛЬ (внизу) ---------- */
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.nav-buttons {display: flex; gap: var(--gap)}
.ip-box {flex: 1 1 auto; text-align: center}

.setting-btn {
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
  background: #fff;
  border: 1px solid var(--accent-blue);
  border-radius: 6px;
  cursor: pointer;
  transition: background .2s ease;
}
.setting-btn:hover {background: #e3f2fd}
.setting-btn .bar {
  width: 60%;
  height: 2px;
  background: var(--accent-blue);
  border-radius: 1px;
}

.ip-input-div {margin-top: 6px}
.ip-input-div.hide {display: none}
.ip-input-div label {font-weight: 600; margin-right: 6px}
.ip-input-div input {
  width: 160px;
  padding: 6px 8px;
  border: 1px solid var(--accent-blue);
  border-radius: 4px;
}

#saved-ip-info {
  font-size: 12px;
  color: #555;
  padding: 4px 8px;
  background: #e8efff;
  border-radius: 4px;
  white-space: nowrap;
}

/* ---------- 10. ТАБЛИЦА ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 40px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(25,118,210,.15);
  font-size: 15px;
  }
thead tr {color: white}
th, td {
  border: 1px solid #ccc;
  padding: 12px;
  text-align: left;
}
tr, td {
 background-color: rgba(0,0,0,0%);
}
th {
  background: linear-gradient(180deg, rgba(229,106,109,1) 0%, rgba(150,0,0,.7) 100%);
  text-align: center;
  box-shadow: inset 0 0 0 1px #fff;
}
.col-internal_number,
.col-external_number {text-align: center}

.table-row {
  transition: transform .2s ease, box-shadow .2s ease;
  background: #fff;
  box-shadow: 0 4px 6px rgba(0,0,0,.05), inset 0 0 0 1px #fff;
}
.table-row:hover {
  transform: scale(1.01);
  box-shadow: 0 6px 12px rgba(0,0,0,.1), inset 0 0 0 1px #fff;
}
.hidden {display: none}
/* ---------- 11. АДАПТИВНОСТЬ ---------- */
@media (max-width: 768px) {
.top-panel {
flex-direction: column;
gap: 15px;
}
.search-container,
.number-input-container {
width: 100%;
text-align: left;
}
.phone-input-wrap input,
#search-box,
#font-select {
width: 100%;
}
.phone-input-wrap .submit {
width: 40px;
height: 40px;
}
#filter-form input[type=text],
#filter-form select {
width: 100%;
max-width: none;
margin-bottom: 12px;
}
table, thead, tbody, th, td, tr {
display: block;
}
thead {display: none}
tbody tr {
margin-bottom: 18px;
border: 1px solid var(--accent-blue);
border-radius: 8px;
background-color: #f3f7ff;
padding: 12px;
box-shadow: 0 4px 6px rgba(25,118,210,.1);
}
tbody td {
border: none;
padding: 8px 14px;
position: relative;
text-align: right;

}
tbody td::before {
content: attr(data-label);
position: absolute;
left: 14px;
font-weight: 600;
color: var(--accent-blue);
white-space: nowrap;
}
.btn {
font-size: 14px;
padding: 8px 16px;
width: 100%;
margin-bottom: 10px;
}
.head-container {
flex-direction: column;
align-items: flex-start;
gap: 12px;
}
.contact-info {
text-align: left;
width: 100%;
margin-top: 8px;
}
.contact-row {
justify-content: flex-start;
}
}
/* ---------- 12. ФОРМА ФИЛЬТРАЦИИ ---------- */
#filter-form {
  margin-bottom: 20px;
  background: #f5f5f5;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(25, 118, 210, 0.1), inset 0 0 0 1px #fff;
}

#filter-form label {
  font-weight: bold;
  display: block;
  margin-bottom: 6px;
  text-align: left;
}

#filter-form input[type="text"],
#filter-form select {
  width: 100%;
  max-width: 280px;
  margin-bottom: 12px;
}

#filter-form button[type="submit"],
#filter-form button[type="reset"] {
  margin-left: 6px;
}

/* ---------- 13. ВЫПАДАЮЩИЙ СПИСОК ШРИФТОВ ---------- */
#font-select {
  width: 100%;
  max-width: 300px;
  padding: 10px 14px;
  font-size: 16px;
  border: 2px solid var(--accent-blue);
  border-radius: 8px;
  margin: 0 auto 20px auto;
  display: block;
  background: #f8f9fa;
  box-shadow: 0 2px 4px rgba(25, 118, 210, 0.1), inset 0 0 0 1px #fff;
}

/* ---------- 14. КНОПКА ОТПРАВКИ НОМЕРА (телефон) ---------- */
.phone-input-wrap {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.phone-input-wrap input {
  flex: 1 1 250px;
  min-width: 250px;
}

.phone-input-wrap .submit {
  width: 44px;
  height: 44px;
  background: url('data:image/svg+xml;utf8,<svg fill="%23ffffff" height="20" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13 1.21.38 2.39.73 3.52a2 2 0 0 1-.45 2.11L9.91 10.09a16 16 0 0 0 6 6l1.74-1.1a2 2 0 0 1 2.11-.45c1.13.35 2.31.6 3.52.73A2 2 0 0 1 22 16.92z"/></svg>') no-repeat center;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: var(--accent-red);
  box-shadow: 0 4px 6px rgba(211, 47, 47, 0.2), inset 0 -3px 0 rgba(255, 255, 255, 0.4);
}

.phone-input-wrap .submit:hover {
  background-color: #c62828;
  box-shadow: 0 6px 12px rgba(211, 47, 47, 0.3), inset 0 -3px 0 rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

/* ---------- 15. КНОПКИ В ТАБЛИЦЕ ---------- */
button {
  background: transparent;
  border: none;
}

/* ---------- 16. СКРЫТЫЕ ЭЛЕМЕНТЫ ---------- */
.hidden {
  display: none;
}
/*------------ 17. BUTTON ------------------*/
/* From Uiverse.io by vinodjangid07 */ 
.setting-btn {
  width: 45px;
  height: 45px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(144deg,#af40ff,#5b42f3 50%,#00ddeb);
  border-radius: 10px;
  cursor: pointer;
  border: none;
  box-shadow: 0px 0px 0px 2px rgb(212, 209, 255);
}
.bar {
    width: 18px;
    height: 2px;
    background: white;
    margin: 2px 0;
    border-radius: 2px;
}
.bar::before {
  content: "";
  width: 2px;
  height: 2px;
  background-color: rgb(126, 117, 255);
  position: absolute;
  border-radius: 50%;
  border: 2px solid white;
  transition: all 0.3s;
  box-shadow: 0px 0px 5px white;
}
.bar1::before {
  transform: translateX(-4px);
}
.bar2::before {
  transform: translateX(4px);
}
.vanta-selector {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    font-size: 14px;
    cursor: pointer;
}

.vanta-selector:focus {
    outline: none;
    border-color: #4a90e2;
}

.ip-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #e0e0e0;
}

.clear-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(220, 20, 60, 0.3);
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.clear-btn:hover {
    background: rgba(220, 20, 60, 0.5);
}

.clickable-ip {
    color: #4a90e2;
    text-decoration: underline;
    cursor: pointer;
}

.setting-btn:hover .bar1::before {
  transform: translateX(4px);
}
.setting-btn:hover .bar2::before {
  transform: translateX(-4px);
}
.Btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 45px;
  height: 45px;
  border-radius: calc(45px/2);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition-duration: .3s;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.199);
  background: linear-gradient(144deg,#af40ff,#5b42f3 50%,#00ddeb);
}

/* plus sign */
.sign {
  width: 100%;
  font-size: 1.4em;
  color: white;
  transition-duration: .3s;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* text */
.text {
  position: absolute;
  right: 0%;
  width: 0%;
  opacity: 0;
  color: white;
  font-size: 1.4em;
  font-weight: 500;
  transition-duration: .3s;
}
/* hover effect on button width */
Btn:hover {
  width: 125px;
  transition-duration: .3s;
}

Btn:hover .sign {
  width: 30%;
  transition-duration: .3s;
  padding-left: 15px;
}
/* hover effect button's text */
Btn:hover .text {
  opacity: 1;
  width: 70%;
  transition-duration: .3s;
  padding-right: 15px;
}
/* button click effect*/
Btn:active {
  transform: translate(2px ,2px);
}