/* TropiPal Widget */

.tropipal-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    font-family: inherit;
}

.tropipal-launcher {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    border-radius: 999px;
    padding: 10px 18px 10px 10px;
    background: linear-gradient(135deg, #5d8f20, #18aeda);
    color: #ffffff;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

.tropipal-launcher:hover {
    transform: translateY(-2px);
}

.tropipal-launcher-glow {
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle, rgba(255,255,255,0.35), transparent 55%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.tropipal-launcher:hover .tropipal-launcher-glow {
    opacity: 1;
}

.tropipal-launcher-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    background: #ffffff;
    border-radius: 50%;
    padding: 3px;
    position: relative;
    z-index: 1;
}

.tropipal-launcher-text {
    position: relative;
    z-index: 1;
}

.tropipal-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: 390px;
    max-width: calc(100vw - 32px);
    height: 630px;
     
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.24);
    overflow: hidden;
    display: none;
    flex-direction: column;
    border: 1px solid rgba(93, 143, 32, 0.14);
}

.tropipal-widget.is-open .tropipal-panel {
    display: flex;
}

.tropipal-widget.is-open .tropipal-launcher {
    display: none;
}

.tropipal-header {
    padding: 16px;
    background: linear-gradient(135deg, #5d8f20, #18aeda);
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tropipal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tropipal-avatar {
    width: 52px;
    height: 52px;
    object-fit: contain;
    background: #ffffff;
    border-radius: 50%;
    padding: 4px;
}

.tropipal-brand h3 {
    margin: 0;
    font-size: 20px;
    line-height: 1.1;
    color: #ffffff;
}

.tropipal-brand p {
    margin: 3px 0 0;
    font-size: 13px;
    opacity: 0.9;
}

.tropipal-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    color: #ffffff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.tropipal-messages {
    flex: 1;
    padding: 18px;
    overflow-y: auto;
    background:
        radial-gradient(circle at top left, rgba(24,174,218,0.08), transparent 32%),
        radial-gradient(circle at bottom right, rgba(93,143,32,0.08), transparent 32%),
        #f8fbf7;
}

.tropipal-message {
    display: flex;
    margin-bottom: 12px;
}

.tropipal-message-user {
    justify-content: flex-end;
}

.tropipal-message-bot {
    justify-content: flex-start;
}

.tropipal-bubble {
    max-width: 82%;
    padding: 12px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.45;
}

.tropipal-message-bot .tropipal-bubble {
    background: #ffffff;
    color: #24301f;
    border-bottom-left-radius: 6px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.06);
}

.tropipal-message-user .tropipal-bubble {
    background: #18aeda;
    color: #ffffff;
    border-bottom-right-radius: 6px;
}

.tropipal-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.tropipal-prompts button {
    border: 1px solid rgba(24,174,218,0.25);
    background: #ffffff;
    color: #285313;
    border-radius: 999px;
    padding: 8px 11px;
    font-size: 13px;
    cursor: pointer;
}

.tropipal-prompts button:hover {
    background: rgba(24,174,218,0.08);
}

.tropipal-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #ffffff;
    border-top: 1px solid #e6eee3;
}

.tropipal-form input {
    flex: 1;
    border: 1px solid #dce8d7;
    border-radius: 999px;
    padding: 12px 14px;
    font-size: 14px;
    outline: none;
}

.tropipal-form input:focus {
    border-color: #18aeda;
    box-shadow: 0 0 0 3px rgba(24,174,218,0.14);
}

.tropipal-form button {
    border: 0;
    border-radius: 14px;
    width: 74px;
    height: 52px;
    padding: 0 !important;
    background: #5d8f20;
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.tropipal-footnote {
    padding: 0 14px 12px;
    background: #ffffff;
    color: #7b8577;
    font-size: 11px;
    text-align: center;
}

/* Typing dots */

.tropipal-typing .tropipal-bubble {
    display: flex;
    gap: 4px;
    align-items: center;
}

.tropipal-dot {
    width: 6px;
    height: 6px;
    background: #18aeda;
    border-radius: 50%;
    animation: tropipalBlink 1s infinite ease-in-out;
}

.tropipal-dot:nth-child(2) {
    animation-delay: 0.15s;
}

.tropipal-dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes tropipalBlink {
    0%, 80%, 100% {
        opacity: 0.25;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

@media (max-width: 600px) {
    .tropipal-widget {
        right: 14px;
        bottom: 14px;
    }

    .tropipal-panel {
        position: fixed;
        right: 10px;
        left: 10px;
        bottom: 10px;
        width: auto;
        height: 78vh;
        max-height: none;
        border-radius: 22px;
    }

    .tropipal-launcher-text {
        display: none;
    }

    .tropipal-launcher {
        padding: 9px;
    }

    .tropipal-launcher-logo {
        width: 48px;
        height: 48px;
    }
}

.tropipal-prompts button {
    color: #244018 !important;
    font-weight: 700;
    min-height: 34px;
}

.tropipal-brand p {
    color: rgba(255,255,255,0.85);
}
/* Cards */

.tropipal-card-bubble {
    width: 100%;
    max-width: 100%;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.tropipal-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 18px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
    transition: 0.2s ease;
}

.tropipal-card:hover {
    border-color: #2aa9d4;
    transform: translateY(-2px);
}

.tropipal-card-image {
    width: 100%;
    height: 150px;
    overflow: hidden;
    background: #eef5ef;
}

.tropipal-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.25s ease;
}

.tropipal-card:hover .tropipal-card-image img {
    transform: scale(1.05);
}

.tropipal-card-title {
    padding: 16px 16px 4px;
    font-size: 18px;
    line-height: 1.25;
    font-weight: 800;
    color: #223866;
}

.tropipal-card-town {
    padding: 0 16px 10px;
    font-size: 13px;
    font-weight: 700;
    color: #57921b;
}

.tropipal-card-town i {
    margin-right: 6px;
}

.tropipal-category-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 10px;
}

.tropipal-category-row:empty,
.tropipal-category:empty {
    display: none;
}

.tropipal-category {
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef6fb;
    color: #1d6f96;
    font-size: 11px;
    font-weight: 700;
}

.tropipal-card-text {
    padding: 0 16px 14px;
    font-size: 14px;
    line-height: 1.5;
    color: #555;
}

.tropipal-card-reason {
    margin: 0 16px 14px;
    padding: 9px 11px;
    border-radius: 12px;
    background: #f3f8fb;
    color: #425466;
    font-size: 13px;
    line-height: 1.4;
}

.tropipal-card-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    gap: 7px;
    margin: 0 16px 16px;
    padding: 11px 17px;
    border-radius: 999px;
    background: linear-gradient(135deg, #19aee0, #42c9b5);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    transition: 0.2s ease;
}

.tropipal-card-link:hover {
    color: #fff;
    transform: translateX(3px);
}

.tropipal-card-link i {
    margin-left: 2px;
}

.tropipal-thinking-text i {
    margin-right: 6px;
    color: #5d8f20;
}