.firebase-chat-container {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(var(--vh, 1vh) * 100 - 49px);
       /* ここを追加 */
       position: absolute;
       top: -55px !important;

       margin: 0 !important;
       padding: 0 !important;
      
}
/* iOS Safari用 */
@supports (-webkit-touch-callout: none) {
    .firebase-chat-container {
        width: 100%;
        max-width: 700px;
        margin: 0 auto;
        border: 1px solid #ddd;
        border-radius: 5px;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        height: calc( var( --vh, 1vh ) * 100 - 65px );
           /* ここを追加 */
           position: absolute;
           top: -55px !important;

           margin: 0 !important;
           padding: 0 !important;
          
    }
}

.firebase-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #f9f9f9;
}

.firebase-chat-input {
    display: flex;
    border-top: 1px solid #ddd;
    padding: 10px;
    background-color: #fff;
}

.firebase-chat-input input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-right: 10px;
}

.firebase-chat-input button {
    padding: 8px 15px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.firebase-chat-input button:hover {
    background-color: #005177;
}

/* メッセージスタイル */
.chat-message {
    display: flex;
    margin-bottom: 18px;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-avatar {
    width: 40px;
    margin-right: 10px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.message-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 4px;
}

.message-content {
    flex: 1;
    background-color: #fff;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    position: relative;
    max-width: 80%;
}

.avatar-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 2px;
}

.avatar-name {
    font-size: 0.7em;
    font-weight: bold;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.avatar-time {
    font-size: 0.65em;
    color: #999;
    white-space: nowrap;
}

.message-text {
    word-break: break-word;
    line-height: 1.4;
}

/* 自分のメッセージ */
.own-message {
    flex-direction: row-reverse;
}

.own-message .message-avatar {
    margin-right: 0;
    margin-left: 10px;
    
}

.own-message .avatar-name {
    color: #0073aa;
}

.own-message .message-content {
    background-color: #e3f2fd;
    border-top-right-radius: 4px;
}

.other-message .message-content {
    border-top-left-radius: 4px;
}

/* エラーメッセージ */
.error-message {
    background-color: #ffebee;
    color: #d32f2f;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    text-align: center;
}

/* タイピング表示 */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    background-color: #f5f5f5;
    border-radius: 10px;
    margin: 10px 0;
    width: fit-content;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    margin: 0 1px;
    background-color: #999;
    border-radius: 50%;
    display: inline-block;
    animation: typingAnimation 1s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.5); }
    100% { transform: scale(1); }
}

/* メッセージコンテンツの調整 */
.message-content {
    margin-top: 24px;
}
