/* CSS Variables - Design System */
:root {
    --primary-color: #FF6F61;
    --secondary-color: #483D8B;
    --accent-color: #FFD700;
    --background: #F5F5F5;
    --surface: #FFFFFF;
    --text-primary: #212121;
    --text-secondary: #757575;
    --divider: #E0E0E0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 12px;
    --app-bar-height: 56px;
    --bottom-nav-height: 64px;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: pan-y;
    user-select: none;
}

/* App Container */
.app-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    max-width: 480px;
    margin: 0 auto;
    background: var(--background);
    overflow: hidden;
}

/* App Bar */
.app-bar {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: var(--app-bar-height);
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    box-shadow: var(--shadow-md);
    z-index: 100;
}

.app-bar-title {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 0.15px;
}

.app-bar-action {
    position: absolute;
    right: 16px;
    background: transparent;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition);
}

.app-bar-action:active {
    background: rgba(255, 255, 255, 0.2);
}

/* Content Area */
.content-area {
    flex: 1;
    margin-top: var(--app-bar-height);
    margin-bottom: var(--bottom-nav-height);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

/* Screens */
.screen {
    display: none;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity var(--transition), transform var(--transition);
    min-height: calc(100vh - var(--app-bar-height) - var(--bottom-nav-height));
}

.screen.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

.screen-content {
    padding: 16px;
    padding-bottom: 32px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform var(--transition);
}

.stat-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Section Header */
.section-header {
    margin: 24px 0 12px;
}

.section-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 0.15px;
}

/* Recipe List */
.recipe-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recipe-card {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: box-shadow var(--transition), transform var(--transition);
    position: relative;
    overflow: hidden;
}

.recipe-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.recipe-card:active::before {
    opacity: 1;
}

.recipe-card:active {
    transform: scale(0.98);
}

.recipe-avatar {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.recipe-info {
    flex: 1;
    min-width: 0;
}

.recipe-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recipe-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

.recipe-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.recipe-favorite {
    margin-left: auto;
    flex-shrink: 0;
}

.favorite-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-color);
    fill: var(--accent-color);
}

.favorite-icon-outline {
    fill: none;
    stroke: var(--text-secondary);
}

.recipe-chevron {
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Search Bar */
.search-bar {
    position: relative;
    margin-bottom: 16px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: 48px;
    background: var(--surface);
    border: none;
    border-radius: var(--border-radius);
    padding: 0 16px 0 48px;
    font-size: 16px;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}

.search-input:focus {
    outline: none;
    box-shadow: var(--shadow-md);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

/* Trends List */
.trends-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.trend-card {
    background: var(--surface);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: box-shadow var(--transition), transform var(--transition);
}

.trend-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-md);
}

.trend-image {
    width: 100%;
    height: 120px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trend-icon {
    font-size: 56px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.trend-content {
    padding: 16px;
}

.trend-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.trend-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Chefs List */
.chefs-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 24px;
    -webkit-overflow-scrolling: touch;
}

.chefs-list::-webkit-scrollbar {
    display: none;
}

.chef-card {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 16px;
    text-align: center;
    min-width: 120px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: box-shadow var(--transition), transform var(--transition);
}

.chef-card:active {
    transform: scale(0.95);
    box-shadow: var(--shadow-md);
}

.chef-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chef-initial {
    font-size: 20px;
    font-weight: 700;
    color: white;
}

.chef-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.chef-specialty {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.category-card {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 20px 12px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: box-shadow var(--transition), transform var(--transition);
}

.category-card:active {
    transform: scale(0.95);
    box-shadow: var(--shadow-md);
}

.category-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.category-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Shopping List */
.shopping-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.shopping-item {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}

.shopping-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--text-secondary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

.shopping-checkbox.checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.shopping-checkbox svg {
    color: white;
}

.shopping-text {
    flex: 1;
    font-size: 15px;
    color: var(--text-primary);
}

.shopping-text.checked {
    text-decoration: line-through;
    color: var(--text-secondary);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: var(--bottom-nav-height);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: transparent;
    border: none;
    padding: 8px 12px;
    min-width: 64px;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 0 0 3px 3px;
    transition: width var(--transition);
}

.nav-item.active::before {
    width: 32px;
}

.nav-icon {
    color: var(--text-secondary);
    transition: color var(--transition), transform var(--transition);
}

.nav-item.active .nav-icon {
    color: var(--primary-color);
    transform: scale(1.1);
}

.nav-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition);
}

.nav-item.active .nav-label {
    color: var(--primary-color);
}

.nav-item:active {
    transform: scale(0.95);
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 16px);
    right: max(16px, calc(50% - 240px + 16px));
    width: 56px;
    height: 56px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 99;
    transition: all var(--transition);
}

.fab:hover {
    box-shadow: var(--shadow-xl);
    transform: scale(1.05);
}

.fab:active {
    transform: scale(0.95);
}

.fab.hidden {
    transform: scale(0);
    opacity: 0;
}

/* Bottom Sheet */
.bottom-sheet {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition);
}

.bottom-sheet.active {
    pointer-events: all;
    opacity: 1;
}

.bottom-sheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity var(--transition);
}

.bottom-sheet.active .bottom-sheet-overlay {
    opacity: 1;
}

.bottom-sheet-content {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 100%);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    background: var(--surface);
    border-radius: 24px 24px 0 0;
    overflow-y: auto;
    transition: transform var(--transition);
}

.bottom-sheet.active .bottom-sheet-content {
    transform: translate(-50%, 0);
}

.bottom-sheet-header {
    position: sticky;
    top: 0;
    background: var(--surface);
    padding: 20px 16px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--divider);
    z-index: 1;
}

.bottom-sheet-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background var(--transition);
}

.icon-btn:active {
    background: var(--background);
}

/* Recipe Form */
.recipe-form {
    padding: 24px 16px;
}

.form-group {
    position: relative;
    margin-bottom: 24px;
}

.form-input {
    width: 100%;
    padding: 16px 12px 8px;
    font-size: 16px;
    color: var(--text-primary);
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--divider);
    border-radius: 4px 4px 0 0;
    transition: border-color var(--transition), background var(--transition);
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-bottom-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.02);
}

.form-label {
    position: absolute;
    left: 12px;
    top: 16px;
    font-size: 16px;
    color: var(--text-secondary);
    pointer-events: none;
    transition: all var(--transition);
}

.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label {
    top: 4px;
    font-size: 12px;
    color: var(--primary-color);
}

.form-textarea {
    resize: vertical;
    min-height: 60px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    cursor: pointer;
}

.checkbox-input {
    display: none;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: var(--text-primary);
    cursor: pointer;
}

.checkbox-icon {
    width: 24px;
    height: 24px;
    padding: 2px;
    border: 2px solid var(--text-secondary);
    border-radius: 6px;
    color: transparent;
    transition: all var(--transition);
}

.checkbox-input:checked + .checkbox-label .checkbox-icon {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    fill: white;
}

/* Buttons */
.primary-btn,
.secondary-btn {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition);
}

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

.primary-btn:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-sm);
}

.secondary-btn {
    background: var(--surface);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.secondary-btn:active {
    transform: scale(0.98);
    background: rgba(255, 111, 97, 0.05);
}

/* Recipe Detail Content */
.recipe-detail-content {
    padding: 24px 16px;
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-section-title svg {
    color: var(--primary-color);
}

.detail-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* AI Detail Sheet */
.ai-detail-body {
    padding: 24px 16px;
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.6;
    max-height: 60vh;
    overflow-y: auto;
}

.ai-detail-body.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.ai-detail-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
}

.ai-detail-loading .typing-indicator {
    display: flex;
    gap: 6px;
}

.ai-detail-loading .typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: typing 1.4s infinite;
}

.ai-detail-loading .typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-detail-loading .typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

.detail-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--background);
    border-radius: 16px;
    font-size: 14px;
    color: var(--text-primary);
}

.chip svg {
    width: 16px;
    height: 16px;
    color: var(--primary-color);
}

/* Dialog */
.dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition);
}

.dialog.active {
    pointer-events: all;
    opacity: 1;
}

.dialog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.dialog-content {
    position: relative;
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 24px;
    margin: 0 24px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    transform: scale(0.9);
    transition: transform var(--transition);
}

.dialog.active .dialog-content {
    transform: scale(1);
}

.dialog-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.dialog-message {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
}

.dialog-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.dialog-btn {
    padding: 10px 24px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: var(--primary-color);
    cursor: pointer;
    transition: background var(--transition);
}

.dialog-btn:active {
    background: rgba(255, 111, 97, 0.1);
}

.dialog-btn-danger {
    color: #D32F2F;
}

.dialog-btn-danger:active {
    background: rgba(211, 47, 47, 0.1);
}

/* Loading State */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Responsive */
@media (max-width: 360px) {
    .stat-value {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .recipe-avatar {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .fab {
        width: 48px;
        height: 48px;
    }
    
    .fab svg {
        width: 24px;
        height: 24px;
    }
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* AI Chat tab: fixed input above bottom nav */
.chat-input-bar {
    display: none;
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: var(--bottom-nav-height);
    width: 100%;
    max-width: 480px;
    background: var(--surface);
    padding: 12px 16px;
    border-top: 1px solid var(--divider);
    gap: 8px;
    align-items: center;
    z-index: 99;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
}

.chat-input-bar.visible {
    display: flex;
}

.chat-input-bar .chat-input {
    flex: 1;
    height: 44px;
    background: var(--background);
    border: none;
    border-radius: 22px;
    padding: 0 16px;
    font-size: 15px;
    color: var(--text-primary);
    font-family: inherit;
}

.chat-input-bar .chat-input:focus {
    outline: none;
    background: #E8E8E8;
}

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

.chat-input-bar .send-btn:active {
    transform: scale(0.95);
}

.chat-input-bar .send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* AI Chat screen content */
#aiChatScreen {
    display: none;
    flex-direction: column;
    min-height: calc(100vh - var(--app-bar-height) - var(--bottom-nav-height));
}

#aiChatScreen.active {
    display: flex;
}

#aiChatScreen .chat-actions {
    flex-shrink: 0;
    padding: 12px 16px;
    border-bottom: 1px solid var(--divider);
    background: var(--surface);
}

#aiChatScreen .chat-messages-wrap {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 80px;
}

#aiChatScreen .chat-messages {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#aiChatScreen .clear-chat-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: var(--border-radius);
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 10px 16px;
    font-family: inherit;
    transition: background var(--transition), color var(--transition);
}

#aiChatScreen .clear-chat-btn:active {
    background: var(--background);
    color: var(--primary-color);
}

.chat-message {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.chat-message.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
}

.message-bubble {
    max-width: 75%;
    background: var(--surface);
    border-radius: 16px;
    padding: 12px 16px;
    box-shadow: var(--shadow-sm);
}

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

.message-text {
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    word-wrap: break-word;
}

.user-message .message-text {
    color: white;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: typing 1.4s infinite;
}

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

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

/* Meal Planner Styles */
.planner-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.planner-actions .secondary-btn {
    flex: 1;
}

.clear-planner-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: var(--border-radius);
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0 16px;
    height: 48px;
    font-family: inherit;
    transition: background var(--transition), color var(--transition);
}

.clear-planner-btn:active {
    background: var(--background);
    color: var(--primary-color);
}

.clear-planner-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.meal-plan-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.meal-plan-day {
    background: var(--surface);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.meal-day-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.meal-day-title {
    font-size: 16px;
    font-weight: 500;
}

.meal-day-date {
    font-size: 13px;
    opacity: 0.9;
}

.meal-slots {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meal-slot {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--background);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition);
}

.meal-slot:active {
    transform: scale(0.98);
}

.meal-slot-icon {
    font-size: 28px;
}

.meal-slot-info {
    flex: 1;
}

.meal-slot-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meal-slot-recipe {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-top: 2px;
}

.meal-slot-empty {
    font-size: 14px;
    color: var(--text-secondary);
    font-style: italic;
}

.meal-slot-action {
    color: var(--primary-color);
}

/* Scrollbar Styling */
.content-area::-webkit-scrollbar,
.bottom-sheet-content::-webkit-scrollbar {
    width: 4px;
}

.content-area::-webkit-scrollbar-track,
.bottom-sheet-content::-webkit-scrollbar-track {
    background: transparent;
}

.content-area::-webkit-scrollbar-thumb,
.bottom-sheet-content::-webkit-scrollbar-thumb {
    background: var(--divider);
    border-radius: 2px;
}
