* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a2e;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 700px;
    max-width: 98%;
    height: 650px;
    background: #16213e;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: #0f3460;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e94560;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-header h1 {
    font-size: 20px;
}

.badge {
    background: #e94560;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

#user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

#nama-user {
    background: rgba(255,255,255,0.1);
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    color: #e94560;
}

.btn-small {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.btn-small:hover {
    background: rgba(255,255,255,0.2);
}

.chat-box {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #1a1a2e;
}

/* Scrollbar styling */
.chat-box::-webkit-scrollbar {
    width: 6px;
}

.chat-box::-webkit-scrollbar-track {
    background: #16213e;
}

.chat-box::-webkit-scrollbar-thumb {
    background: #e94560;
    border-radius: 10px;
}

.chat-message {
    margin-bottom: 12px;
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-message.own {
    justify-content: flex-end;
}

.chat-message.other {
    justify-content: flex-start;
}

.chat-message.system {
    justify-content: center;
}

.chat-message .message-content {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 12px;
    word-wrap: break-word;
    position: relative;
}

.chat-message.own .message-content {
    background: #e94560;
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.other .message-content {
    background: #0f3460;
    color: white;
    border-bottom-left-radius: 4px;
}

.chat-message.system .message-content {
    background: #2d4059;
    color: #eee;
    font-size: 13px;
    padding: 6px 18px;
    border-radius: 20px;
    opacity: 0.8;
}

.message-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 4px;
    gap: 15px;
}

.message-sender {
    font-weight: bold;
    color: #e94560;
}

.chat-message.own .message-sender {
    color: #ffd700;
}

.message-time {
    opacity: 0.6;
    font-size: 10px;
}

.message-text {
    font-size: 14px;
    line-height: 1.4;
}

.chat-input {
    display: flex;
    padding: 15px;
    background: #0f3460;
    border-top: 2px solid #e94560;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    background: #1a1a2e;
    color: white;
}

.chat-input input:focus {
    outline: none;
    border: 2px solid #e94560;
}

.chat-input input::placeholder {
    color: #666;
}

.chat-input button {
    padding: 12px 25px;
    background: #e94560;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.chat-input button:hover:not(:disabled) {
    background: #c73652;
    transform: scale(1.05);
}

.chat-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.chat-controls {
    display: flex;
    gap: 10px;
    padding: 10px 15px;
    background: #0f3460;
    border-top: 1px solid #2d4059;
    align-items: center;
}

.chat-controls button {
    padding: 6px 15px;
    background: #2d4059;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.chat-controls button:hover {
    background: #e94560;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #16213e;
    padding: 40px;
    border-radius: 20px;
    width: 400px;
    max-width: 90%;
    text-align: center;
    border: 2px solid #e94560;
}

.modal-content h2 {
    color: white;
    margin-bottom: 10px;
}

.modal-content p {
    color: #aaa;
}

.modal-content input {
    width: 100%;
    padding: 14px;
    border: 2px solid #2d4059;
    border-radius: 25px;
    margin: 15px 0;
    font-size: 16px;
    background: #1a1a2e;
    color: white;
}

.modal-content input:focus {
    outline: none;
    border-color: #e94560;
}

.modal-content button {
    width: 100%;
    padding: 14px;
    background: #e94560;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.modal-content button:hover {
    background: #c73652;
    transform: scale(1.02);
}

#last-update {
    color: #666;
    font-size: 11px;
}