/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 2rem;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255,255,255,0.2);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.search-bar {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    background: white;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.search-bar input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    outline: none;
    font-size: 1rem;
    color: #333;
}

.search-bar button {
    background: #667eea;
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-bar button:hover {
    background: #5a6fd8;
}

/* Price Comparison Section */
.price-comparison {
    padding: 4rem 0;
}

.price-comparison h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2.2rem;
    color: #333;
}

.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.filters select {
    padding: 0.75rem 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s ease;
}

.filters select:hover,
.filters select:focus {
    border-color: #667eea;
}

.grocery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.grocery-item {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.grocery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.grocery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.grocery-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.category-badge {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.brand-badge {
    background: #28a745;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.pack-size-badge {
    background: #ffc107;
    color: #212529;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.price-unit {
    font-size: 0.8rem;
    color: #666;
    margin-left: 0.3rem;
}

.special-offer {
    display: block;
    font-size: 0.75rem;
    color: #dc3545;
    font-weight: 600;
    margin-top: 0.2rem;
    padding: 0.2rem 0.4rem;
    background-color: #fff5f5;
    border-radius: 4px;
    border: 1px solid #fecaca;
}

.price-comparison-list {
    margin: 1rem 0;
}

.price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.price-item:last-child {
    border-bottom: none;
}

.store-name {
    font-weight: 500;
    color: #555;
}

.price {
    font-weight: 600;
    font-size: 1.1rem;
}

.price.lowest {
    color: #28a745;
}

.price.highest {
    color: #dc3545;
}

.savings {
    background: #28a745;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}



/* Footer */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        gap: 1rem;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .search-bar {
        flex-direction: column;
        border-radius: 8px;
    }

    .search-bar input,
    .search-bar button {
        border-radius: 0;
    }

    .filters {
        flex-direction: column;
        align-items: center;
    }

    .grocery-grid {
        grid-template-columns: 1fr;
    }

    .message-content {
        max-width: 85%;
    }

    .chat-input-container {
        flex-direction: column;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* User Controls */
.user-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-email {
    color: white;
    font-size: 0.9rem;
}

.auth-section {
    display: flex;
    gap: 0.5rem;
}

.auth-btn, .logout-btn {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255,255,255,0.3);
    background: transparent;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.auth-btn:hover, .logout-btn:hover {
    background: rgba(255,255,255,0.1);
}

.refresh-btn {
    padding: 0.5rem;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(33, 150, 243, 0.2);
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    margin: 0 0.25rem;
}

.refresh-btn:hover {
    background: rgba(33, 150, 243, 0.4);
}

.auth-btn.primary {
    background: #28a745;
    border-color: #28a745;
}

.auth-btn.primary:hover {
    background: #218838;
}

.subscription-btn {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.subscription-btn.free {
    background: #6c757d;
    color: white;
}

.subscription-btn.premium {
    background: linear-gradient(45deg, #f093fb, #f5576c);
    color: white;
}

/* Dashboard Styles */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card i {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.stat-card h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.stat-card p {
    color: #666;
    font-size: 0.9rem;
}

/* Price Alerts */
.price-alerts {
    padding: 4rem 0;
    background: #f8f9fa;
}

.alerts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.alert-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-left: 4px solid #28a745;
    transition: transform 0.3s ease;
}

.alert-card:hover {
    transform: translateY(-3px);
}

.alert-card.price-drop {
    border-left-color: #28a745;
}

.alert-card.best-deal {
    border-left-color: #ffc107;
}

.alert-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.alert-header i {
    color: #28a745;
    font-size: 1.2rem;
}

.alert-type {
    background: #28a745;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.alert-card h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.alert-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.current-price {
    font-size: 1.2rem;
    font-weight: 600;
    color: #28a745;
}

.old-price {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 0.9rem;
}

.alert-store {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.alert-savings {
    background: #e7f5e7;
    color: #28a745;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

/* Quick Actions */
.quick-actions {
    padding: 4rem 0;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.action-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    color: #333;
}

.action-card.premium {
    border-color: #f093fb;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.action-card.premium:hover {
    color: white;
}

.action-card i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #667eea;
}

.action-card.premium i {
    color: white;
}

.action-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.action-card p {
    font-size: 0.9rem;
    opacity: 0.8;
}

.premium-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #ffc107;
    color: #333;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Live Updates */
.live-updates {
    padding: 4rem 0;
    background: #f8f9fa;
}

.update-feed {
    max-height: 400px;
    overflow-y: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.update-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease;
}

.update-item:last-child {
    border-bottom: none;
}

.update-item:hover {
    background: #f8f9fa;
}

.update-item.new-update {
    background: #e7f5e7;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.update-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.update-content {
    flex: 1;
}

.update-text {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.update-time {
    font-size: 0.8rem;
    color: #666;
}

.update-change {
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.update-change.increase {
    background: #ffe6e6;
    color: #dc3545;
}

.update-change.decrease {
    background: #e7f5e7;
    color: #28a745;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal:not(.hidden) .modal-content {
    transform: scale(1);
}

.close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

/* Auth Forms */
.auth-form {
    text-align: center;
}

.auth-form h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

.auth-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.auth-form input:focus {
    border-color: #667eea;
}

.auth-submit {
    width: 100%;
    padding: 0.75rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.auth-submit:hover {
    background: #5a6fd8;
}

.auth-form p {
    margin-top: 1rem;
    color: #666;
}

.auth-form a {
    color: #667eea;
    text-decoration: none;
}

.auth-form a:hover {
    text-decoration: underline;
}



/* Premium Modal */
.premium-content {
    text-align: center;
}

.premium-content h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

.pricing-card {
    border: 2px solid #f093fb;
    border-radius: 12px;
    padding: 2rem;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.pricing-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.pricing-card ul {
    list-style: none;
    margin-bottom: 2rem;
    text-align: left;
}

.pricing-card li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pricing-card li i {
    color: #28a745;
    background: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.price {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.premium-btn {
    background: white;
    color: #f093fb;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.premium-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.payment-info {
    text-align: center;
    margin: 10px 0;
    color: #666;
}

.payment-info small {
    font-size: 12px;
    color: #28a745;
}

.payment-info i {
    margin-right: 5px;
}

/* Stripe Payment Modal Styles */
.stripe-payment-modal .close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.stripe-payment-modal .close:hover {
    color: #000;
}

.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-left: 10px;
}

.spinner.hidden {
    display: none;
}

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

.stripe-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.stripe-submit-btn:hover:not(:disabled) {
    background: #5a6fd8;
}

/* AI Assistant Styles - Modern Design */
.ai-chat-modal {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.ai-chat-modal.hidden {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    pointer-events: none;
}

.ai-chat-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

.ai-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.ai-chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
}

.ai-chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 18px;
    position: relative;
    z-index: 1;
}

.ai-chat-title i {
    font-size: 20px;
    background: rgba(255,255,255,0.2);
    padding: 8px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.ai-chat-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 12px;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

.ai-chat-close:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.1);
}

.ai-chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

.ai-message {
    display: flex;
    max-width: 85%;
    animation: messageSlideIn 0.3s ease-out;
}

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

.ai-message-user {
    align-self: flex-end;
    margin-left: auto;
}

.ai-message-assistant {
    align-self: flex-start;
}

.ai-message-content {
    background: #ffffff;
    padding: 16px 20px;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.ai-message-user .ai-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.ai-message-assistant .ai-message-content::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 16px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #ffffff;
}

.ai-message-user .ai-message-content::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 16px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid #667eea;
}

.ai-message-text {
    line-height: 1.6;
    margin-bottom: 8px;
    font-size: 14px;
}

.ai-message-time {
    font-size: 11px;
    opacity: 0.6;
    text-align: right;
    font-weight: 500;
}

.ai-message-assistant .ai-message-time {
    text-align: left;
}

.ai-chat-input-container {
    padding: 20px 24px;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.ai-chat-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
    background: #f8fafc;
    border-radius: 25px;
    padding: 4px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.ai-chat-input-wrapper:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#ai-chat-input {
    flex: 1;
    padding: 14px 20px;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
    color: #374151;
}

#ai-chat-input::placeholder {
    color: #9ca3af;
}

#ai-chat-send {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#ai-chat-send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

#ai-chat-send:active {
    transform: scale(0.95);
}

#ai-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.ai-chat-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
}

.ai-loading-dots {
    display: flex;
    gap: 4px;
}

.ai-loading-dots span {
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    animation: ai-bounce 1.4s ease-in-out infinite both;
}

.ai-loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.ai-loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes ai-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.ai-button-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.ai-button-text {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Floating button pulse animation */
#ai-assistant-button {
    animation: ai-pulse 2s infinite;
}

@keyframes ai-pulse {
    0% {
        box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3), 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    100% {
        box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3), 0 0 0 10px rgba(102, 126, 234, 0);
    }
}

/* AI Quick Actions - Modern Design */
.ai-quick-actions {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.ai-actions-title {
    font-size: 13px;
    font-weight: 700;
    color: #4b5563;
    margin-bottom: 16px;
    text-align: center;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.ai-actions-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ai-action-btn {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    color: #374151;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.ai-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.ai-action-btn:hover::before {
    left: 100%;
}

.ai-action-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

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

.ai-action-btn i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.ai-action-btn:hover i {
    transform: scale(1.1);
}

/* Mobile responsiveness for AI Assistant */
@media (max-width: 768px) {
    #ai-chat-modal {
        width: calc(100vw - 32px);
        height: calc(100vh - 140px);
        bottom: 100px;
        right: 16px;
        left: 16px;
        border-radius: 20px;
    }
    
    #ai-assistant-button {
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
        font-size: 18px;
    }
    
    .ai-actions-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .ai-action-btn {
        padding: 14px 16px;
        font-size: 14px;
        border-radius: 14px;
    }
    
    .ai-chat-header {
        padding: 16px 20px;
    }
    
    .ai-chat-title {
        font-size: 16px;
    }
    
    .ai-chat-messages {
        padding: 20px;
        gap: 16px;
    }
    
    .ai-chat-input-container {
        padding: 16px 20px;
    }
    
    .ai-message-content {
        padding: 14px 18px;
        border-radius: 18px;
    }
}



.trial-upgrade-btn:hover {
    background: #e0a800;
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #28a745;
}

.status-indicator.online {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}



/* Typing Indicator */


.message-time {
    font-size: 0.7rem;
    color: #999;
    margin-top: 0.5rem;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 1001;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 350px;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid #28a745;
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-warning {
    border-left: 4px solid #ffc107;
}

.toast-info {
    border-left: 4px solid #17a2b8;
}

.toast i {
    font-size: 1.2rem;
}

.toast-success i {
    color: #28a745;
}

.toast-error i {
    color: #dc3545;
}

.toast-warning i {
    color: #ffc107;
}

.toast-info i {
    color: #17a2b8;
}

/* Enhanced Price Comparison */
.comparison-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 2rem;
}

.last-updated {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.refresh-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.refresh-btn:hover {
    background: #5a6fd8;
}

.price-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
}

.grocery-item.enhanced {
    position: relative;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.favorite-btn, .alert-btn, .history-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.favorite-btn:hover, .alert-btn:hover, .history-btn:hover {
    background: #f8f9fa;
    color: #667eea;
}

.favorite-btn.favorited {
    color: #dc3545;
}

.price-item.enhanced {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.store-info {
    display: flex;
    flex-direction: column;
}

.store-distance {
    font-size: 0.8rem;
    color: #999;
}

.price-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.savings-info {
    background: #e7f5e7;
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 1rem;
    text-align: center;
}

.savings-percentage {
    font-size: 0.8rem;
    color: #28a745;
    font-weight: 500;
    margin-top: 0.25rem;
}

.item-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    font-size: 0.8rem;
}

.item-stats .stat {
    text-align: center;
}

.item-stats .stat-label {
    color: #666;
    font-size: 0.7rem;
}

.item-stats .stat-value {
    font-weight: 600;
    color: #333;
}

.price-change-indicator {
    position: absolute;
    top: -10px;
    right: 0;
    background: white;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    animation: fadeInOut 5s ease;
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0;
        transform: translateY(-5px);
    }
    10%, 90% {
        opacity: 1;
        transform: translateY(0);
    }
}

.price-change-indicator.increase {
    color: #dc3545;
}

.price-change-indicator.decrease {
    color: #28a745;
}

.price-hero {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.chart-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-top: 2rem;
    height: 400px;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: #666;
}

/* About Page Styles */
.about-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.mission {
    padding: 4rem 0;
}

.mission-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.mission-content h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #333;
}

.mission-content p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #666;
    margin-bottom: 3rem;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.value-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.value-card:hover {
    transform: translateY(-5px);
}

.value-card i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.value-card h3 {
    margin-bottom: 1rem;
    color: #333;
}

.value-card p {
    color: #666;
    line-height: 1.6;
}

.how-it-works {
    padding: 4rem 0;
    background: #f8f9fa;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.step-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    position: relative;
    transition: transform 0.3s ease;
}

.step-card:hover {
    transform: translateY(-5px);
}

.step-number {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.step-card h3 {
    margin: 1rem 0;
    color: #333;
}

.step-card p {
    color: #666;
    line-height: 1.6;
}

.team {
    padding: 4rem 0;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.team-member {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.team-member:hover {
    transform: translateY(-5px);
}

.member-photo {
    width: 100px;
    height: 100px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #667eea;
}

.team-member h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.role {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 1rem;
}

.team-member p {
    color: #666;
    line-height: 1.6;
    font-size: 0.9rem;
}

.stats {
    padding: 4rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-item h3 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.stat-item p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.technology {
    padding: 4rem 0;
}

.tech-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

.tech-description h3 {
    color: #333;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.tech-description h3:first-child {
    margin-top: 0;
}

.tech-description p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.tech-features {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 12px;
    height: fit-content;
}

.tech-features .feature-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tech-features .feature-item {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.contact {
    padding: 4rem 0;
    background: #f8f9fa;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-item i {
    font-size: 1.5rem;
    color: #667eea;
    margin-top: 0.5rem;
}

.contact-item h4 {
    margin-bottom: 0.5rem;
    color: #333;
}

.contact-item p {
    color: #666;
    line-height: 1.6;
}

.contact-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.contact-form h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    border-color: #667eea;
}

.submit-btn {
    background: #667eea;
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-btn:hover {
    background: #5a6fd8;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section p {
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: #667eea;
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid #555;
    padding-top: 2rem;
    text-align: center;
}

.footer-bottom p {
    color: #ccc;
}



/* Map Styles */
.address-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.address-content h2 {
    margin-bottom: 1rem;
    font-size: 2.5rem;
}

.address-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.address-form {
    max-width: 600px;
    margin: 0 auto;
}

.input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.input-group input {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
}

.input-group .btn {
    white-space: nowrap;
}

.map-section {
    padding: 2rem 0;
    background: #f8f9fa;
}

.map-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

#map {
    height: 500px;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    z-index: 1;
}

.map-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
}

.results-section {
    padding: 3rem 0;
    background: white;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-header h3 {
    font-size: 1.8rem;
    color: #333;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-controls select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
}

.store-results {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.store-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.store-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.store-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.store-header h4 {
    font-size: 1.3rem;
    color: #333;
    margin: 0;
}

.store-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stars {
    color: #ffc107;
    font-size: 1.1rem;
}

.rating-number {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
}

.store-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.store-info p {
    margin-bottom: 0.5rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.store-info i {
    color: #667eea;
    width: 16px;
}

.store-pricing {
    text-align: right;
}

.cheapest-eggs h5 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.product-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #28a745;
    margin-bottom: 0.25rem;
}

.price-per-egg {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.distance {
    color: #667eea;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.store-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.store-actions .btn {
    flex: 1;
    min-width: 150px;
}

.free-user-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    color: #856404;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.free-user-warning a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.free-user-warning a:hover {
    text-decoration: underline;
}

.premium-features-banner {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin-top: 2rem;
}

.banner-content h4 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.banner-content p {
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.no-results {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
}

/* Map Markers */
.user-marker {
    background: #28a745;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.store-marker {
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.store-popup {
    text-align: center;
}

.store-popup h4 {
    margin-bottom: 0.5rem;
    color: #333;
}

.store-popup p {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

/* Map Responsive Design */
@media (max-width: 768px) {
    .address-content h2 {
        font-size: 2rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group input {
        margin-bottom: 1rem;
    }
    
    #map {
        height: 400px;
    }
    
    .store-details {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .store-pricing {
        text-align: center;
    }
    
    .store-actions {
        flex-direction: column;
    }
    
    .store-actions .btn {
        min-width: auto;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .address-section {
        padding: 2rem 0;
    }
    
    .address-content h2 {
        font-size: 1.8rem;
    }
    
    #map {
        height: 300px;
    }
    
    .map-controls {
        flex-direction: column;
        align-items: center;
    }
}

/* Responsive Design Updates */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .user-controls {
        width: 100%;
        justify-content: center;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .actions-grid {
        grid-template-columns: 1fr;
    }

    .alerts-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .price-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .comparison-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .suggestion-chips {
        flex-direction: column;
    }

    .tech-content {
        grid-template-columns: 1fr;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .team-grid {
        grid-template-columns: 1fr;
    }

    .values-grid {
        grid-template-columns: 1fr;
    }

    .steps-grid {
        grid-template-columns: 1fr;
    }

    .feature-list {
        grid-template-columns: 1fr;
    }
}

/* Utility Classes */
.hidden {
    display: none;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
