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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-container {
    width: 100%;
    max-width: 500px;
    height: 100%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    padding: 20px;
    background: #3b82f6;
    color: white;
    text-align: center;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
}

.header .version-info {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

.phone-input-section {
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
}

#phone-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s ease;
}

#phone-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#add-phone-btn {
    padding: 12px 20px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#add-phone-btn:hover {
    background: #2563eb;
}

.tabs-section {
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    padding: 0 20px;
}

.tabs-container {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 8px 0;
}

.chat-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 120px;
    justify-content: space-between;
}

.chat-tab:hover {
    background: #cbd5e1;
}

.chat-tab.active {
    background: #3b82f6;
    color: white;
}

.chat-tab-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-tab-close {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.chat-tab-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-tab:not(.active) .chat-tab-close {
    background: rgba(0, 0, 0, 0.1);
    color: #64748b;
}

.chat-tab:not(.active) .chat-tab-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

.tabs-container::-webkit-scrollbar {
    height: 4px;
}

.tabs-container::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.tabs-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.tabs-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.messages-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.welcome-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #64748b;
}

.welcome-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.welcome-text p {
    font-size: 16px;
}

.message {
    display: flex;
    margin-bottom: 12px;
}

.message.sent {
    justify-content: flex-end;
}

.message.received {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
}

.message.sent .message-bubble {
    background: #3b82f6;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received .message-bubble {
    background: #f1f5f9;
    color: #1e293b;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
    text-align: right;
}

.message.received .message-time {
    text-align: left;
}

.message-input-section {
    border-top: 1px solid #e2e8f0;
    background: white;
    padding: 16px 20px;
}

.current-contact {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 12px;
    font-weight: 500;
}

.input-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

#message-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 24px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s ease;
}

#message-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#send-button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #3b82f6;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#send-button:hover {
    background: #2563eb;
    transform: scale(1.05);
}

#send-button:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

/* Scrollbar Styling */
.messages-area::-webkit-scrollbar {
    width: 6px;
}

.messages-area::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.messages-area::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.messages-area::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}


