/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #eae6df;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 70px;
    padding-bottom: 70px;
}

/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #008069;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
}

.logo-container h1 {
    color: white;
    font-size: 1.8rem;
    font-weight: 500;
}

.navigation a {
    margin-left: 20px;
    text-decoration: none;
    color: white;
    font-weight: 500;
    transition: color 0.3s;
    font-size: 0.9rem;
}

.navigation a:hover {
    color: #d1f0e0;
}

/* Main Container */
.main-container {
    max-width: auto;
    margin: 0 auto;
    padding: 15px;
    flex: 1;
    display: grid;
    grid-template-columns: 200px auto 750px;
    gap: 30px;
}

/* Participants Section */
.participants-section {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    height: fit-content;
}

.participants-section h2 {
    margin-bottom: 20px;
    color: #008069;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.participant {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
}

.avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}

.participant-name {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.upload-avatar-btn {
    background-color: #008069;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.upload-avatar-btn:hover {
    background-color: #006a56;
}

#add-participant {
    width: 100%;
    padding: 10px;
    background-color: #f0f2f5;
    border: 1px dashed #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    color: #666;
}

#add-participant:hover {
    background-color: #e0e5ea;
}

/* Chat Section */
.chat-section {
    display: flex;
    flex-direction: column;
    height: calc(115vh - 180px);
}

#chat-container {
    flex: 1;
    background-image: url(assets/Backgeound.jpg);
    border-radius: 10px;
    padding: 10px;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

#messages-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
    padding-top: 10px;
}

.message {
    display: flex;
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.sent {
    align-self: flex-end;
}

.message .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

.message.sent .avatar {
    margin-right: 0;
    margin-left: 8px;
}

.message-content {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 7.5px;
    position: relative;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 15px;
    box-shadow: 0 1px 0.5px rgba(0,0,0,0.13);
}

.message.received .message-content {
    background-color: white;
    border-top-left-radius: 0.5px;
    align-self: flex-start;
    margin-right: auto;
}

.message.sent .message-content {
    background-color: #d9fdd3;
    border-bottom-right-radius: 0.5px;
    align-self: flex-end;
    margin-left: auto;
}

.message-content img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 5px;
}

.url-preview {
    max-width: 300px;
    background: #f0f2f5;
    border-radius: 8px;
    padding: 10px;
    margin-top: 10px;
    font-size: 0.85rem;
}

.url-preview a {
    color: #008069;
    text-decoration: none;
    font-weight: bold;
}

/* Controls */
.controls {
    margin-top: 20px;
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.message-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#sender-selector {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
}

#message-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
}

#send-message {
    padding: 10px 20px;
    background-color: #008069;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
}

#send-message:hover {
    background-color: #006a56;
}

.animation-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.animation-controls button {
    padding: 10px 15px;
    background-color: #008069;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
}

.animation-controls button:hover {
    background-color: #006a56;
}

#clear-chat {
    background-color: #ff6b6b;
}

#clear-chat:hover {
    background-color: #ff5252;
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #008069;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.footer-links a {
    margin-right: 15px;
    text-decoration: none;
    color: white;
    font-size: 0.9rem;
}

.social-links img {
    width: 24px;
    height: 24px;
    margin-left: 10px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.social-links img:hover {
    opacity: 1;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.setting-item input[type="number"],
.setting-item input[type="checkbox"] {
    margin-top: 5px;
}

.avatar-upload-container {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.avatar-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar-upload img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 10px;
}

.faq-item {
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.faq-item p {
    font-size: 13px;
}

/* Cookie Banner */
/* .cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #333;
    color: white;
    padding: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1500;
} */

/* .cookie-banner p {
    margin: 0;
    flex: 1;
} */

/* #accept-cookies {
    background-color: #008069;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 15px;
} */

/* WhatsApp-like message bubbles */
.message-content {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.message.received .message-content {
    background-color: white;
    border-top-left-radius: 0.5px;
}

.message.sent .message-content {
    background-color: #d9fdd3;
    border-bottom-right-radius: 0.5px;
}

/* Responsive Design */
@media (max-width: 900px) {
    .main-container {
        grid-template-columns: 1fr;
    }
    
    .participants-section {
        order: 2;
    }
    
    .chat-section {
        order: 1;
        height: auto;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .navigation a {
        margin: 0 5px;
    }
    
    .message-input-container {
        flex-direction: column;
    }
    
    .animation-controls {
        flex-direction: column;
    }
    
    .avatar-upload-container {
        flex-direction: column;
        align-items: center;
    }
    
    /* .cookie-banner {
        flex-direction: column;
        text-align: center;
    } */
    
    /* #accept-cookies {
        margin: 10px auto 0;
    } */
}