/* General Styles */
body {
    background: linear-gradient(to bottom, #ddd, #f2f2f2);
    font-family: Tahoma, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

/* Chat Container */
.chat-container {
    width: 35%;
    max-width: 40rem;
    height: 80vh;
    background: linear-gradient(to bottom, #c6c2c3, #e2ddde, #c7c4c4, #afacac);
    border-radius: 15px;
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.1);
    padding-right: 7rem;
    padding-left: 7rem;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
}

/* Chat Header */
.chat-header {
    text-align: center;
    padding: 2rem 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0px 10px 10px -6px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
}

.chat-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: bold;
    color: #333;
}

.subtitle {
    font-size: 0.875rem;
    color: #666;
    margin: 5px 0 0 0;
}

/* Chat Logs */
.chatlogs {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chatlogs::-webkit-scrollbar {
    display: none;
}

/* Chat Message */
.chat {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.chat.friend {
    justify-content: flex-start;
}

.chat.self {
    justify-content: flex-end;
}

.chat-message {
    padding: 10px 14px;
    max-width: 70%;
    word-wrap: break-word;
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.4;
}

.friend .chat-message {
    background: linear-gradient(#484454, #484454, #484454, #484454b1);
    color: white;
    border-radius: 0px 20px 20px 20px;
}

.self .chat-message {
    background: #f4f1f3;
    color: rgb(57, 40, 40);
    border-radius: 20px 20px 0px 20px;
}

/* Timestamp */
.timestamp {
    text-align: center;
    font-size: 0.75rem;
    color: #888;
    margin: 15px 0;
}

/* User Photo */
.user-photo {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: -3px 3px 0px rgba(114, 95, 95, 0.238);
    flex-shrink: 0;
}

.user-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Input Area */
.input-container {
    padding-bottom: 4rem;
    margin-top: auto;
}

.chat-input {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 20px;
    padding: 5px 10px;
    width: 100%;
    box-shadow: 0px 0px 20px rgb(255, 233, 233);
}

.chat-input input {
    flex: 1;
    border: none;
    outline: none;
    padding: 8px;
    font-size: 0.875rem;
    min-width: 0;
}

.send-btn {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn img {
    width: 1.5rem;
    height: 1.5rem;
}

/* Mobile Specific Styles */
@media (max-width: 480px) {
    .chat-container {
        width: 95%;
        height: 95vh;
        padding: 10px;
    }

    .chat-message {
        max-width: 80%;
        font-size: 0.813rem;
        padding: 8px 12px;
    }

    .user-photo {
        width: 2rem;
        height: 2rem;
    }

    .chat-header h2 {
        font-size: 1.125rem;
    }

    .subtitle {
        font-size: 0.75rem;
    }

    .input-container {
        padding-bottom: 2rem;
        width: 80%;
        margin: 0 auto;
    }

    .chat-input {
        display: flex
    ;
        align-items: center;
        background: white;
        border-radius: 20px;
        padding: 5px 10px;
        width: 100%;
        box-shadow: 0px 0px 20px rgb(255, 233, 233);
    }
}

/* Tablet Styles */
@media (min-width: 481px) and (max-width: 1024px) {
    .chat-container {
        width: 85%;
        max-width: 40rem;
    }
}

/* Landscape Warning */
@media screen and (max-height: 450px) and (orientation: landscape) {
    body {
        background: #000;
    }

    .chat-container {
        display: none;
    }

    body::before {
        content: "Please rotate your device to portrait mode 📱";
        color: white;
        font-size: 1.125rem;
        font-weight: bold;
        text-align: center;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100%;
        padding: 20px;
    }
}


