/* ------------------------------------------------------------------------------------------------------------------ */
/* チャット一覧ページ */

.chat-list-page {
    background: #fff;
    width: 100%;
    max-width: 1024px;
    margin: 0 auto;
    box-sizing: border-box;
    font-family: 'Noto Sans JP', sans-serif;
    overflow-y: auto;
    font-weight: 500;
    padding-right: 20px;
    padding-left: 20px;
}

.chat-list-page, 
.chat-list-page * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.chat-list-empty {
    text-align: center;
    color: #AAAAAC;
    font-size: 1rem;
    margin-top: 40px;
}

.chat-list-empty--filtered {
    text-align: center;
    color: #AAAAAC;
    font-size: 1rem;
    margin-top: 2.5rem;
}

.chat-room-box {
    display: block;
    text-decoration: none;
    color: #535353;
    position: relative;
    width: 100%;
    padding-left: 0px;
    padding-right: 0px;
    padding-bottom: 10px;
    padding-top: 10px;
}

.chat-room-box-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: relative;
}

.chat-room-box-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-room-box-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    user-select: none;
    pointer-events: none;
}

.chat-room-box-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
}

.chat-room-box-name {
    font-size: 0.875rem;
}

.chat-room-box-last-message {
    font-size: 0.875rem;
    color: #535353;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.chat-room-box-last-message a {
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
    word-break: break-word;
    pointer-events: none;
    cursor: default;
}

/* 未読メッセージのバッジ */
.chat-room-box-badge {
    background: #E9528E;
    color: white;
    font-size: 0.75rem;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 70%;
    right: 10px;
    transform: translateY(-50%);
}

.chat-room-box-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.chat-room-box-time {
    font-size: 0.75rem;
    color: #AAAAAC;
    right: 10px;
    position: absolute;
    top: 0%;
}

.chat-room-content-for-preview {
    flex: 1;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;   
}

.chat-room-messages-for-preview {
    display: flex;
    flex-direction: column;
    height: 60dvh;
    overflow-y: hidden;
    pointer-events: auto;
    padding-right: 10px;
    padding-left: 10px;
}

.chat-room-messagess-for-preview-no-scroll {
    overflow: hidden !important;
    pointer-events: none;
}

.chat-date-header-for-preview {
    font-size: 10px;
    color: #AAAAAC;
    margin-bottom: 10px;
    text-align: center;
    background-color: #F5F5F5;
    padding: 2px;
    border-radius: 10px;
    width: 100px;
    margin-left: auto;
    margin-right: auto;
}

.chat-message-for-preview {
    margin-bottom: 10px;
    max-width: 70%;
    word-wrap: break-word;
    padding: 8px 12px;
    border-radius: 16px;
    position: relative;
    display: flex;
    flex-direction: row;
    gap: 3px;
}

.chat-message-for-preview.left {
    align-self: flex-start;
    text-align: left;
    flex-direction: row-reverse;
    padding-left: 0px;
}

.chat-message-for-preview.right {
    align-self: flex-end;
    text-align: right;
    padding-right: 0px;
}

.chat-message-deleted-for-preview {
    margin-bottom: 10px;
    width: 250px;
    background-color: #F5F5F5;
    border: 1px dashed #AAAAAC;
    padding: 10px 15px;
    border-radius: 16px;
    text-align: center;
    color: #AAAAAC;
    font-size: 0.75rem;
    word-wrap: break-word;
    align-self: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-message-deleted-text-for-preview {
    margin-bottom: 5px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.chat-message-time-for-preview {
    font-size: 10px;
    color: #AAAAAC;
    text-align: right;
    margin-top: 0px;
    width: 26px;
}

.chat-message-read-for-preview {
    font-size: 10px;
    color: #AAAAAC;
}

.chat-message-text-area-for-preview{
    word-wrap: break-word;
    padding: 8px 12px;
    border-radius: 18px;
    position: relative;
    width: 100%;
    overflow-x: hidden;
}

.chat-message-text-area-for-preview.left {
    background-color: #F5F5F5;
    text-align: left;
}

.chat-message-text-area-for-preview.right {
    background-color: #F3E7FD;
    text-align: left;
}

.chat-message-text-for-preview {
    font-size: 0.875rem;
    user-select: none;
    color: #535353;
}

.chat-message-text-for-preview a {
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
    color: #7D40A0;
    word-break: break-word;
    pointer-events: none;
    cursor: default;
}

.chat-message-image-area-for-preview{
    word-wrap: break-word;
    padding: 8px 12px;
    position: relative;
    width: 100%;
}

.chat-message-image-for-preview {
    border-radius: 16px;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-message-image-area-for-preview.left {
    text-align: left;
}

.chat-message-image-area-for-preview.right {
    text-align: left;
}

.chat-room-footer-for-preview {
    background: #fff;
    padding-left: 20px;
    padding-right: 20px;
    padding-top: 10px;
    padding-bottom: 10px;  
    border-top: 1px solid #AAAAAC;
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
}

#chat-room-down-button-for-preview {
    position: absolute;
    bottom: 65px;
    right: 10px;
    background: #ffffff;
    border: solid 1px #333;
    padding: 4px 4px;
    border-radius: 8px;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

#chat-room-down-button-for-preview img {
    width: 100%;
    height: 100%;
}

#chat-room-form-for-preview {
    font-size: 1rem;
    display: flex;
    width: 100%;
    gap: 5px;
    align-items: center;
}

#chat-room-textarea-for-preview {
    flex: 1;
    border: 1px solid #ccc;
    padding: 5px;
    border-radius: 8px;
    resize: none;
    font-size: 0.875rem;
    max-height: 200px;
    overflow-y: auto;
    color: #535353;
}

#chat-room-send-button-for-preview,
#chat-room-image-upload-for-preview {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    padding: 4px 4px;
}

#chat-room-send-button-for-preview img
#chat-room-image-upload-for-preview img {
    width: 100%;
    height: 100%;
}

.chat-room-box.not-matched {
    pointer-events: auto;
}

.chat-room-box-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(100, 100, 100, 0.7);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    border-radius: 10px;
}

.chat-room-box-overlay-message {
    color: #fff;
    font-size: 0.875rem;
    text-align: center;
    pointer-events: none;
}

.chat-list-page-display-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 6.5rem !important;
    right: 1.25rem;
    z-index: 1000;
    flex-direction: column;
}

@media screen and (min-width: 1024px) {
    .chat-list-page-display-toggle {
        right: calc(13.0208333333% + 1.25rem);
    }
}

.chat-list-page-display-toggle-text {
    color: #AAAAAC;
    font-size: 0.875rem;
}

.chat-list-page-switch {
    position: relative;
    display: inline-block;
    width: 85px;
    height: 34px;
}

.chat-list-page-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.chat-list-page-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #AAAAAC;
    transition: 0.4s;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
}

.chat-list-page-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    border-radius: 50px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
}

.chat-list-page-text-on,
.chat-list-page-text-off {
    position: absolute;
    font-size: 0.75rem;
    color: white;
    transition: 0.4s;
}

.chat-list-page-text-off {
    left: 33px;
    opacity: 1;
}

.chat-list-page-text-on {
    right: 35px;
    opacity: 0;
}

.chat-list-page-switch input:checked + .chat-list-page-slider {
    background-color: #7D40A0;
}

.chat-list-page-switch input:checked + .chat-list-page-slider:before {
    transform: translateX(50px); 
}

.chat-list-page-switch input:checked + .chat-list-page-slider .chat-list-page-text-on {
    opacity: 1;
}

.chat-list-page-switch input:checked + .chat-list-page-slider .chat-list-page-text-off {
    opacity: 0;
}


/* ------------------------------------------------------------------------------------------------------------------ */
/* チャットルームページ */

.chat-room-page {
    background: #F7F7FA;
    width: 100%;
    max-width: 1024px;
    margin: 0 auto;
    box-sizing: border-box;
    font-family: 'Noto Sans JP', sans-serif;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-weight: 500;
    touch-action: auto;
}

.chat-room-header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
    width: 100%;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    height: 4rem !important;
    background: rgba(255, 255, 255, 0.92);
    padding-right: 20px;
    padding-left: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

.chat-room-header-back-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin-right: 10px;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.chat-room-header-back-button img {
    width: 1.5rem !important;
    height: 1.5rem !important;
}

.chat-room-header-avatar {
    width: 3rem !important;
    height: 3rem !important;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 5px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.chat-room-header-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.chat-room-header-name {
    font-size: 1rem !important;
    color: #535353;
}

.chat-room-content {
    background-color: #ffffff;
    flex: 1;
    z-index: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    margin-top: 50px;
    padding-top: 10px;
    padding-bottom: 0px;
    padding-left: 10px;
    padding-right: 10px;
}

.chat-room-messages {
    display: flex;
    flex-direction: column;
}

.chat-date-header {
    font-size: 10px;
    color: #AAAAAC;
    margin-bottom: 10px;
    text-align: center;
    background-color: #F5F5F5;
    padding: 2px;
    border-radius: 10px;
    width: 100px;
    margin-left: auto;
    margin-right: auto;
}

.chat-message {
    margin-bottom: 10px;
    max-width: 70%;
    word-wrap: break-word;
    padding: 8px 12px;
    border-radius: 16px;
    position: relative;
    display: flex;
    flex-direction: row;
    gap: 3px;
}

.chat-message.left {
    align-self: flex-start;
    text-align: left;
    flex-direction: row-reverse;
    padding-left: 0px;
}

.chat-message.right {
    align-self: flex-end;
    text-align: right;
    padding-right: 0px;
}


.chat-message-deleted {
    margin-bottom: 10px;
    width: 250px;
    background-color: #F5F5F5;
    border: 1px dashed #AAAAAC;
    padding: 10px 15px;
    border-radius: 16px;
    text-align: center;
    color: #AAAAAC;
    font-size: 0.75rem;
    word-wrap: break-word;
    align-self: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-message-deleted-text {
    margin-bottom: 5px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}


.chat-message-time {
    font-size: 10px;
    color: #AAAAAC;
    text-align: right;
    margin-top: 0px;
    width: 26px;
}

.chat-message-read {
    font-size: 10px;
    color: #AAAAAC;
}

.chat-message-text-area{
    word-wrap: break-word;
    padding: 8px 12px;
    border-radius: 16px;
    position: relative;
    width: 100%;
    overflow-x: hidden;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.chat-message-text-area.left {
    background-color: #ffffff;
    text-align: left;
}

.chat-message-text-area.right {
    background-color: rgba(125, 64, 160, 0.12);
    text-align: left;
}

.chat-message-text {
    font-size: 0.875rem;
    user-select: none;
    color: #535353;
}

.chat-message-text a {
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
    color: #7D40A0;
    word-break: break-word;
}

.chat-message-image-area{
    word-wrap: break-word;
    padding: 8px 12px;
    position: relative;
    width: 100%;
}

.chat-message-image {
    border-radius: 16px;
    width: 100%;
    height: 100%;
    object-fit: cover;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.chat-message-image-area.left {
    text-align: left;
}

.chat-message-image-area.right {
    text-align: left;
}

.chat-room-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    width: 100%;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: flex-start;
    padding-left: 20px;
    padding-right: 20px;
    padding-top: 10px;
    padding-bottom: 10px;  
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 -10px 26px rgba(15, 23, 42, 0.08);
}

#chat-room-down-button-spare {
    position: absolute;
    bottom: 6.5rem;
    right: 0.625rem;
    background: #9E6CBB;
    padding: 0.25rem 0.25rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.125rem;
    height: 3.125rem;
    z-index: 100;
    box-shadow: 0 12px 26px rgba(125, 64, 160, 0.30);
    transition: transform 0.12s ease;
}

#chat-room-down-button-spare img {
    width: 100%;
    height: 100%;
}

#chat-room-down-button-spare.has-new::after {
    content: '新着あり';
    position: absolute;
    top: -25px;
    right: 50%;
    transform: translateX(50%);
    background: #9E6CBB;
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 10px 22px rgba(125, 64, 160, 0.25);
}

#chat-room-form {
    font-size: 1rem;
    display: flex;
    width: 100%;
    gap: 5px;
    align-items: center;
}

#chat-room-textarea {
    flex: 1;
    border: 1px solid #ccc;
    padding: 5px;
    border-radius: 8px;
    resize: none;
    font-size: 0.875rem;
    max-height: 200px;
    overflow-y: auto;
    color: #535353;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
}

#chat-room-send-button,
#chat-room-image-upload {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto !important;
    padding: 0.25rem 0.25rem;
    width: 2.1875rem;
}

#chat-room-send-button img,
#chat-room-image-upload img {
    width: 100%;
    height: 100%;
}

.chat-room-reserve-button{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: #fff;
    border-radius: 999px;
    background: #E9528E;
    white-space: nowrap;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    width: 60px;
}

#chat-room-upload-progress {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #e0e0e0;
    border-radius: 10px;
}

#chat-room-progress-bar {
    height: 100%;
    background: linear-gradient(to right, #7D40A0, #9E6CBB);
    width: 0%;
    border-radius: 8px;
    transition: width 0.4s ease-out;
}


div:where(.swal2-container) img:where(.swal2-image) {
    margin: 0px !important;
    object-fit: cover;
}

.swal2-popup.swal2-modal.swal2-show {
    padding: 0px;
}

#chat-room-textarea { min-width: 0; }

#chat-room-collapse-button {
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  position: relative;
}

#chat-room-collapse-button::before {
  position: absolute;
  display: block;
  content: "";
  top: 50%;
  right: 50%;
  width: 0.6rem;
  height: 0.6rem;
  border-bottom: 1px solid #535353;
  border-left: 1px solid #535353;
  -webkit-transform: translate(50%, -50%) rotate(-135deg);
  transform: translate(50%, -50%) rotate(-135deg);
}

#chat-room-form.is-textarea-focus .chat-room-reserve-button,
#chat-room-form.is-textarea-focus #chat-room-image-upload {
  display: none !important;
}

#chat-room-form.is-textarea-focus #chat-room-collapse-button {
  display: inline-flex !important;
}

