@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #25D366;
    /* WhatsApp Green */
    --primary-dark: #128C7E;
    /* WhatsApp Dark Green */
    --secondary: #075E54;
    /* WhatsApp Teal */
    --accent: #128C7E;
    --background: #f0f2f5;
    --card-bg: #ffffff;
    --text-main: #1c1e21;
    --text-muted: #65676b;
    --border: #dddfe2;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 900px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }
}

.main-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 25px;
}

.input-field {
    margin-bottom: 20px;
}

.input-field label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

.input-field input,
.input-field textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.input-field input:focus,
.input-field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.1);
}

.input-field textarea {
    resize: none;
    height: 100px;
}

.btn-generate {
    width: 100%;
    padding: 15px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-generate:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

/* Preview Section */
.preview-card {
    background: #e5ddd5;
    /* WhatsApp Chat Background */
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    min-height: 400px;
}

.preview-header {
    background: var(--secondary);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    background: #ccc;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
}

.contact-info .name {
    font-weight: 600;
    font-size: 0.95rem;
}

.contact-info .status {
    font-size: 0.75rem;
    opacity: 0.8;
}

.chat-area {
    flex: 1;
    padding: 20px;
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
    /* Official WhatsApp Tile */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.bubble {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    position: relative;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    align-self: flex-start;
    background: #ffffff;
    margin-bottom: 10px;
}

.bubble.sent {
    align-self: flex-end;
    background: #dcf8c6;
}

.bubble::after {
    content: '';
    position: absolute;
    top: 0;
}

.bubble.sent::after {
    right: -8px;
    border-left: 10px solid #dcf8c6;
    border-bottom: 15px solid transparent;
}

.bubble.received::after {
    left: -8px;
    border-right: 10px solid #ffffff;
    border-bottom: 15px solid transparent;
}

.bubble-time {
    display: block;
    font-size: 0.65rem;
    color: #999;
    text-align: right;
    margin-top: 4px;
}

/* Result Area */
.result-area {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--border);
    display: none;
}

.result-area.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.generated-link {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 10px;
    border: 1px dashed var(--primary);
    font-size: 0.85rem;
    word-break: break-all;
    margin-bottom: 15px;
    color: var(--secondary);
}

.action-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-secondary {
    padding: 12px;
    border-radius: 10px;
    background: #f0f2f5;
    color: var(--secondary);
    border: 1px solid var(--border);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #e4e6eb;
}

/* QR Code Modal-like style */
.qr-container {
    text-align: center;
    margin-top: 20px;
    display: none;
}

.qr-container.active {
    display: block;
}

#qrcode img {
    margin: 0 auto;
    border: 5px solid white;
    box-shadow: var(--shadow);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

footer {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 20px;
}

.social-links a {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.social-links a:hover {
    transform: scale(1.2);
    opacity: 0.8;
}

footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}