.chat-page {
    min-height:
        calc(100vh - 70px);

    padding: 45px 8%;

    display: flex;

    justify-content: center;

    align-items: center;
}


.chat-container {
    width: 100%;

    max-width: 900px;

    background-color: var(--surface);

    border:
        1px solid var(--border);

    border-radius: 22px;

    overflow: hidden;

    box-shadow:
        0 25px 70px
        rgba(0, 0, 0, 0.18);
}


/* CHAT HEADER */

.chat-header {
    min-height: 105px;

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 20px;

    padding: 22px 28px;

    border-bottom:
        1px solid var(--border);

    background-color: var(--surface);
}


.chat-header-left {
    display: flex;

    align-items: center;

    gap: 16px;
}


.chat-icon {
    width: 56px;

    height: 56px;

    flex-shrink: 0;

    display: flex;

    justify-content: center;

    align-items: center;

    border-radius: 17px;

    background-color: var(--primary);

    color: white;

    font-size: 28px;
}


.chat-header h1 {
    font-size: 25px;

    margin-bottom: 6px;

    color: var(--text);
}


.chat-header p {
    margin: 0;

    font-size: 14px;

    color: var(--muted);
}


.chat-header-right {
    text-align: right;
}


.chat-online {
    display: flex;

    align-items: center;

    justify-content: flex-end;

    gap: 8px;

    font-size: 14px;

    font-weight: 700;

    color: var(--text);
}


.online-dot {
    width: 9px;

    height: 9px;

    border-radius: 50%;

    background-color: #22c55e;

    box-shadow:
        0 0 10px
        rgba(34, 197, 94, 0.65);
}


.chat-online-description {
    margin-top: 7px;

    font-size: 12px;

    color: var(--muted);
}


/* MATCHING */

.chat-area {
    min-height: 460px;

    background-color: var(--background);
}


.matching-screen {
    min-height: 460px;

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    text-align: center;

    padding: 40px 25px;
}


.matching-icon {
    width: 82px;

    height: 82px;

    margin-bottom: 22px;

    display: flex;

    justify-content: center;

    align-items: center;

    border-radius: 25px;

    background-color: var(--primary);

    color: white;

    font-size: 38px;

    box-shadow:
        0 12px 35px
        rgba(52, 120, 246, 0.3);
}


.matching-circle {
    width: 65px;

    height: 65px;

    margin:
        0 auto 25px;

    border:
        5px solid var(--secondary);

    border-top-color:
        var(--primary);

    border-radius: 50%;

    animation:
        spin 1s linear infinite;
}


@keyframes spin {

    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }

}


.matching-screen h2 {
    margin-bottom: 10px;

    font-size: 26px;

    color: var(--text);
}


.matching-screen p {
    max-width: 430px;

    line-height: 1.6;

    color: var(--muted);
}


/* =========================================================
   RANDOM CONVERSATION
========================================================= */

.conversation {
    display: none;

    width: 100%;

    height: 460px;

    background-color: var(--background);

    flex-direction: column;
}


.messages {
    height: 370px;

    overflow-y: auto;

    padding: 24px;

    display: flex;

    flex-direction: column;

    gap: 18px;
}


/* MESSAGE ROW */

.message {
    max-width: 72%;

    padding: 12px 16px;

    line-height: 1.5;

    word-break: break-word;

    font-size: 15px;

    border-radius: 17px;

    transition:
        0.2s ease;
}


/* RECEIVED = LEFT */

.message.received {
    align-self: flex-start;

    background-color: #243752;

    color: white;

    border-bottom-left-radius: 5px;

    box-shadow:
        0 5px 18px
        rgba(0, 0, 0, 0.12);
}


/* SENT = RIGHT */

.message.sent {
    align-self: flex-end;

    background-color: var(--primary);

    color: white;

    border-bottom-right-radius: 5px;

    box-shadow:
        0 5px 18px
        rgba(52, 120, 246, 0.22);
}


/* =========================================================
   CHAT FORM
========================================================= */

.message-form {
    height: 90px;

    display: flex;

    align-items: center;

    gap: 10px;

    padding: 18px 22px;

    background-color: var(--surface);

    border-top:
        1px solid var(--border);
}


.message-form input {
    flex: 1;

    min-width: 0;

    height: 52px;

    padding: 0 17px;

    border:
        1px solid var(--border);

    border-radius: 13px;

    background-color: var(--surface-2);

    color: var(--text);

    font-family: inherit;

    font-size: 15px;

    outline: none;

    transition:
        0.2s ease;
}


.message-form input::placeholder {
    color: var(--muted);
}


.message-form input:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px
        rgba(52, 120, 246, 0.12);
}


.message-form button {
    height: 52px;

    padding: 0 23px;

    border: none;

    border-radius: 13px;

    background-color: var(--primary);

    color: white;

    font-family: inherit;

    font-size: 15px;

    font-weight: 700;

    cursor: pointer;

    transition:
        0.2s ease;
}


.message-form button:hover {
    background-color: var(--primary-dark);

    transform: translateY(-1px);
}


/* =========================================================
   RANDOM CHAT ACTIONS
========================================================= */

.chat-actions {
    display: flex;

    justify-content: center;

    align-items: center;

    gap: 12px;

    padding: 14px 22px;

    border-top:
        1px solid var(--border);

    background-color: var(--surface);
}


.chat-btn {
    padding: 10px 20px;

    border-radius: 9px;

    font-family: inherit;

    font-size: 14px;

    font-weight: 600;

    cursor: pointer;

    transition:
        0.2s ease;
}


.secondary-btn {
    background-color: var(--surface);

    color: var(--text);

    border:
        1px solid var(--border);
}


.secondary-btn:hover {
    border-color: var(--primary);

    color: var(--primary);
}


#skip-btn {
    padding: 10px 20px;

    border: none;

    border-radius: 9px;

    background-color: var(--primary);

    color: white;

    font-family: inherit;

    font-size: 14px;

    font-weight: 700;

    cursor: pointer;

    transition:
        0.2s ease;
}


#skip-btn:hover {
    background-color: var(--primary-dark);

    transform: translateY(-1px);
}


#leave-chat,
#group-leave {
    padding: 10px 18px;

    border: none;

    background: transparent;

    color: var(--danger);

    font-family: inherit;

    font-size: 14px;

    font-weight: 700;

    cursor: pointer;

    transition:
        0.2s ease;
}


#leave-chat:hover,
#group-leave:hover {
    color: #dc2626;

    transform: translateY(-1px);
}


/* =========================================================
   GROUP PAGE
========================================================= */

