:root {
    --primary:        #FF9933;
    --primary-dark:   #e68a2e;
    --secondary:      #2D5A27;
    --accent:         #D4AF37;
    --text-main:      #333333;
    --text-muted:     #666666;
    --bg-light:       #FAF9F6;
    --white:          #ffffff;
    --glass:          rgba(255, 255, 255, 0.82);
    --glass-border:   rgba(255, 255, 255, 0.45);
    --shadow-soft:    0 8px 32px 0 rgba(31, 38, 135, 0.10);
    --shadow-premium: 0 12px 48px -8px rgba(0, 0, 0, 0.18);
    --bubble-radius:  20px;
    --transition:     all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-widget, .chat-widget * {
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

/* ── Background Aesthetic ─────────────────────────────────────────────────── */
.background-aesthetic {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

/* Ensure background circles are visible but non-intrusive */
.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.35;
    will-change: transform;
}

.circle-1 {
    width: 480px; height: 480px;
    background: var(--primary);
    top: -120px; right: -120px;
    animation: float1 14s ease-in-out infinite;
}

.circle-2 {
    width: 360px; height: 360px;
    background: var(--secondary);
    bottom: -80px; left: -80px;
    animation: float2 18s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0); }
    50%       { transform: translate(-30px, 20px); }
}
@keyframes float2 {
    0%, 100% { transform: translate(0, 0); }
    50%       { transform: translate(20px, -25px); }
}



.chat-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

/* ── Chat Toggle Button ──────────────────────────────────────────────────────── */
.chat-toggle {
    width: 66px; height: 66px;
    border-radius: 50%;
    background: var(--white);
    border: none;
    box-shadow: 0 8px 28px rgba(0,0,0,0.18);
    cursor: pointer;
    position: relative;
    padding: 0;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.chat-toggle:hover {
    transform: scale(1.06) translateY(-3px);
    box-shadow: 0 14px 36px rgba(0,0,0,0.22);
}

.toggle-avatar {
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--white);
}

.online-indicator {
    position: absolute;
    bottom: 5px; right: 5px;
    width: 13px; height: 13px;
    background: #4CAF50;
    border: 2.5px solid var(--white);
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.25);
    animation: pulse-green 2.5s ease-in-out infinite;
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 0 2px rgba(76,175,80,0.25); }
    50%       { box-shadow: 0 0 0 5px rgba(76,175,80,0.10); }
}

/* ── Chat Window ─────────────────────────────────────────────────────────────── */
.chat-window {
    position: absolute;
    bottom: 85px; right: 0;
    width: 400px;
    max-width: calc(100vw - 4rem);
    height: 680px;
    max-height: 85vh;
    background: var(--glass);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0s;
    transform-origin: bottom right;
    overflow: hidden;
    border-top: 1px solid rgba(255,255,255,0.7);
}

.chat-widget.closed .chat-window {
    visibility: hidden;
    opacity: 0;
    transform: scale(0.8) translateY(40px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}

.chat-widget.closed .chat-toggle {
    display: flex;
}

.chat-widget:not(.closed) .chat-toggle {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

/* ── Chat Header ─────────────────────────────────────────────────────────────── */
.chat-header {
    padding: 1.1rem 1.4rem;
    background: rgba(255,255,255,0.45);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.header-info { display: flex; align-items: center; gap: 0.75rem; }

.header-avatar-container { position: relative; width: 40px; height: 40px; }

.header-avatar {
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.active-dot {
    position: absolute;
    bottom: 0px; right: 0px;
    width: 10px; height: 10px;
    background: #4CAF50;
    border: 2px solid #fff;
    border-radius: 50%;
}

.header-text h2 { font-size: 0.98rem; font-weight: 600; color: var(--secondary); }
.header-text p  { font-size: 0.72rem; color: var(--text-muted); margin-top: 1px; }

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.close-btn:hover { background: rgba(0,0,0,0.06); color: var(--secondary); }

/* ── Messages Area ───────────────────────────────────────────────────────────── */
.chat-messages {
    flex: 1;
    padding: 1.25rem 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,153,51,0.4) transparent;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,153,51,0.4); border-radius: 10px; }

/* ── Message Bubbles ─────────────────────────────────────────────────────────── */
.message {
    max-width: 85%;
    display: flex;
    flex-direction: column;
    animation: msgIn 0.28s ease-out forwards;
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.message-content {
    padding: 0.85rem 1.1rem;
    border-radius: 20px;
    font-size: 0.92rem;
    line-height: 1.65;
    position: relative;
    overflow-wrap: break-word;
    word-break: break-word;
}

.message-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: var(--transition);
}
.message-content a:hover { color: var(--primary-dark); opacity: 0.85; }

.bot-message { align-self: flex-start; width: 100%; }
.bot-message .message-content {
    background: linear-gradient(145deg, #ffffff, #fafaf8);
    color: var(--text-main);
    border-bottom-left-radius: 5px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.04);
    border: 1px solid rgba(255,255,255,0.85);
    display: inline-block;
    width: auto;
    max-width: 100%;
}

.user-message { align-self: flex-end; }
.user-message .message-content {
    background: var(--secondary);
    color: var(--white);
    border-bottom-right-radius: 5px;
}

.timestamp {
    font-size: 0.62rem;
    margin-top: 5px;
    opacity: 0.55;
    align-self: flex-end;
    display: block;
}

/* ── Quick Replies ───────────────────────────────────────────────────────────── */
.quick-replies {
    padding: 0.65rem 1.1rem;
    background: rgba(255,255,255,0.25);
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: center;
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.quick-reply-btn {
    background: var(--white);
    border: 1.5px solid var(--primary);
    color: var(--primary);
    padding: 0.42rem 0.9rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

.quick-reply-btn:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(255,153,51,0.28);
}

/* ── Chat Input Area ─────────────────────────────────────────────────────────── */
.chat-input-area {
    padding: 1rem 1.25rem 1.1rem;
    background: rgba(255,255,255,0.32);
    border-top: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.65rem;
    background: var(--white);
    padding: 0.45rem 0.45rem 0.45rem 1rem;
    border-radius: 16px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.06);
    border: 1.5px solid transparent;
    transition: border-color 0.2s;
}

.input-wrapper:focus-within { border-color: rgba(255,153,51,0.35); }

.chat-widget textarea {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    resize: none;
    padding: 0.45rem 0;
    font-family: inherit;
    font-size: 0.92rem;
    max-height: 100px;
    color: var(--text-main);
    line-height: 1.5;
}

.send-btn {
    background: var(--primary);
    color: var(--white);
    border: none;
    width: 36px; height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,153,51,0.35);
}

.send-btn:disabled { opacity: 0.28; cursor: default; }

.branding-footer {
    text-align: center;
    font-size: 0.62rem;
    color: var(--text-muted);
    margin-top: 0.6rem;
    opacity: 0.75;
}

/* ── Option Buttons ──────────────────────────────────────────────────────────── */
.option-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.75rem;
}

.option-btn {
    background: var(--bg-light);
    border: 1.5px solid rgba(45,90,39,0.18);
    color: var(--secondary);
    padding: 0.45rem 0.85rem;
    border-radius: 11px;
    font-size: 0.82rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    line-height: 1.3;
}

.option-btn:hover {
    background: var(--secondary);
    color: var(--white);
    border-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(45,90,39,0.22);
}

.option-btn:active { transform: translateY(0); }

/* ── Event Carousel ──────────────────────────────────────────────────────────── */
.event-carousel {
    display: flex;
    overflow-x: auto;
    gap: 0.85rem;
    padding: 0.5rem 0.1rem 0.85rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin-top: 0.5rem;
}
.event-carousel::-webkit-scrollbar { display: none; }

.event-card {
    background: var(--white);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(0,0,0,0.07);
    border: 1px solid var(--glass-border);
    flex: 0 0 240px;
    scroll-snap-align: start;
    transition: var(--transition);
}

.event-card:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(0,0,0,0.12); }

.event-card-img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    background: linear-gradient(135deg, #f0ede4, #e2dfd6);
    display: block;
}

.event-card-content { padding: 0.95rem 1rem; }

.event-card-title {
    font-weight: 600;
    color: var(--secondary);
    font-size: 0.95rem;
    margin-bottom: 0.45rem;
    line-height: 1.3;
}

.event-card-description {
    font-size: 0.8rem;
    color: var(--text-main);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}

/* ── Timeline Carousel ───────────────────────────────────────────────────────── */
.timeline-carousel {
    display: flex;
    overflow-x: auto;
    gap: 0.85rem;
    padding: 0.85rem 0.1rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    margin-top: 0.5rem;
}
.timeline-carousel::-webkit-scrollbar { display: none; }

.timeline-item {
    flex: 0 0 148px;
    background: var(--white);
    padding: 1rem 0.9rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 3px 10px rgba(0,0,0,0.04);
    text-align: center;
    scroll-snap-align: start;
    transition: var(--transition);
}

.timeline-item:hover { transform: translateY(-5px); box-shadow: 0 8px 22px rgba(0,0,0,0.08); }

.timeline-time {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.78rem;
    display: block;
    margin-bottom: 0.45rem;
}

.timeline-label {
    font-weight: 600;
    color: var(--secondary);
    font-size: 0.82rem;
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.timeline-desc {
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.35;
}

/* ── Cow Gallery ─────────────────────────────────────────────────────────────── */
.cow-card {
    background: #fdfaf5;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 18px rgba(45,90,39,0.09);
    border: 1px solid rgba(45,90,39,0.1);
    flex: 0 0 230px;
    scroll-snap-align: start;
    transition: var(--transition);
}

.cow-card:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(45,90,39,0.14); }

.cow-card-img {
    width: 100%; height: 175px;
    object-fit: cover;
    display: block;
    background: linear-gradient(135deg, #e8f0e8, #d4e6d4);
}

.cow-card-content { padding: 1.05rem 1.05rem; }

.cow-card-name {
    font-weight: 700;
    color: var(--secondary);
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
}

.cow-card-bio {
    font-size: 0.78rem;
    color: var(--text-main);
    line-height: 1.5;
    font-style: italic;
    opacity: 0.85;
}

/* ── Message Image ───────────────────────────────────────────────────────────── */
.message-image {
    width: 100%;
    border-radius: 14px;
    margin-bottom: 0.5rem;
    display: block;
    object-fit: cover;
    max-height: 240px;
}



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

/* ── Mobile Responsiveness ───────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .chat-widget { bottom: 1rem; right: 1rem; }



    .event-card  { flex: 0 0 210px; }
    .cow-card    { flex: 0 0 200px; }
    .timeline-item { flex: 0 0 130px; }

    .option-btn { padding: 0.4rem 0.7rem; font-size: 0.78rem; }
    .quick-reply-btn { font-size: 0.74rem; padding: 0.38rem 0.8rem; }
}

@media (max-width: 360px) {
    .chat-window { height: 88vh; }
}
