/* AI Food Lookup Bottom Popup */
.ai-lookup-bottom-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99999;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3);
    border-radius: 16px 16px 0 0;
    max-height: 60vh;
    overflow-y: auto;
}

.ai-lookup-bottom-popup.show {
    transform: translateY(0);
}

.ai-popup-content {
    padding: 24px;
    max-width: 600px;
    margin: 0 auto;
}

.ai-popup-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.ai-popup-icon {
    font-size: 20px;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

.ai-popup-text h4 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
}

.ai-popup-text p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.ai-popup-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    transition: background-color 0.2s;
}

.ai-popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ai-popup-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-form-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-popup-input {
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.ai-popup-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.ai-popup-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.ai-search-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    border: none;
    color: white;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(238, 90, 36, 0.3);
}

.ai-search-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(238, 90, 36, 0.4);
}

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

.ai-search-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.search-icon {
    font-size: 14px;
    font-weight: 600;
}

.loading-spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (min-width: 768px) {
    .ai-form-row {
        display: grid;
        grid-template-columns: 1fr 2fr 1.5fr;
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .ai-popup-content {
        padding: 20px 16px;
    }
    
    .ai-popup-header {
        gap: 12px;
    }
    
    .ai-popup-text h4 {
        font-size: 16px;
    }
    
    .ai-popup-text p {
        font-size: 13px;
    }
    
    .ai-popup-input {
        padding: 12px 16px;
        font-size: 16px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .ai-lookup-bottom-popup {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    }
}

/* Animation for when popup appears */
.ai-lookup-bottom-popup {
    animation: slideUpFade 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Backdrop blur effect for modern browsers */
@supports (backdrop-filter: blur(10px)) {
    .ai-lookup-bottom-popup {
        backdrop-filter: blur(10px);
    }
}