/* ================================================================
   Pure Grenada AI Travel Concierge — Frontend Styles
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');

/* ── Variables ── */
:root {
    --pgc-primary: #0b4f5a;
    --pgc-primary-dark: #0a616a;
    --pgc-primary-light: #198494;
    --pgc-gold: #fcd116;
    --pgc-gold-dark: #daa520;
    --pgc-red: #ce1126;
    --pgc-green-flag: #007a3d;
    --pgc-text: #2a3d2e;
    --pgc-text-light: #9aaba0;
    --pgc-bg: #f2f8f5;
    --pgc-white: #ffffff;
    --pgc-shadow: rgba(20, 88, 63, 0.12);
    --pgc-radius: 18px;
    --pgc-font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --pgc-font-display: 'Playfair Display', Georgia, serif;
}

/* ── Animations ── */
@keyframes pgcFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pgcBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
    30% { transform: translateY(-8px); opacity: 1; }
}

@keyframes pgcSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pgcPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(26, 107, 82, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(26, 107, 82, 0); }
}

/* ── Container ── */
.pgc-chatbot-container {
    display: flex;
    flex-direction: column;
    font-family: var(--pgc-font);
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 40px var(--pgc-shadow), 0 0 0 1px rgba(45, 138, 110, 0.06);
    position: relative;
}

.pgc-chatbot-container * {
    box-sizing: border-box;
}

/* Embedded mode */
.pgc-embedded {
    width: 100%;
    max-width: 100%;
}

/* Floating mode */
.pgc-floating {
    position: fixed;
    z-index: 999998;
    width: 400px;
    height: 620px;
    max-height: calc(100vh - 120px);
    bottom: 90px;
    animation: pgcSlideUp 0.3s ease;
}

.pgc-floating.pgc-pos-bottom-right { right: 20px; }
.pgc-floating.pgc-pos-bottom-left { left: 20px; }

.pgc-floating.pgc-hidden {
    display: none !important;
}

/* ── Floating Trigger ── */
.pgc-floating-trigger {
    position: fixed;
    z-index: 999999;
    bottom: 20px;
    cursor: pointer;
}

.pgc-floating-trigger.pgc-pos-bottom-right { right: 20px; }
.pgc-floating-trigger.pgc-pos-bottom-left { left: 20px; }

.pgc-trigger-btn {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pgc-primary-dark), var(--pgc-primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 4px 20px var(--pgc-shadow);
    transition: all 0.3s ease;
    animation: pgcPulse 3s ease-in-out infinite;
    position: relative;
}

.pgc-trigger-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(20, 88, 63, 0.25);
}

.pgc-trigger-icon-close {
    display: none;
    color: white;
    font-size: 20px;
    font-style: normal;
}

.pgc-floating-trigger.pgc-open .pgc-trigger-icon-open { display: none; }
.pgc-floating-trigger.pgc-open .pgc-trigger-icon-close { display: block; }
.pgc-floating-trigger.pgc-open .pgc-trigger-btn { animation: none; }

.pgc-trigger-label {
    position: absolute;
    bottom: 68px;
    white-space: nowrap;
    background: var(--pgc-white);
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 13px;
    color: var(--pgc-text);
    font-family: var(--pgc-font);
    font-weight: 500;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.pgc-pos-bottom-right .pgc-trigger-label { right: 0; }
.pgc-pos-bottom-left .pgc-trigger-label { left: 0; }

.pgc-floating-trigger.pgc-open .pgc-trigger-label { opacity: 0; pointer-events: none; }

/* ── Header ── */
.pgc-header {
    background: linear-gradient(135deg, var(--pgc-primary-dark) 0%, var(--pgc-primary) 35%, var(--pgc-primary-light) 70%, #0a616a 100%);
    position: relative;
    flex-shrink: 0;
}

.pgc-flag-bar {
    height: 3px;
    background: linear-gradient(90deg, var(--pgc-red) 0%, var(--pgc-red) 33%, var(--pgc-gold) 33%, var(--pgc-gold) 66%, var(--pgc-green-flag) 66%, var(--pgc-green-flag) 100%);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1;
}

.pgc-header-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px 17px;
}

.pgc-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pgc-gold), var(--pgc-gold-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}

.pgc-header-text {
    flex: 1;
    min-width: 0;
}

.pgc-header-title {
    font-family: var(--pgc-font-display);
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.pgc-header-subtitle {
    font-size: 10px;
    color: rgba(255,255,255,0.72);
    font-weight: 400;
    margin-top: 2px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.pgc-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pgc-download-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(252, 209, 22, 0.2);
    border: 1px solid rgba(252, 209, 22, 0.4);
    border-radius: 18px;
    padding: 5px 12px;
    font-size: 11px;
    color: var(--pgc-gold);
    cursor: pointer;
    font-family: var(--pgc-font);
    font-weight: 500;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.pgc-download-btn:hover {
    background: rgba(252, 209, 22, 0.35);
}

.pgc-status {
    display: flex;
    gap: 4px;
    align-items: center;
    background: rgba(255,255,255,0.12);
    padding: 5px 11px;
    border-radius: 18px;
    font-size: 11px;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
}

.pgc-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
    display: inline-block;
}

/* ── Messages ── */
.pgc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #fff;
    overscroll-behavior: contain;
}

.pgc-messages::-webkit-scrollbar { width: 5px; }
.pgc-messages::-webkit-scrollbar-track { background: transparent; }
.pgc-messages::-webkit-scrollbar-thumb { background: rgba(45,138,110,0.12); border-radius: 10px; }

.pgc-msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    animation: pgcFadeIn 0.35s ease;
}

.pgc-msg-user { justify-content: flex-end; }
.pgc-msg-bot { justify-content: flex-start; }

.pgc-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pgc-primary-light), var(--pgc-primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 2px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.pgc-msg-bubble {
    max-width: 80%;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.7;
    word-break: break-word;
    letter-spacing: 0.1px;
}

.pgc-msg-user .pgc-msg-bubble {
    background: linear-gradient(135deg, var(--pgc-primary-dark), #0a616a);
    color: #fff;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 2px 14px rgba(20, 88, 63, 0.2);
}

.pgc-msg-bot .pgc-msg-bubble {
    background: var(--pgc-white);
    color: var(--pgc-text);
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05), 0 0 0 0.5px rgba(45,138,110,0.06);
}

.pgc-msg-bubble strong { color: #0b4f5a; }

.pgc-msg-bubble h1, .pgc-msg-bubble h2, .pgc-msg-bubble h3 {
    font-family: var(--pgc-font-display);
    color: #0b4f5a;
    margin: 14px 0 6px;
    line-height: 1.3;
}
.pgc-msg-bubble h1 { font-size: 18px; }
.pgc-msg-bubble h2 { font-size: 16px; }
.pgc-msg-bubble h3 { font-size: 14px; }

/* Typing indicator */
.pgc-typing {
    display: flex;
    gap: 6px;
    padding: 8px 0;
    align-items: center;
}

.pgc-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pgc-primary-light);
}

.pgc-typing-dot:nth-child(1) { animation: pgcBounce 1.4s ease-in-out 0s infinite; }
.pgc-typing-dot:nth-child(2) { animation: pgcBounce 1.4s ease-in-out 0.2s infinite; }
.pgc-typing-dot:nth-child(3) { animation: pgcBounce 1.4s ease-in-out 0.4s infinite; }

/* ── Suggestions ── */
.pgc-suggestions {
    padding: 0 14px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    animation: pgcFadeIn 0.5s ease 0.2s both;
}

.pgc-chip {
    background: rgba(45, 138, 110, 0.06);
    border: 1.5px solid rgba(45, 138, 110, 0.2);
    border-radius: 14px;
    padding: 9px 14px;
    font-size: 12px;
    color: #0b4f5a;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: var(--pgc-font);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1.3;
}

.pgc-chip:hover {
    background: rgba(45, 138, 110, 0.12);
    border-color: var(--pgc-primary-light);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(45,138,110,0.12);
}

.pgc-chip-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.pgc-suggestions.pgc-hidden { display: none; }

/* ── Download Banner ── */
.pgc-download-banner {
    margin: 0 14px 6px;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(45,138,110,0.08), rgba(252,209,22,0.08));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(45,138,110,0.12);
    animation: pgcFadeIn 0.4s ease;
    font-size: 13px;
    color: #0b4f5a;
    font-weight: 500;
}

.pgc-download-banner.pgc-hidden { display: none; }

.pgc-download-banner-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--pgc-primary-dark), var(--pgc-primary-light));
    border: none;
    border-radius: 20px;
    padding: 7px 16px;
    font-size: 12px;
    color: #fff;
    cursor: pointer;
    font-family: var(--pgc-font);
    font-weight: 500;
    box-shadow: 0 2px 8px var(--pgc-shadow);
    transition: all 0.2s ease;
}

.pgc-download-banner-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(20,88,63,0.3);
}

/* ── Input Area ── */
.pgc-input-area {
    padding: 10px 14px 12px;
    border-top: 1px solid rgba(45, 138, 110, 0.06);
    background: #fff;
    flex-shrink: 0;
}

.pgc-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--pgc-white);
    border-radius: 22px;
    padding: 5px 5px 5px 16px;
    box-shadow: 0 2px 14px rgba(0,0,0,0.05), 0 0 0 1px rgba(45,138,110,0.08);
    transition: box-shadow 0.25s ease;
}

.pgc-input-wrap:focus-within {
    box-shadow: 0 2px 14px rgba(0,0,0,0.08), 0 0 0 2px rgba(45,138,110,0.15);
}

.pgc-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    font-family: var(--pgc-font);
    color: var(--pgc-text);
    resize: none;
    line-height: 1.5;
    padding: 8px 0;
    background: transparent;
    max-height: 120px;
    min-height: 22px;
}

.pgc-input::placeholder { color: var(--pgc-text-light); }

.pgc-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: #e2e8e4;
    color: #fff;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.pgc-send-btn.pgc-active {
    background: linear-gradient(135deg, var(--pgc-primary-dark), var(--pgc-primary-light));
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(20, 88, 63, 0.25);
}

.pgc-send-btn.pgc-active:hover {
    transform: scale(1.05);
}

/* ── Footer ── */
.pgc-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 10px;
    color: #a8b5ab;
    letter-spacing: 0.5px;
}

.pgc-sep { color: #c8d0ca; }

.pgc-footer a {
    color: var(--pgc-primary-light);
    text-decoration: none;
}

.pgc-footer a:hover { text-decoration: underline; }

/* ── Utility ── */
.pgc-hidden { display: none !important; }

/* ── Responsive ── */
@media (max-width: 480px) {
    .pgc-floating {
        width: calc(100vw - 16px);
        height: calc(100vh - 100px);
        max-height: calc(100vh - 100px);
        bottom: 80px;
        right: 8px !important;
        left: 8px !important;
        border-radius: 14px;
    }

    .pgc-trigger-label { display: none; }

    .pgc-chip {
        font-size: 11px;
        padding: 7px 11px;
    }
}

@media (max-width: 360px) {
    .pgc-header-inner { padding: 10px 12px 13px; gap: 8px; }
    .pgc-avatar { width: 36px; height: 36px; font-size: 18px; }
    .pgc-header-title { font-size: 16px; }
    .pgc-messages { padding: 12px 10px; }
}


