* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: #1c1e21;
}

.chat-container {
    width: 100%;
    max-width: 100%;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
}

@media (min-width: 768px) {
    .chat-container {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
        box-shadow: none;
        border: none;
        overflow: hidden;
    }
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 12px 20px;
    border-bottom: 1px solid #e4e6eb;
    z-index: 10;
}

.header-bar h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #050505;
}

.header-bar button {
    background: none;
    border: none;
    color: #65676b;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-bar button:hover {
    background-color: #f2f2f2;
}

.status-box {
    padding: 10px 16px;
    text-align: center;
    font-size: 0.95rem;
    background-color: #fffbe6;
    color: #d48806;
    border-bottom: 1px solid #ffe58f;
    font-weight: 500;
}

#partner-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: #ffffff;
    border-bottom: 1px solid #e4e6eb;
}

#partner-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #e4e6eb;
}

.partner-info {
    display: flex;
    flex-direction: column;
}

#partner-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #050505;
}

#partner-card p {
    font-size: 0.95rem;
    color: #65676b;
    margin-top: 2px;
}

.chat-box {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: #ffffff;
    position: relative;
}

.chat-box::-webkit-scrollbar {
    width: 6px;
}
.chat-box::-webkit-scrollbar-thumb {
    background-color: #bcc0c4;
    border-radius: 3px;
}

.message {
    max-width: 65%;
    padding: 12px 16px;
    font-size: 1.1rem;
    line-height: 1.4;
    word-break: break-word;
    border-radius: 18px;
}

.message.me {
    align-self: flex-end;
    background-color: #0084ff;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.partner {
    align-self: flex-start;
    background-color: #e4e6eb;
    color: #050505;
    border-bottom-left-radius: 4px;
}

.message.system {
    align-self: center;
    background-color: transparent;
    color: #65676b;
    font-size: 0.95rem;
    padding: 8px 0;
    max-width: 90%;
    text-align: center;
}

.message img,
.message video {
    max-width: 100%;
    border-radius: 12px;
    margin-top: 4px;
}

.controls {
    display: flex;
    gap: 10px;
    padding: 10px 20px;
    background-color: #ffffff;
    border-top: 1px solid #e4e6eb;
}

.controls button {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background-color: #f0f2f5;
    color: #050505;
}

#btn-match {
    background-color: #e7f3ff;
    color: #1877f2;
}
#btn-match:hover:not(:disabled) {
    background-color: #dbeafe;
}

#btn-exit {
    background-color: #ffebe9;
    color: #d12929;
}
#btn-exit:hover:not(:disabled) {
    background-color: #ffdce0;
}

.input-group {
    display: flex;
    gap: 10px;
    padding: 12px 20px;
    background-color: #ffffff;
    border-top: 1px solid #e4e6eb;
    align-items: center;
}

.input-group input[type="text"] {
    flex: 1;
    padding: 14px 20px;
    border: 1px solid #ccd0d5;
    border-radius: 20px;
    outline: none;
    font-size: 1.1rem;
    background-color: #f0f2f5;
    color: #050505;
}

.input-group input[type="text"]:focus {
    border-color: #1877f2;
}

.input-group button {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background-color: transparent;
    color: #0084ff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-group button:hover:not(:disabled) {
    background-color: #f0f2f5;
}

.input-group button:disabled {
    color: #bcc0c4;
    cursor: default;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    z-index: 100;
    transition: opacity 0.2s;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background-color: #ffffff;
    width: 100%;
    max-width: 400px;
    padding: 32px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

.loading-content,
.exit-room-content {
    align-items: center;
    text-align: center;
}

.modal-content h3 {
    color: #050505;
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 4px;
}

.modal-content p {
    text-align: center;
    color: #65676b;
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.modal-content input,
.modal-content select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #ccd0d5;
    border-radius: 6px;
    font-size: 1.1rem;
    outline: none;
    color: #050505;
}

.modal-content input:focus,
.modal-content select:focus {
    border-color: #1877f2;
}

.avatar-upload-group {
    display: flex;
    gap: 8px;
    align-items: center;
}
.avatar-upload-group input {
    flex: 1;
}

.modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    width: 100%;
}

.btn-accept,
.btn-reject {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-accept {
    background-color: #0084ff;
    color: white;
}
.btn-accept:hover {
    background-color: #0073e6;
}

.btn-reject {
    background-color: #e4e6eb;
    color: #050505;
}
.btn-reject:hover {
    background-color: #d8dadf;
}

.close-modal {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #65676b;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.close-modal:hover {
    background-color: #f2f2f2;
}

.mt-2 {
    margin-top: 8px;
}
.w-full {
    width: 100%;
}

.sleeping-cat-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 10px auto;
    border: 2px solid #e4e6eb;
}

.sidebar {
    position: fixed;
    top: 0;
    right: -350px;
    width: 350px;
    max-width: 80%;
    height: 100vh;
    background-color: #ffffff;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar.active {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e4e6eb;
}
.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}
.close-sidebar {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #65676b;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}
.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 20px;
    border-bottom: 1px solid #e4e6eb;
}

#my-avatar-display {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    border: 3px solid #0084ff;
    background-color: #e4e6eb;
}

.my-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #050505;
}

.my-id {
    color: #65676b;
    font-size: 1rem;
    margin-top: 4px;
}

.sidebar-item {
    padding: 16px 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    color: #050505;
    transition: background-color 0.2s;
}
.sidebar-item:hover {
    background-color: #f2f2f2;
}