.chat-link-list {
    list-style: none;
    padding: 0;
    margin-right: 15vw;
    margin-left: 15vw;
}

.chat-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    width: 100%;
    padding: 10px 10px;
    color: black;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    transition: background 0.3s ease;
    border-bottom: 1px solid #ddd;
    min-width: 400px;
    cursor: pointer;
}

.chat-link:hover {
    background: #D3D3D3;
    border-radius: 8px;
}

.chat-link img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.start-dialog-button {
    position: fixed;
    bottom: 20px;
    right: 15vw;
    width: 50px;
    height: 50px;
    background-color: #00b894;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 2;
    transition: background-color 0.3s ease;
}

.start-dialog-button:hover {
    background-color: #019874;
}

.Izbran{
    display: inline-block;
    padding: 12px 30px;
    margin-top: 20px;
    background-color: #00b894;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    list-style-type: none;
    margin-left: 10px;
}

.Izbran:hover {
    background-color: #019874;
}
.chat-preview {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.chat-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-name {
    font-weight: bold;
    font-size: 16px;
}

.chat-time {
    font-size: 14px;
    color: #888;
    white-space: nowrap;
    margin-left: 12px;
}

.chat-last-message {
    font-size: 14px;
    color: #667;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 5px;
}

.unread-badge {
    position: absolute;
    top: 20px;
    right: 50px;
    background-color: #00b894;
    color: white;
    font-size: 12px;
    font-weight: bold;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.chat-link-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-link-item form {
    margin: 0;
}

.chat-link-item .btn-danger {
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 4px 6px;
    font-size: 16px;
    background: none;
    border: none;
    color: grey;
    cursor: pointer;
}

.chat-link-item:hover .btn-danger {
    opacity: 1;
}
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-box {
    background-color: #fff;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: fadeInScale 0.3s ease-in-out;
}

.modal-box p {
    margin-bottom: 20px;
    font-size: 16px;
    color: #333;
}

.modal-actions {
    display: flex;
    justify-content: space-around;
}

.confirm-btn,
.cancel-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.cancel-btn-chat {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.confirm-btn {
    background-color: #dc3545;
    color: white;
}

.confirm-btn:hover {
    background-color: #c82333;
}

.cancel-btn {
    background-color: #6c757d;
    color: white;
}

.cancel-btn:hover {
    background-color: #5a6268;
}

.chat-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 20px;
    margin-left: 15vw;
    margin-right: 15vw;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background-color: #f9f9f9;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.chat-search-form input[type="search"] {
    flex: 1;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
}

.chat-search-form input[type="search"]:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

.chat-search-form button {
    padding: 10px 14px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.chat-search-form button:hover {
    background-color: #0056b3;
}

.chat-card {
    position: relative;
}

.delete-btn {
    position: absolute;
    bottom: 8px;
    right: 12px;
    background: transparent;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 14px; /* уменьшенная иконка */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chat-card:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    color: #dc3545;
}

.chat-default-avatar {
    margin: 15px;
}

.chat-topbar { position: sticky; top: 0; z-index: 50; }
.chatbar-normal, .chatbar-search{
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
}
.chatbar-icon-btn{
  border:none;
  background:transparent;
  color:inherit;
  font-size:16px;
  padding:8px 10px;
  cursor:pointer;
}
.chatbar-search-form{
  flex:1;
}
#chatSearchInput{
  width:100%;
  border:none;
  outline:none;
  background:transparent;
  font-size:16px;
  padding:10px 6px;
}

.chatbar-right{
  margin-left: auto;
}

#chatSearchInput::-webkit-search-cancel-button,
#chatSearchInput::-webkit-search-decoration,
#chatSearchInput::-webkit-search-results-button,
#chatSearchInput::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

/* Иногда помогает дополнительно */
#chatSearchInput {
  -webkit-appearance: none;
  appearance: none;
}

.ride-topbar {
    display: block;
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.ride-topbar {
    display: block;
}

.chat-topbar .ride-back-btn { font-size: 16px;}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media screen and (min-width: 768px) {
  .chat-link {
    border-radius: 8px;
  }

  .chat-topbar {
    display: flex !important;
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 56px;
    align-items: center;
    background: #fff; .ride-back-btn
    border-bottom: 1px solid rgba(0,0,0,0.08);
  }

  .chat-topbar .ride-topbar-title{
        display: block;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
        max-width: 70%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        pointer-events: none;
  }

  .chat-topbar .ride-back-btn { display: inline-flex !important; font-size: 16px;}
  .chat-topbar .ride-topbar-title { display: block !important; }
  .chat-topbar .ride-back-btn {
      display: block;
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
      border: none;
      background: transparent;
      cursor: pointer;
    }
}


@media (max-width: 768px) {

    .chat-link-list {
        margin-right: 0vw;
        margin-left: 0vw;
        margin-top: 0px;
    }

    .start-dialog-button {
        bottom: 60px;
        right: 10px;
    }

    .chat-link-item {
        margin-left: 0px;
    }

    .chat-time {
        font-size: 12px;
    }

    .chat-last-message {
        font-size: 13px;
    }

    .chat-name {
        font-size: 14px;
    }

    .delete-btn {
        position: absolute;
        bottom: 8px;
        right: 12px;
        background: transparent;
        border: none;
        color: #aaa;
        cursor: pointer;
        font-size: 14px; /* уменьшенная иконка */
        opacity: 0.4;
        transition: opacity 0.3s ease;
    }
    .chat-link {
        width: 100vw;
        min-width: 0;
    }

    .chat-search-form {
        margin-left: 0vw;
        margin-right: 0vw;
    }
    .chatbar-normal {
        margin-top: 10px;
    }
}

.chat-avatar-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.chat-avatar-wrap {
    position: relative;
    width: 45px;
    height: 45px;
    flex-shrink: 0;
}

.chat-avatar-wrap img,
.chat-avatar-wrap .chat-default-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-online-dot {
    position: absolute;
    right: 1px;
    bottom: 1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.06);
    opacity: 0;
    transform: scale(0.85);
    transition: opacity .18s ease, transform .18s ease;
    pointer-events: none;
}

.chat-online-dot.is-online {
    opacity: 1;
    transform: scale(1);
}
