/* Florian AI - World Class Nature UI */

:root {
    /* Palette */
    --primary-green: #5D9C59;
    /* Soft Natural Green */
    --primary-green-light: #EDF7ED;
    /* Very light green for AI bubbles */
    --secondary-earth: #8B5E3C;
    --leaf-olive: #556B2F;
    --accent-sky: #87CEEB;
    --accent-sun: #F4D03F;

    /* Backgrounds */
    --bg-page: #F9FAF9;
    /* Off-white / Eggshell */
    --bg-gradient: linear-gradient(180deg, #F9FAF9 0%, #E6F4EA 100%);

    /* Text */
    --text-charcoal: #2C3E50;
    --text-soft: #546E7A;
    --text-light: #FFFFFF;

    /* UI Elements */
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --shadow-soft: 0 10px 40px -10px rgba(93, 156, 89, 0.15);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.06);

    /* Font */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* Reset & Base */
* {
    box-sizing: border-box;
}

body {
    background: var(--bg-gradient);
    color: var(--text-charcoal);
    font-family: var(--font-body);
    height: 100dvh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 1. Minimal Top Nav */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
    height: 70px;
}

.nav-branding {
    display: flex;
    flex-direction: column;
}

.nav-logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 18px;
    color: var(--primary-green);
    letter-spacing: -0.5px;
}

.nav-status {
    font-size: 11px;
    color: var(--text-soft);
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--primary-green);
    border-radius: 50%;
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 2. Chat Area */
.chat-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.chat-display {
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding-bottom: 30px;
}

/* 3. Messages */
.message {
    display: flex;
    gap: 15px;
    max-width: 90%;
    align-items: flex-end;
    /* Bottom align avatars */
    animation: messageSlide 0.4s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes messageSlide {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.ai-message .avatar {
    background: #FFFFFF;
    border: 1px solid #E0E0E0;
    color: var(--primary-green);
}

.user-message .avatar {
    background: var(--primary-green);
    color: white;
}

.bubble {
    padding: 16px 22px;
    border-radius: var(--radius-lg);
    font-size: 15px;
    line-height: 1.6;
    position: relative;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s;
}

.ai-message .bubble {
    background: var(--primary-green-light);
    /* Light Green Info */
    color: var(--text-charcoal);
    border-bottom-left-radius: 4px;
}

.user-message .bubble {
    background: #FFFFFF;
    color: var(--text-charcoal);
    border-bottom-right-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

/* Tree Product Cards (Rich Content) */
.tree-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    margin-top: 15px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease;
}

.tree-card:hover {
    transform: translateY(-3px);
}

.card-header {
    background: var(--primary-green);
    color: white;
    padding: 12px 16px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 16px;
    display: grid;
    gap: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 6px;
}

.info-label {
    color: var(--text-soft);
}

.info-value {
    font-weight: 500;
    color: var(--text-charcoal);
}

.card-actions {
    padding: 12px 16px;
    background: #F8F9FA;
    display: flex;
    gap: 10px;
}

.action-btn {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--primary-green);
    background: white;
    color: var(--primary-green);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--primary-green);
    color: white;
}

/* 4. Hero / Empty State */
.hero-container {
    padding: 40px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.hero-icon {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px;
    color: var(--primary-green);
    box-shadow: 0 15px 30px rgba(93, 156, 89, 0.2);
    margin-bottom: 20px;
    animation: floatLeaf 4s ease-in-out infinite;
}

@keyframes floatLeaf {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-charcoal);
    margin: 0 0 10px 0;
}

.hero-subtitle {
    color: var(--text-soft);
    font-size: 15px;
    max-width: 400px;
    line-height: 1.5;
}

/* 5. Input Dock (Floating & Organic) */
.input-dock {
    padding: 20px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.8) 80%, rgba(255, 255, 255, 0));
    position: relative;
    z-index: 50;
}

.input-container {
    background: white;
    border-radius: 50px;
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    padding: 8px 10px 8px 25px;
    border: 1px solid #F0F0F0;
    transition: all 0.3s;
}

.input-container:focus-within {
    transform: scale(1.02);
    border-color: var(--primary-green);
    box-shadow: 0 15px 40px rgba(93, 156, 89, 0.25);
}

.input-field {
    flex: 1;
    border: none;
    font-size: 16px;
    background: transparent;
    color: var(--text-charcoal);
    outline: none;
    padding: 10px 0;
}

/* Voice Button (Organic Pulse) */
.voice-trigger {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: #F5F7F5;
    color: var(--secondary-earth);
    cursor: pointer;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    position: relative;
    overflow: visible;
}

.voice-trigger:hover {
    background: #E8F5E9;
    color: var(--primary-green);
}

.voice-trigger.pulse-active {
    background: var(--primary-green);
    color: white;
    animation: breath 2s infinite;
}

.voice-trigger.pulse-active::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--primary-green);
    animation: ripple 1.5s infinite;
    z-index: -1;
}

@keyframes breath {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.send-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-green);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.send-btn:hover {
    transform: scale(1.1);
}

/* Suggestion Pills */
.suggestion-pills {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0 20px 0;
    scrollbar-width: none;
    justify-content: center;
    flex-wrap: wrap;
}

.pill {
    background: white;
    border: 1px solid #EBEBEB;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13px;
    color: var(--text-soft);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.pill:hover {
    background: var(--primary-green);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(93, 156, 89, 0.3);
    border-color: var(--primary-green);
}

/* Animations */
.loading-sprout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    opacity: 0;
    animation: fadeIn 0.5s forwards;
}

.sprout-icon {
    font-size: 24px;
    color: var(--primary-green);
    animation: growSprout 1.5s infinite alternate;
}

@keyframes growSprout {
    from {
        transform: scale(0.8) translateY(5px);
    }

    to {
        transform: scale(1.2) translateY(0);
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Markdowns */
.bubble h3 {
    margin: 0 0 8px 0;
    color: var(--secondary-earth);
    font-size: 16px;
}

.bubble p {
    margin-bottom: 8px;
}

.bubble li {
    margin-left: 20px;
    margin-bottom: 4px;
    list-style-type: circle;
}

.bubble strong {
    color: var(--primary-green);
    font-weight: 600;
}

/* Metadata (Time & Voice) */
.msg-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.msg-time {
    font-size: 11px;
    color: var(--text-soft);
    opacity: 0.7;
}

.voice-btn {
    background: none;
    border: none;
    color: var(--primary-green);
    cursor: pointer;
    font-size: 13px;
    padding: 2px;
    transition: transform 0.2s, color 0.2s;
}

.voice-btn:hover {
    color: var(--secondary-earth);
    transform: scale(1.1);
}

.voice-btn i.fa-stop {
    color: #ff5252;
}

/* Desktop spacing adjustment */
@media (min-width: 768px) {
    .chat-display {
        gap: 35px;
    }
}
