* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f2f5;
}

.chat-container {
    width: min(300px, 72vw);
    height: 80vh;
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: #f0f2f5;
    border: 10px solid #000;
    border-radius: 40px;
    overflow: hidden;
    margin: 20px auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

/* Add notch */
.chat-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 22px;
    background-color: #000;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
    z-index: 1000;
}

.chat-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    background-color: #fff;
    overflow: hidden;
}

.chat-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 35px;
    background-color: #000;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
    z-index: 1000;
}

.chat-header {
    padding: 35px 20px 10px;
    background-color: #075e54;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px 10px 0 0;
}

.contact-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-pic {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #075e54;
    color: #ffffff;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.5px;
    border: 2px solid #ffffff;
}

.contact-details h3 {
    font-size: 16px;
    margin-bottom: 2px;
}

.status {
    font-size: 12px;
    opacity: 0.8;
}

.chat-actions {
    display: flex;
    gap: 20px;
}

.chat-actions i {
    cursor: pointer;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #e5ddd5;
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23999' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
    display: flex;
    flex-direction: column;
}

.message {
    max-width: 85%;
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    position: relative;
}

.message.sent {
    background-color: #e7ffdb;
    align-self: flex-end;
    border-top-right-radius: 2px;
}

.message.received {
    background-color: white;
    align-self: flex-start;
    border-top-left-radius: 2px;
}

.message .time {
    font-size: 10px;
    color: #999;
    align-self: flex-end;
    margin-top: 2px;
    margin-left: 8px;
    white-space: nowrap;
}

.message-content {
    display: flex;
    align-items: flex-end;
    gap: 4px;
}

.message-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
}

.whatsapp-button {
    background-color: #fff;
    color: #0a7cff;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: background-color 0.2s;
    width: 100%;
}

.whatsapp-button:hover {
    background-color: #f5f5f5;
}

.whatsapp-button:active {
    background-color: #e5e5e5;
}

.message.received .message-buttons {
    margin-top: 12px;
}

.chat-input {
    padding: 10px 20px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 0 0 30px 30px;
}

.chat-input i {
    color: #666;
    cursor: pointer;
    font-size: 20px;
}

.chat-input input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 20px;
    outline: none;
    font-size: 13px;
    min-width: 0;
}

#send-button {
    background: none;
    border: none;
    color: #075e54;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

#send-button i {
    font-size: 20px;
    color: #075e54;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 20px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #93989b;
    border-radius: 50%;
    animation: typing 1s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: 200ms; }
.typing-indicator span:nth-child(2) { animation-delay: 300ms; }
.typing-indicator span:nth-child(3) { animation-delay: 400ms; }

@keyframes typing {
    0% { transform: translateY(0px); }
    28% { transform: translateY(-6px); }
    44% { transform: translateY(0px); }
}

/* Custom scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

/* Responsive design */
@media (max-width: 768px) {
    .chat-container {
        width: min(280px, 75vw);
        height: 85vh;
        border-width: 8px;
        border-radius: 30px;
        margin: 30px auto;
    }

    .chat-container::before {
        width: 70px;
        height: 18px;
        border-bottom-left-radius: 12px;
        border-bottom-right-radius: 12px;
    }

    .chat-content::before {
        width: 70px;
        height: 18px;
    }

    .chat-header {
        padding-top: 25px;
    }

    .message {
        max-width: 80%;
    }
}

@media (max-height: 700px) {
    .chat-container {
        height: 90vh;
        border-width: 8px;
        margin: 20px auto;
    }
}

.bottom-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px 12px 0 0;
    padding: 16px;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    z-index: 1000;
    max-height: 70%;
    overflow-y: auto;
    margin-bottom: 0;
}

.bottom-sheet.active {
    transform: translateY(0);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.chat-container {
    position: relative;
    overflow: hidden;
}

.bottom-sheet-header {
    position: sticky;
    top: 0;
    background: white;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
    z-index: 1001;
}

.bottom-sheet-options {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 60px;
}

.bottom-sheet-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.bottom-sheet-option:hover {
    background-color: #f5f5f5;
}

.bottom-sheet-option.selected {
    background-color: #e8f5fe;
}

.bottom-sheet-option .radio {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottom-sheet-option.selected .radio {
    border-color: #0a7cff;
}

.bottom-sheet-option.selected .radio::after {
    content: '';
    width: 10px;
    height: 10px;
    background: #0a7cff;
    border-radius: 50%;
}

.bottom-sheet-send {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    background: #00a884;
    color: white;
    border: none;
    border-radius: 24px;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    z-index: 1001;
}

.bottom-sheet-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ussd-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
}

.ussd-modal {
    background: #000;
    color: #fff;
    width: 85%;
    max-width: 280px;
    padding: 20px;
    border: 1px solid #333;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.ussd-header {
    text-align: center;
    margin-bottom: 15px;
    font-size: 14px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.ussd-content {
    margin-bottom: 20px;
}

.ussd-amount {
    text-align: center;
    font-size: 18px;
    margin: 10px 0;
}

.ussd-pin-input {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.ussd-pin-field {
    width: 120px;
    background: transparent;
    border: none;
    border-bottom: 2px solid #fff;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 24px;
    text-align: center;
    letter-spacing: 8px;
    outline: none;
    caret-color: #fff;
}

.ussd-pin-field::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.ussd-pin-digit {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid #fff;
    background: transparent;
}

.ussd-pin-digit.filled {
    background: #fff;
}

.ussd-timer {
    text-align: center;
    color: #888;
    font-size: 12px;
    margin-top: 15px;
}

.ussd-status {
    text-align: center;
    margin-top: 10px;
    display: none;
}

.ussd-status.success {
    color: #4CAF50;
}

.ussd-status.error {
    color: #f44336;
}

.ussd-overlay.active {
    display: flex;
}

.simulate-button {
    background: #00a884;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 14px;
    cursor: pointer;
    margin-left: auto;
    transition: background-color 0.2s;
}

.simulate-button:hover {
    background: #008f6f;
}
