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

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

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

/* Header */
header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    animation: fadeInDown 0.6s ease;
}

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

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
    animation: fadeInUp 0.6s ease;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
}

.card-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

/* Input Section */
.input-section {
    display: flex;
    flex-direction: column;
}

.toolbar {
    display: flex;
    gap: 8px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.tool-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #dee2e6;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

.tool-btn:active {
    transform: translateY(0);
}

.clear-btn:hover {
    background: #dc3545;
    border-color: #dc3545;
}

/* Emoji Picker */
.emoji-picker {
    padding: 15px 20px;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    max-height: 200px;
    overflow-y: auto;
}

.emoji-picker.hidden {
    display: none;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
}

.emoji {
    font-size: 24px;
    cursor: pointer;
    text-align: center;
    padding: 5px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.emoji:hover {
    background: #f8f9fa;
    transform: scale(1.2);
}

#messageInput {
    width: 100%;
    min-height: 250px;
    padding: 20px;
    border: none;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    outline: none;
}

#messageInput::placeholder {
    color: #adb5bd;
}

.char-count {
    padding: 10px 20px;
    background: #f8f9fa;
    color: #6c757d;
    font-size: 14px;
    text-align: right;
    border-top: 1px solid #e9ecef;
}

#charCount {
    font-weight: 600;
    color: #667eea;
}

/* Preview Section */
.preview-section {
    display: flex;
    flex-direction: column;
}

.whatsapp-container {
    flex: 1;
    background: #e5ddd5;
    padding: 20px;
    min-height: 350px;
}

.whatsapp-header {
    background: #075e54;
    color: white;
    padding: 15px;
    margin: -20px -20px 20px -20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

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

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

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

.whatsapp-chat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.message-bubble {
    background: #dcf8c6;
    padding: 12px 16px;
    border-radius: 8px;
    max-width: 80%;
    word-wrap: break-word;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.message-bubble::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 0;
    width: 0;
    height: 0;
    border-left: 8px solid #dcf8c6;
    border-top: 8px solid transparent;
}

.placeholder-text {
    color: #999;
    font-style: italic;
}

.message-time {
    font-size: 11px;
    color: #667781;
    margin-top: 4px;
    margin-right: 8px;
}

.copy-btn {
    margin: 20px;
    padding: 15px 30px;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

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

/* Templates Section */
.templates-section {
    grid-column: 1 / -1;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    padding: 20px;
}

.template-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.template-card:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.template-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.template-name {
    font-weight: 600;
    font-size: 14px;
}

/* Tips Section */
.tips-section {
    grid-column: 1 / -1;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
}

.tip-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.tip-code {
    font-family: 'Courier New', monospace;
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
}

.tip-result {
    font-weight: 500;
}

/* Footer */
footer {
    text-align: center;
    color: white;
    padding: 30px 20px;
    margin-top: 40px;
}

footer p {
    margin-bottom: 5px;
}

footer strong {
    color: #ffd700;
}

.footer-subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.footer-link {
    margin-top: 8px;
}

.footer-link a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid #ffd700;
    padding-bottom: 2px;
    transition: all 0.3s ease;
}

.footer-link a:hover {
    color: #ffd700;
    border-bottom-color: white;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .main-content {
        grid-template-columns: 1fr;
    }

    .templates-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .tips-grid {
        grid-template-columns: 1fr;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

