﻿/* ============================================================
   Luxee WidgetKit — Kirim Undangan Widget
   Handle : lxwdk-kirim-undangan
   Version: 1.0.0
   ============================================================ */

/* ── Spinner animation ─────────────────────────────────────── */
@keyframes lxkuSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Box wrapper ───────────────────────────────────────────── */
.lxwdk-ku-box {
    font-family: 'Poppins', Arial, sans-serif;
    max-width: 100%;
    box-sizing: border-box;
    background-color: #ffffff;
    padding: 28px 26px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* -- Info Bar (chip-style, dark gradient) -- */
.lxwdk-ku-info-bar {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d6a9f 100%);
    border-radius: 10px;
    padding: 13px 18px;
    margin-bottom: 10px;
    overflow: hidden;
}



.lxwdk-ku-info-chip {

    display: flex;

    align-items: center;

    gap: 10px;

    flex: 1;

    min-width: 0;

}



.lxwdk-ku-chip-icon {

    width: 18px;

    height: 18px;

    flex-shrink: 0;

    color: rgba(255, 255, 255, 0.6);

}



.lxwdk-ku-chip-body {

    display: flex;

    flex-direction: column;

    min-width: 0;

}



.lxwdk-ku-chip-label {

    font-size: 9px;

    font-weight: 700;

    letter-spacing: 0.8px;

    text-transform: uppercase;

    color: rgba(255, 255, 255, 0.5);

    line-height: 1.2;

    margin-bottom: 2px;

}



.lxwdk-ku-chip-value {

    font-size: 12px;

    font-weight: 500;

    color: #ffffff;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

    line-height: 1.3;

}



.lxwdk-ku-info-divider {

    width: 1px;

    height: 32px;

    background: rgba(255, 255, 255, 0.2);

    flex-shrink: 0;

    margin: 0 16px;

}


/* ── Labels ────────────────────────────────────────────────── */
.lxwdk-ku-box label,
.lxwdk-ku-gsheet-url-label,
.lxwdk-ku-preview-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    margin-top: 8px;
    font-size: 14px;
    color: #2d3748;
    letter-spacing: 0.01em;
}

/* ── Textarea, Select & All Inputs ───────────────────────── */
.lxwdk-ku-textarea,
.lxwdk-ku-select,
.lxwdk-ku-gsheet-url-input,
.lxwdk-ku-preview-area {
    width: 100%;
    padding: 13px 15px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 6px;
    box-sizing: border-box;
    resize: vertical;
    background-color: #f8fafd;
    color: #1a202c;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.lxwdk-ku-select {
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
    cursor: pointer;
}

.lxwdk-ku-textarea {
    resize: none;
    min-height: 110px;
}

.lxwdk-ku-textarea:focus,
.lxwdk-ku-select:focus,
.lxwdk-ku-gsheet-url-input:focus,
.lxwdk-ku-preview-area:focus {
    outline: none;
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
    background: #ffffff;
}

.lxwdk-ku-textarea::placeholder,
.lxwdk-ku-gsheet-url-input::placeholder,
.lxwdk-ku-preview-area::placeholder {
    color: inherit;
    opacity: 0.5;
    font-size: inherit;
    font-family: inherit;
}

/* ── Error message ─────────────────────────────────────────── */
.lxwdk-ku-error {
    color: #ef4444;
    font-size: 13px;
    margin-bottom: 4px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.07);
    border-radius: 8px;
    border-left: 3px solid #ef4444;
}

/* ── Generate Button ───────────────────────────────────────── */
.lxwdk-ku-generate-btn {
    background-color: #4caf50;
    color: #ffffff;
    padding: 15px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-family: inherit;
    margin-top: 10px;
    margin-bottom: 0;
    user-select: none;
    letter-spacing: 0.02em;
}

.lxwdk-ku-generate-btn:hover {
    background-color: #45a049;
    transform: translateY(-1px);
}

.lxwdk-ku-generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ── Results Table ─────────────────────────────────────────── */
.lxwdk-ku-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    table-layout: auto;
}

.lxwdk-ku-table th {
    background-color: #f1f5f9;
    padding: 13px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    border-bottom: 1.5px solid #e5e7eb;
    white-space: nowrap;
}

.lxwdk-ku-table th:last-child {
    text-align: center;
}

.lxwdk-ku-table td {
    padding: 13px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #374151;
    vertical-align: middle;
}

.lxwdk-ku-table tbody tr:nth-child(odd) td {
    background-color: #ffffff;
}

.lxwdk-ku-table tbody tr:nth-child(even) td {
    background-color: #fafafa;
}

.lxwdk-ku-table tbody tr:hover td {
    background-color: rgba(76, 175, 80, 0.05);
}

/* ── Action Buttons ────────────────────────────────────────── */
.lxwdk-ku-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}

.lxwdk-ku-action-btn {
    padding: 7px;
    border-radius: 6px;
    background-color: #f5f5f5;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease, background-color 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    line-height: 1;
    color: #333333;
    width: 30px;
    height: 30px;
    box-sizing: border-box;
}

.lxwdk-ku-action-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.lxwdk-ku-action-btn:hover {
    transform: scale(1.15);
    opacity: 0.85;
}

/* Icon colors */
.lxwdk-ku-icon-link {
    color: #007bff;
}

.lxwdk-ku-icon-copy {
    color: #ff9800;
}

.lxwdk-ku-icon-wa {
    color: #25d366;
}

.lxwdk-ku-icon-fb {
    color: #1877f2;
}

.lxwdk-ku-icon-del {
    color: #f44336;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 540px) {

    .lxwdk-ku-table th:first-child,
    .lxwdk-ku-table td:first-child {
        width: 45%;
    }

    .lxwdk-ku-table th:last-child,
    .lxwdk-ku-table td:last-child {
        width: 55%;
    }

    .lxwdk-ku-action-btn {
        padding: 6px;
    }

    .lxwdk-ku-generate-btn {
        font-size: 14px;
        padding: 12px 16px;
    }
}

/* ── Google Sheets Badge ───────────────────────────────────── */
.lxwdk-ku-gsheet-badge {
    display: flex;
    align-items: center;
    gap: 7px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #0369a1;
}

.lxwdk-ku-gsheet-badge svg {
    flex-shrink: 0;
    color: #0284c7;
}

.lxwdk-ku-gsheet-status {
    margin-left: auto;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.lxwdk-ku-gsheet-status.lxwdk-ku-gsheet-ok {
    color: #166534;
    background: #dcfce7;
}

.lxwdk-ku-gsheet-status.lxwdk-ku-gsheet-warn {
    color: #991b1b;
    background: #fee2e2;
}

/* WA direct number indicator */
.lxwdk-ku-action-btn.lxwdk-ku-wa-direct {
    position: relative;
}

.lxwdk-ku-action-btn.lxwdk-ku-wa-direct::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 5px;
    height: 5px;
    background: #25d366;
    border-radius: 50%;
    border: 1px solid #fff;
}

/* ── GSheet / Link Frontend URL Input (overrides) ──────────── */
.lxwdk-ku-gsheet-url-input {
    display: block;
}

/* ── Template Preview Textarea (overrides) ─────────────────── */
.lxwdk-ku-preview-area {
    display: block;
    min-height: 160px;
    line-height: 1.65;
    cursor: text;
}

/* ── Mobile: Info Bar 2-baris ───────────────────────────────── */
@media (max-width: 540px) {

    .lxwdk-ku-box {
        padding: 20px 16px;
    }

    .lxwdk-ku-info-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px 16px;
    }

    .lxwdk-ku-info-chip {
        width: 100%;
    }

    /* First chip: beri garis bawah tipis sebagai pemisah */
    .lxwdk-ku-info-chip:first-child {
        padding-bottom: 10px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    /* Chip value tampil penuh, tidak terpotong */
    .lxwdk-ku-chip-value {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        word-break: break-all;
    }

    /* Sembunyikan divider vertikal — digantikan border-bottom di atas */
    .lxwdk-ku-info-divider {
        display: none;
    }
}