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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.main-content {
    display: grid;
    grid-template-columns: 70% 30%;
    gap: 30px;
    margin-bottom: 40px;
}

.editor-section,
.output-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.editor-section:hover,
.output-section:hover {
    transform: translateY(-5px);
}

.preview-section {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    transition: none;
}


.editor-section h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.help-text {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.help-text p {
    margin: 0;
    color: #666;
}

.input-textarea,
.output-textarea {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.input-textarea:focus,
.output-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Phone Mockup Styles */
.phone-mockup {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.phone-frame {
    width: 280px;
    height: 500px;
    background: #2a2a2a;
    border-radius: 25px;
    padding: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    position: relative;
}

.phone-frame::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: #555;
    border-radius: 2px;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* WhatsApp Header */
.whatsapp-header {
    background: #075e54;
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

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

.contact-avatar {
    width: 35px;
    height: 35px;
    background: #128c7e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.contact-details {
    display: flex;
    flex-direction: column;
}

.contact-name {
    font-size: 16px;
    font-weight: 500;
}

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

.header-actions {
    display: flex;
    gap: 15px;
}

.action-btn {
    font-size: 18px;
    cursor: pointer;
    opacity: 0.9;
}

/* WhatsApp Chat Area */
.whatsapp-chat {
    flex: 1;
    background: #e5ddd5;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><defs><pattern id="a" patternUnits="userSpaceOnUse" width="20" height="20"><circle cx="10" cy="10" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23a)"/></svg>');
    padding: 8px;
    overflow-y: auto;
    position: relative;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 100%;
}

.message-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

.message-bubble {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
    align-self: flex-end;
    background: #dcf8c6;
    margin-left: auto;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message-bubble::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid #dcf8c6;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.message-bubble strong {
    font-weight: bold;
}

.message-bubble em {
    font-style: italic;
}

.message-bubble del {
    text-decoration: line-through;
}

.message-bubble code {
    background: rgba(0,0,0,0.1);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.message-bubble pre {
    background: rgba(0,0,0,0.1);
    padding: 8px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    overflow-x: auto;
    margin: 4px 0;
}

.message-bubble blockquote {
    border-left: 3px solid #128c7e;
    padding-left: 8px;
    margin: 4px 0;
    font-style: italic;
    opacity: 0.8;
}

.message-bubble ul,
.message-bubble ol {
    padding-left: 16px;
    margin: 4px 0;
}

.message-bubble li {
    margin: 2px 0;
}

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

/* WhatsApp Input */
.whatsapp-input {
    background: #f0f0f0;
    padding: 8px;
    border-top: 1px solid #d1d1d1;
}

.input-bar {
    background: white;
    border-radius: 20px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.input-emoji,
.input-mic {
    font-size: 18px;
    color: #999;
    cursor: pointer;
}

.input-text-area {
    flex: 1;
    color: #999;
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .phone-frame {
        width: 250px;
        height: 450px;
    }
    
    .phone-mockup {
        padding: 10px;
    }
}

.editor-controls {
    margin-top: 15px;
    text-align: center;
}

.copy-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.copy-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.copy-button:active {
    transform: translateY(0);
}

.copy-button.copied {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    margin-top: 30px;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .editor-section,
    .preview-section,
    .output-section {
        padding: 20px;
    }
    
    .container {
        padding: 15px;
    }
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 25px;
    border-radius: 25px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(0);
}

.toast.hide {
    transform: translateX(100%);
}