/* Bottom Fixed Menu Styles */
.bottom-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(5, 150, 105, 0.15);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 0.5rem 0;
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-menu-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem;
}

.bottom-menu .bottom-menu-container .bottom-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #6b7280 !important;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-width: 60px;
    gap: 0.25rem;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}

.bottom-menu-item i {
    font-size: 1.25rem;
    line-height: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-menu-item span {
    line-height: 1;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-menu .bottom-menu-container .bottom-menu-item:hover {
    color: #059669;
    background: rgba(5, 150, 105, 0.08);
    transform: translateY(-2px);
}

.bottom-menu-item:hover i {
    transform: scale(1.1);
}

.bottom-menu .bottom-menu-container .bottom-menu-item.active {
    color: #059669;
    font-weight: 600;
    transform: scale(1.05);
}


.bottom-menu-submenu {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--bottom-menu-height, 80px) + env(safe-area-inset-bottom));
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    padding: 0 1rem 0.75rem;
}

.bottom-menu.submenu-open .bottom-menu-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.bottom-menu-submenu-container {
    max-width: 600px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(5, 150, 105, 0.15);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    padding: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.bottom-menu-submenu-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #2d3748;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.6rem 0.9rem;
    border-radius: 12px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.bottom-menu-submenu-item:hover {
    background: rgba(5, 150, 105, 0.08);
    color: #059669;
    transform: translateY(-1px);
}

.bottom-menu-submenu-item i {
    width: 18px;
    text-align: center;
}

/* Adjust for smaller screens */
@media (max-width: 380px) {
    .bottom-menu .bottom-menu-container .bottom-menu-item {
        min-width: 50px;
        padding: 0.5rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .bottom-menu .bottom-menu-container .bottom-menu-item i {
        font-size: 1.1rem;
    }
    
    .bottom-menu-container {
        padding: 0 0.5rem;
    }
}

/* Adjust for very small screens */
@media (max-width: 320px) {
    .bottom-menu .bottom-menu-container .bottom-menu-item span {
        display: none;
    }
    
    .bottom-menu .bottom-menu-container .bottom-menu-item {
        min-width: 45px;
        padding: 0.75rem 0.5rem;
    }
    
    .bottom-menu .bottom-menu-container .bottom-menu-item i {
        font-size: 1.2rem;
    }
}

/* Add bottom padding to body to prevent content from being hidden behind the menu */
body {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

/* Smooth scroll behavior */
.bottom-menu .bottom-menu-container .bottom-menu-item {
    scroll-behavior: smooth;
}

/* Animation for menu appearance */
.bottom-menu {
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Hide menu when scrolling down, show when scrolling up */
.bottom-menu.hidden {
    transform: translateY(100%);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ai-assistant {
    position: fixed;
    right: 18px;
    bottom: calc(var(--bottom-menu-height, 80px) + env(safe-area-inset-bottom) + 18px);
    z-index: 1100;
}

.ai-assistant-fab {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
   /* background: linear-gradient(135deg, #059669, #047857); */
	background: #fff;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.ai-assistant-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.2);
    filter: brightness(1.03);
}

.ai-assistant-avatar {
    display: block;
    object-fit: cover;
}

.ai-assistant-fab .ai-assistant-avatar {
    width: 100%;
    height: 100%;
    border-radius: 999px;
}

.ai-assistant-title .ai-assistant-avatar {
    width: 22px;
    height: 22px;
    border-radius: 999px;
}

.ai-assistant-panel {
    position: absolute;
    right: 0;
    bottom: 68px;
    width: min(380px, calc(100vw - 36px));
    height: min(520px, calc(100vh - 180px));
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(5, 150, 105, 0.18);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .ai-assistant {
        bottom: 80px;
        right: 16px;
    }
    
    .ai-assistant-panel {
        height: min(480px, calc(100vh - 120px));
        width: calc(100vw - 32px);
        max-width: 360px;
        right: 0;
        bottom: 72px;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .ai-assistant {
        right: 12px;
    }
    
    .ai-assistant-panel {
        height: min(420px, calc(100vh - 140px));
        width: calc(100vw - 24px);
        max-width: none;
        right: 0;
        bottom: 68px;
        border-radius: 10px;
    }
}

@media (max-width: 360px) {
    .ai-assistant-panel {
        height: min(380px, calc(100vh - 140px));
        width: calc(100vw - 16px);
        right: 0;
        bottom: 68px;
    }
}

.ai-assistant-panel[hidden] {
    display: none;
}

.ai-assistant-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1rem;
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.14), rgba(4, 120, 87, 0.08));
    border-bottom: 1px solid rgba(5, 150, 105, 0.14);
}

.ai-assistant-title {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: #065f46;
    font-weight: 700;
}

.ai-assistant-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-assistant-clear {
    background: transparent;
    border: 1px solid rgba(5, 150, 105, 0.25);
    color: #065f46;
    padding: 0.35rem 0.6rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
}

.ai-assistant-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(5, 150, 105, 0.25);
    background: transparent;
    color: #065f46;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ai-assistant-messages {
    flex: 1;
    padding: 1rem;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ai-assistant-message {
    max-width: 85%;
    padding: 0.7rem 0.85rem;
    border-radius: 14px;
    line-height: 1.35;
    font-size: 0.95rem;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.ai-assistant-message.user {
    align-self: flex-end;
    background: rgba(5, 150, 105, 0.12);
    border: 1px solid rgba(5, 150, 105, 0.18);
    color: #064e3b;
}

.ai-assistant-message.assistant {
    align-self: flex-start;
    background: rgba(107, 114, 128, 0.08);
    border: 1px solid rgba(107, 114, 128, 0.16);
    color: #111827;
}

.ai-assistant-form {
    display: flex;
    gap: 0.6rem;
    padding: 0.85rem;
    border-top: 1px solid rgba(107, 114, 128, 0.18);
    background: rgba(255, 255, 255, 0.98);
}

.ai-assistant-input {
    flex: 1;
    border: 1px solid rgba(107, 114, 128, 0.28);
    border-radius: 12px;
    padding: 0.75rem 0.85rem;
    font-size: 0.95rem;
    outline: none;
}

.ai-assistant-input:focus {
    border-color: rgba(5, 150, 105, 0.55);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.ai-assistant-send {
    width: 44px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #059669, #047857);
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.ai-assistant-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ai-assistant-send:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}
