:root {
    --primary-color: #00c853;
    --primary-hover: #009624;
    --accent-color: #2979ff;
    --text-main: #1a1a1a;
    --text-secondary: #666666;
    --bg-color: #f0f2f5;
    --card-bg: rgba(255, 255, 255, 0.85);
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Outfit', sans-serif;
}

[data-theme="dark"] {
    --text-main: #ffffff;
    --text-secondary: #a0a0a0;
    --bg-color: #121212;
    --card-bg: rgba(30, 30, 30, 0.85);
    --border-color: #333333;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    transition: background-color 0.5s ease;
}

/* Background Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s infinite alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: #b9f6ca;
    animation-delay: 0s;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: #82b1ff;
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 40%;
    width: 300px;
    height: 300px;
    background: #ff80ab;
    opacity: 0.4;
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, 50px) scale(1.1);
    }
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 480px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    margin: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-height: 600px;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.header-content h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.month-navigation {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 32px;
    height: 32px;
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

[data-theme="dark"] .nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.header-content p {
    font-size: 1.1rem;
    color: var(--text-main);
    font-weight: 600;
    min-width: 140px;
    text-align: center;
    user-select: none;
}

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

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

#search-input {
    position: absolute;
    right: 48px;
    width: 0;
    padding: 0;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    color: var(--text-main);
    font-family: var(--font-family);
    outline: none;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-container.expanded #search-input {
    width: 200px;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--primary-color);
    border-radius: 24px;
    opacity: 1;
    pointer-events: all;
    box-shadow: 0 4px 12px rgba(0, 200, 83, 0.2);
}

[data-theme="dark"] .search-container.expanded #search-input {
    background: rgba(0, 0, 0, 0.6);
    color: var(--text-main);
}

#search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

#search-btn {
    z-index: 1;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

.icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: rotate(15deg);
}

/* Input Section */
.input-section {
    margin-bottom: 2rem;
}

.input-wrapper {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.5);
    padding: 0.5rem;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    align-items: center;
}

[data-theme="dark"] .input-wrapper {
    background: rgba(0, 0, 0, 0.2);
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 200, 83, 0.2);
}

#item-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.75rem 0.5rem;
    font-size: 1rem;
    color: var(--text-main);
    font-family: var(--font-family);
    outline: none;
    min-width: 0;
    /* Prevents flex overflow */
}

.price-input-container {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-sm);
    padding: 0 0.5rem;
    width: 75px;
    transition: var(--transition);
}

[data-theme="dark"] .price-input-container {
    background: rgba(255, 255, 255, 0.1);
}

.price-input-container:focus-within {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: inset 0 0 0 1px var(--primary-color);
}

[data-theme="dark"] .price-input-container:focus-within {
    background: rgba(0, 0, 0, 0.4);
}

.currency-symbol {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-right: 4px;
    font-weight: 500;
}

#price-input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 0.75rem 0;
    font-size: 0.95rem;
    color: var(--text-main);
    font-family: var(--font-family);
    outline: none;
    -moz-appearance: textfield;
}

#price-input::-webkit-outer-spin-button,
#price-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#price-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

#add-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

#add-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

#add-btn:active {
    transform: scale(0.95);
}

/* List Section */
.list-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.list-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.list-header #item-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.05);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    align-self: flex-start;
}

.total-display {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.total-display span:first-child {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

#total-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    cursor: pointer;
    transition: var(--transition);
}

#total-price:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

.manual-total {
    display: block;
    font-size: 0.8rem;
    color: var(--accent-color);
    font-weight: 500;
    margin-top: 0.2rem;
}

[data-theme="dark"] .list-header span {
    background: rgba(255, 255, 255, 0.1);
}

.shopping-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    flex: 1;
    padding-right: 0.5rem;
    min-height: 200px;
    max-height: 400px;
}

/* Scrollbar styling */
.shopping-list::-webkit-scrollbar {
    width: 6px;
}

.shopping-list::-webkit-scrollbar-track {
    background: transparent;
}

.shopping-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.list-item {
    background: rgba(255, 255, 255, 0.85);
    padding: 1rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.08);
    animation: slideIn 0.3s ease forwards;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    min-height: 60px;
}

[data-theme="dark"] .list-item {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.1);
}

.list-item:hover {
    transform: translateX(4px) scale(1.01);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-md);
    border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .list-item:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.15);
}

.list-item.completed {
    opacity: 0.7;
    background: rgba(0, 200, 83, 0.08);
    border: 1px solid rgba(0, 200, 83, 0.2);
    transform: scale(0.98);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .list-item.completed {
    background: rgba(0, 200, 83, 0.15);
    border-color: rgba(0, 200, 83, 0.3);
}

.list-item.completed .item-text {
    text-decoration: line-through;
    color: var(--text-secondary);
    opacity: 0.7;
    transition: all 0.6s ease;
}

.drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: grab;
    padding: 0.25rem;
    opacity: 0.5;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.drag-handle:active {
    cursor: grabbing;
}

.list-item:hover .drag-handle {
    opacity: 1;
    color: var(--primary-color);
}


.list-item.dragging {
    opacity: 0.8;
    transform: scale(0.98);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--primary-color);
}

@media (max-width: 768px) {
    .list-item.dragging {
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    }
}

.checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    flex-shrink: 0;
    background: transparent;
}

.list-item.completed .checkbox {
    background: var(--primary-color);
    border-color: var(--primary-color);
    animation: pop 0.4s ease-in-out;
}

.checkbox i {
    color: white;
    font-size: 0.9rem;
    opacity: 0;
    transform: scale(0) rotate(-45deg);
    transition: none;
}

.list-item.completed .checkbox i {
    animation: checkmark-pop 0.4s 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes pop {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scale(1.15);
    }

    50% {
        transform: scale(0.95);
    }

    70% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes checkmark-pop {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }

    70% {
        transform: scale(1.3) rotate(0deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    min-height: 40px;
    justify-content: center;
}

.item-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-main);
    transition: var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    outline: none;
}

.item-text:hover {
    color: var(--primary-color);
}

.item-text.editing {
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: inset 0 0 0 2px var(--primary-color);
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    cursor: text;
}

[data-theme="dark"] .item-text.editing {
    background: rgba(0, 0, 0, 0.4);
}

.item-price-tag {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
    padding: 2px 6px;
    margin-left: -6px;
    border-radius: 4px;
}

.item-price-tag:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

[data-theme="dark"] .item-price-tag:hover {
    background: rgba(255, 255, 255, 0.1);
}

.item-price-tag.editing {
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: inset 0 0 0 2px var(--primary-color);
}

.item-price-tag.editing span {
    outline: none;
    cursor: text;
}

[data-theme="dark"] .item-price-tag.editing {
    background: rgba(0, 0, 0, 0.4);
}

.item-price-tag i {
    font-size: 0.7rem;
    opacity: 0.5;
}

.list-item.completed .item-price-tag {
    text-decoration: line-through;
    opacity: 0.7;
    transition: all 0.6s ease;
}

.delete-btn {
    background: transparent;
    border: none;
    color: #ff5252;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    opacity: 0;
    transform: translateX(10px);
    transition: var(--transition);
}

.shopping-list:hover .delete-btn {
    opacity: 1;
    transform: translateX(0);
}

.delete-btn:hover {
    background: rgba(255, 82, 82, 0.1);
}

/* Empty State */
.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
    color: var(--text-secondary);
    text-align: center;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.shopping-list:empty+.empty-state {
    display: flex;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

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

.modal-header h2 {
    font-size: 1.25rem;
    color: var(--text-main);
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #ff5252;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.modal-small {
    max-width: 400px;
    width: 90%;
}

.modal-medium {
    max-width: 600px;
    width: 90%;
}

.modal-chat {
    max-width: 800px;
    width: 95%;
    height: 80vh;
    max-height: 600px;
    display: flex;
    flex-direction: column;
}

.modal-fullscreen {
    max-width: 1200px;
    width: 95%;
    height: 90vh;
    max-height: 90vh;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* AI Button Styles */
.ai-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.ai-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

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

/* AI Prompt Form */
.ai-prompt-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ai-prompt-form .form-description {
    color: var(--text-main);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.ai-prompt-form .form-description i {
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.2rem;
}

#ai-prompt-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.3s ease;
    background: var(--card-bg);
    color: var(--text-main);
}

#ai-prompt-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

#ai-prompt-input::placeholder {
    color: var(--text-secondary);
}

/* AI Dashboard Styles */
.ai-dashboard-container {
    padding: 0;
    height: calc(90vh - 80px);
    overflow: hidden;
}

#ai-dashboard-content {
    width: 100%;
    height: 100%;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--primary-color);
    font-size: 1.1rem;
    text-align: center;
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-spinner small {
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px;
    color: var(--error-color);
}

.error-message i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--error-color);
}

.error-message h3 {
    margin-bottom: 10px;
    color: var(--text-main);
}

.error-message p {
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.error-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--surface-color);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--hover-color);
    transform: translateY(-1px);
}

/* Chat Styles */
.chat-header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ai-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.chat-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.user-message .message-content {
    background: var(--primary-color);
    color: white;
}

.ai-message .message-content {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    background: var(--hover-color);
}

.user-message .message-avatar {
    background: var(--primary-color);
}

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.4;
}

.message-content p {
    margin: 0 0 8px 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content strong {
    color: var(--primary-color);
}

.message-content code {
    background: rgba(0,0,0,0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.suggested-questions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.suggested-questions p {
    margin-bottom: 8px !important;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.suggestion-btn {
    display: inline-block;
    margin: 4px 8px 4px 0;
    padding: 6px 12px;
    background: var(--hover-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-main);
}

.suggestion-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

.chat-input-container {
    border-top: 1px solid var(--border-color);
    padding: 16px 20px;
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

#chat-input {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    resize: none;
    background: var(--card-bg);
    color: var(--text-main);
    transition: border-color 0.2s ease;
    line-height: 1.4;
}

#chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

#chat-input::placeholder {
    color: var(--text-secondary);
}

.send-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.send-btn:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.5;
}

.send-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.error-response {
    color: var(--error-color) !important;
}

@media (max-width: 768px) {
    .modal-chat {
        width: 98%;
        height: 85vh;
    }
    
    .message {
        max-width: 95%;
    }
    
    .chat-messages {
        padding: 15px;
    }
    
    .chat-input-container {
        padding: 12px 15px;
    }
}

.manual-total-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.4;
}

.manual-total-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.5);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .manual-total-input-wrapper {
    background: rgba(0, 0, 0, 0.2);
}

.manual-total-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 200, 83, 0.2);
    transform: translateY(-1px);
}

.manual-total-input-wrapper .currency-symbol {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-right: 0.5rem;
    font-weight: 600;
}

#manual-total-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1.2rem;
    color: var(--text-main);
    font-family: var(--font-family);
    font-weight: 500;
    outline: none;
    -moz-appearance: textfield;
}

#manual-total-input::-webkit-outer-spin-button,
#manual-total-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#manual-total-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-family);
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 200, 83, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}

[data-theme="dark"] .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Install Prompt */
.install-prompt {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    border: 1px solid rgba(0, 0, 0, 0.05);
    animation: slideUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

[data-theme="dark"] .install-prompt {
    background: rgba(30, 30, 30, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
}

.install-prompt.show {
    display: block;
}

.install-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.install-icon img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
}

.install-text {
    flex: 1;
}

.install-text h3 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
    color: var(--text-main);
}

.install-text p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.install-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 200, 83, 0.3);
}

.close-install-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1rem;
    transition: var(--transition);
}

.close-install-btn:hover {
    color: #ff5252;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.app-version {
    position: absolute;
    bottom: 0.75rem;
    right: 1rem;
    font-size: 0.65rem;
    color: var(--text-secondary);
    opacity: 0.4;
    font-weight: 500;
    user-select: none;
    transition: var(--transition);
}

.app-version:hover {
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 480px) {
    .app-container {
        margin: 0;
        height: 100vh;
        border-radius: 0;
        max-width: 100%;
        padding: 1.5rem;
        padding-bottom: 3rem;
        overflow: hidden;
    }

    .list-section {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .shopping-list {
        flex: 1;
        max-height: calc(100vh - 280px);
        overflow-y: auto;
    }

    .app-version {
        position: fixed;
        bottom: 1rem;
        right: 1rem;
        z-index: 100;
    }

    .search-container.expanded #search-input {
        width: 160px;
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}