* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    overflow: hidden;
}

#app {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.screen {
    display: none;
    width: 100%;
    height: 100%;
}

.screen.active {
    display: flex;
}

.auth-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.auth-container h1 {
    color: #667eea;
    margin-bottom: 10px;
}

.auth-container p {
    color: #666;
    margin-bottom: 30px;
}

#username-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 16px;
    margin-bottom: 15px;
    transition: border-color 0.3s;
}

#username-input:focus {
    outline: none;
    border-color: #667eea;
}

#login-btn {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

#login-btn:hover {
    background: #5568d3;
}

.info-text {
    font-size: 12px;
    color: #999;
    margin-top: 15px;
}

.error-message {
    color: #e74c3c;
    margin-top: 10px;
    font-size: 14px;
}

#chat-screen {
    display: none;
}

#chat-screen.active {
    display: flex;
}

.sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.user-profile {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-profile h3 {
    color: #333;
}

#logout-btn {
    padding: 8px 15px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.search-section {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

#search-user-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
}

.search-results {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
}

.search-result-item {
    padding: 10px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: #f0f0f0;
}

.conversations-section {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.conversations-section h4 {
    margin-bottom: 10px;
    color: #666;
}

.conversation-item {
    padding: 12px;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 5px;
    transition: background 0.2s;
    position: relative;
}

.conversation-item:hover {
    background: #f0f0f0;
}

.conversation-item.active {
    background: #667eea;
    color: white;
}

.conversation-username {
    font-weight: bold;
    margin-bottom: 5px;
}

.conversation-last-message {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-item.active .conversation-last-message {
    color: rgba(255, 255, 255, 0.8);
}

.unread-badge {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.sidebar-actions {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
}

.sidebar-actions button {
    width: 100%;
    padding: 10px;
    margin-bottom: 8px;
    background: #f0f0f0;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

.sidebar-actions button:hover {
    background: #e0e0e0;
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
}

.no-chat-selected {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #999;
    font-size: 18px;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-container.hidden {
    display: none;
}

.chat-header {
    padding: 20px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    color: #333;
}

.chat-actions button {
    background: none;
    border: none;
    font-size: 20px;
    margin-left: 10px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background 0.2s;
}

.chat-actions button:hover {
    background: #f0f0f0;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.message.sent {
    align-items: flex-end;
}

.message.received {
    align-items: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 15px;
    word-wrap: break-word;
}

.message.sent .message-bubble {
    background: #667eea;
    color: white;
}

.message.received .message-bubble {
    background: white;
    color: #333;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

.message-translated {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
}

.message-input-area {
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.translation-preview {
    padding: 10px;
    background: #fff3cd;
    border-radius: 5px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #856404;
}

.translation-preview.hidden {
    display: none;
}

#message-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 10px;
}

#message-input:focus {
    outline: none;
    border-color: #667eea;
}

#send-message-btn {
    padding: 12px 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

#send-message-btn:hover {
    background: #5568d3;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
}

.social-links-form input,
#remark-input,
#suggestion-input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
}

.social-links-form button,
#save-remark-btn,
#submit-suggestion-btn {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

.close-modal-btn {
    width: 100%;
    padding: 12px;
    background: #e0e0e0;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

.suggestions-list {
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    margin-bottom: 10px;
}

.suggestion-item h4 {
    color: #667eea;
    margin-bottom: 5px;
}

.suggestion-item p {
    color: #666;
    margin-bottom: 10px;
}

.suggestion-votes {
    font-size: 12px;
    color: #999;
}

.video-call-content {
    max-width: 800px;
}

.video-call-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.end-call-btn {
    padding: 10px 20px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.video-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.video-container video {
    width: 100%;
    border-radius: 10px;
    background: #000;
}

@media (max-width: 768px) {
    .sidebar {
        width: 250px;
    }
    
    .video-container {
        grid-template-columns: 1fr;
    }
}
