/* =========================================================
   RIVERSTONE CAMP
   CUSTOMER CHAT WIDGET
========================================================= */


/* =========================================================
   CHAT TOGGLE BUTTON
========================================================= */

.chat-toggle {

    position: fixed;

    right: 25px;
    bottom: 25px;

    width: 65px;
    height: 65px;

    border: none;

    border-radius: 50%;

    background: #1E5631;

    color: #ffffff;

    font-size: 24px;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow:
        0 15px 35px rgba(0, 0, 0, .25);

    z-index: 9999;

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        background .2s ease;

}


.chat-toggle:hover {

    transform: translateY(-3px);

    background: #174a2a;

    box-shadow:
        0 18px 40px rgba(0, 0, 0, .30);

}


.chat-toggle:active {

    transform: scale(.94);

}


/* =========================================================
   CHAT WINDOW
========================================================= */

.chat-box {

    position: fixed;

    right: 25px;
    bottom: 100px;

    width: 380px;
    height: 580px;

    max-width: calc(100vw - 30px);
    max-height: calc(100vh - 120px);

    background: #ffffff;

    border-radius: 22px;

    overflow: hidden;

    display: none;

    flex-direction: column;

    box-shadow:
        0 25px 60px rgba(0, 0, 0, .25);

    z-index: 9999;

}


/* =========================================================
   CHAT HEADER
========================================================= */

.chat-header {

    background: #1E5631;

    color: #ffffff;

    padding: 18px 20px;

    display: flex;

    justify-content: space-between;

    align-items: center;

    flex-shrink: 0;

}


.chat-header h3 {

    margin: 0;

    font-size: 20px;

    font-weight: 600;

}


.chat-header p {

    margin: 4px 0 0;

    font-size: 13px;

    opacity: .85;

}


.chat-header button {

    width: 36px;
    height: 36px;

    border: none;

    border-radius: 50%;

    background: rgba(255,255,255,.10);

    color: #ffffff;

    font-size: 20px;

    cursor: pointer;

    display: flex;

    align-items: center;
    justify-content: center;

    transition: background .2s ease;

}


.chat-header button:hover {

    background: rgba(255,255,255,.20);

}


/* =========================================================
   CHAT BODY
========================================================= */

.chat-body {

    flex: 1;

    padding: 20px;

    overflow-y: auto;

    background: #F8FAF7;

    scroll-behavior: smooth;

}


/* Scrollbar */

.chat-body::-webkit-scrollbar {

    width: 6px;

}


.chat-body::-webkit-scrollbar-track {

    background: transparent;

}


.chat-body::-webkit-scrollbar-thumb {

    background: rgba(30,86,49,.25);

    border-radius: 20px;

}


/* =========================================================
   BOT MESSAGE
========================================================= */

.bot-message {

    display: block;

    width: fit-content;

    max-width: 85%;

    margin-bottom: 15px;

    padding: 13px 16px;

    background: #EEF8F0;

    color: #17231b;

    border-radius: 16px;

    line-height: 1.6;

    font-size: 15px;

    word-wrap: break-word;

}


/* =========================================================
   CUSTOMER MESSAGE
========================================================= */

.user-message {

    width: fit-content;

    max-width: 82%;

    margin-left: auto;

    margin-bottom: 15px;

    padding: 12px 16px;

    background: #1E5631;

    color: #ffffff;

    border-radius: 16px;

    line-height: 1.5;

    font-size: 15px;

    word-wrap: break-word;

}


/* =========================================================
   ADMIN MESSAGE
========================================================= */

.admin-message {

    width: fit-content;

    max-width: 82%;

    margin: 12px 0;

    padding: 12px 16px;

    background: #1E5631;

    color: #ffffff;

    border-radius: 16px;

    line-height: 1.5;

    font-size: 15px;

    word-wrap: break-word;

}


/* =========================================================
   QUICK REPLY AREA
========================================================= */

.chat-quick-replies {

    display: flex;

    align-items: center;

    gap: 9px;

    padding: 11px 14px;

    background: #ffffff;

    border-top: 1px solid #edf0ed;

    overflow-x: auto;

    overflow-y: hidden;

    white-space: nowrap;

    flex-shrink: 0;

    scrollbar-width: none;

    -webkit-overflow-scrolling: touch;

}


.chat-quick-replies::-webkit-scrollbar {

    display: none;

}


/* =========================================================
   QUICK REPLY BUTTON
========================================================= */

.chat-quick-btn {

    flex: 0 0 auto;

    border: 1px solid transparent;

    background: #E8F5E9;

    color: #1E5631;

    padding: 9px 16px;

    border-radius: 999px;

    font-family: 'Poppins', sans-serif;

    font-size: 13px;

    font-weight: 500;

    line-height: 1.2;

    cursor: pointer;

    white-space: nowrap;

    transition:
        background .2s ease,
        color .2s ease,
        transform .15s ease,
        box-shadow .2s ease;

}


.chat-quick-btn:hover {

    background: #1E5631;

    color: #ffffff;

    transform: translateY(-1px);

    box-shadow:
        0 4px 12px rgba(30,86,49,.18);

}


.chat-quick-btn:active {

    transform: scale(.95);

}


/* Keyboard accessibility */

.chat-quick-btn:focus-visible {

    outline: 2px solid #F6C945;

    outline-offset: 2px;

}


/* =========================================================
   CHAT FOOTER
========================================================= */

.chat-footer {

    display: flex;

    align-items: stretch;

    border-top: 1px solid #eeeeee;

    background: #ffffff;

    flex-shrink: 0;

}


/* =========================================================
   MESSAGE INPUT
========================================================= */

.chat-footer input {

    flex: 1;

    min-width: 0;

    border: none;

    outline: none;

    padding: 15px 16px;

    background: #ffffff;

    color: #17231b;

    font-family: 'Poppins', sans-serif;

    font-size: 14px;

}


.chat-footer input::placeholder {

    color: #8a948d;

}


.chat-footer input:focus {

    background: #fbfdfb;

}


/* =========================================================
   SEND BUTTON
========================================================= */

.chat-footer button {

    width: 65px;

    min-width: 65px;

    border: none;

    background: #1E5631;

    color: #ffffff;

    cursor: pointer;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 18px;

    transition:
        background .2s ease;

}


.chat-footer button:hover {

    background: #174a2a;

}


.chat-footer button:active {

    transform: scale(.97);

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 768px) {

    .chat-toggle {

        right: 16px;

        bottom: 16px;

        width: 60px;

        height: 60px;

        font-size: 22px;

    }


    .chat-box {

        right: 15px;

        bottom: 85px;

        width: calc(100vw - 30px);

        height: min(620px, 78vh);

        max-width: none;

        max-height: calc(100vh - 105px);

        border-radius: 20px;

    }


    .chat-header {

        padding: 16px;

    }


    .chat-header h3 {

        font-size: 18px;

    }


    .chat-body {

        padding: 16px;

    }


    .bot-message,
    .user-message,
    .admin-message {

        max-width: 88%;

        font-size: 14px;

    }


    .chat-quick-replies {

        padding: 10px 12px;

        gap: 8px;

    }


    .chat-quick-btn {

        padding: 9px 14px;

        font-size: 12px;

    }


    .chat-footer input {

        font-size: 14px;

        padding: 14px;

    }


    .chat-footer button {

        width: 60px;

        min-width: 60px;

    }

}


/* =========================================================
   SMALL PHONES
========================================================= */

@media (max-width: 480px) {

    .chat-toggle {

        right: 14px;

        bottom: 14px;

        width: 58px;

        height: 58px;

    }


    .chat-box {

        left: 0;

        right: 0;

        bottom: 0;

        width: 100%;

        height: 78vh;

        max-width: none;

        max-height: none;

        border-radius: 22px 22px 0 0;

    }


    .chat-header {

        padding: 16px 18px;

    }


    .chat-body {

        padding: 15px;

    }


    .chat-quick-replies {

        padding: 9px 12px;

    }


    .chat-quick-btn {

        padding: 9px 14px;

    }


    .chat-footer input {

        padding: 15px;

    }

}


/* =========================================================
   VERY SMALL PHONES
========================================================= */

@media (max-width: 360px) {

    .chat-header h3 {

        font-size: 17px;

    }


    .chat-header p {

        font-size: 12px;

    }


    .chat-body {

        padding: 12px;

    }


    .chat-quick-btn {

        font-size: 11px;

        padding: 8px 12px;

    }

}

/* ==================================================
   CHAT ACTION BUTTON
================================================== */

.chat-action-wrapper {
    width: 100%;
    margin-top: 10px;
    margin-bottom: 10px;
}


.chat-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    width: 100%;

    padding: 13px 16px;

    border-radius: 12px;

    background: #1E5631;

    color: #ffffff;

    text-decoration: none;

    font-size: 14px;
    font-weight: 600;

    transition:
        transform .2s ease,
        background .2s ease,
        box-shadow .2s ease;
}


.chat-action-btn:hover {
    background: #174526;

    transform: translateY(-1px);

    box-shadow:
        0 6px 18px rgba(30, 86, 49, .22);

}


.chat-action-btn i {
    font-size: 15px;
}



/* ==================================================
   START OVER
================================================== */

.chat-start-over {

    width: 100%;

    margin-top: 8px;

    margin-bottom: 8px;

}


.chat-start-over button {

    width: 100%;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    padding: 11px 15px;

    border: 1px solid #dfe7df;

    border-radius: 12px;

    background: #ffffff;

    color: #1E5631;

    font-family: inherit;

    font-size: 13px;

    font-weight: 600;

    cursor: pointer;

    transition:
        background .2s ease,
        color .2s ease,
        border-color .2s ease;

}


.chat-start-over button:hover {

    background: #F3F8F3;

    border-color: #1E5631;

}


.chat-start-over button i {

    font-size: 13px;

}


.chat-input textarea{
    flex:1;
    height:50px;
    resize:none;
    border:none;
    background:#f4f4f4;
    border-radius:12px;
    padding:14px 18px;
    font-size:16px;
    line-height:1.4;
    outline:none;
    -webkit-text-size-adjust:100%;
}
/* =========================================================
   IOS / IPHONE CHAT INPUT
   Prevent Safari auto-zoom when typing
========================================================= */

#chatMessage {
    font-size: 16px !important;
    line-height: 1.4;
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
}


/* ==================================================
   LOCATION ACTIONS
================================================== */

.chat-location-actions {

    display: flex;

    flex-wrap: wrap;

    gap: 8px;

    margin-top: 10px;

    margin-bottom: 10px;

}


.chat-location-btn {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 7px;

    min-height: 40px;

    padding: 10px 14px;

    border-radius: 10px;

    border: 1px solid #dce9df;

    font-family: inherit;

    font-size: 13px;

    font-weight: 600;

    text-decoration: none;

    cursor: pointer;

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        background .2s ease;

}


.chat-location-btn:hover {

    transform: translateY(-1px);

    box-shadow:
        0 5px 15px
        rgba(20, 80, 45, .12);

}


.chat-location-map {

    background: #ffffff;

    color: #176b3a;

}


.chat-location-directions {

    background: #176b3a;

    color: #ffffff;

    border-color: #176b3a;

}


.chat-location-btn:disabled {

    opacity: .7;

    cursor: wait;

    transform: none;

}


@media (max-width: 480px) {

    .chat-location-actions {

        flex-direction: column;

    }


    .chat-location-btn {

        width: 100%;

    }

}