/* CSS Variables for Theme */
:root {
    --primary: #FF5733;
    --secondary: #C70039;
    --accent: #900C3F;
    --background: #F5F5F5;
    --surface: #FFFFFF;
    --on-primary: #FFFFFF;
    --on-surface: #212121;
    --text-secondary: #757575;
    --divider: #E0E0E0;
    --elevation-1: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --elevation-2: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
    --elevation-3: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
    --elevation-4: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
}

/* 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(--on-surface);
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    background: var(--background);
    position: relative;
}

/* Top App Bar */
.app-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    height: 56px;
    background: var(--primary);
    color: var(--on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    box-shadow: var(--elevation-2);
    z-index: 100;
}

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

.app-bar-action {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: var(--on-primary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

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

/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 56px;
    margin-bottom: 64px;
    padding-bottom: 80px;
    -webkit-overflow-scrolling: touch;
}

/* Screen Management */
.screen {
    display: none;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

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

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

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

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

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

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--on-surface);
    line-height: 1;
}

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

/* Section Header */
.section-header {
    padding: 20px 16px 12px;
}

.section-header-with-ai {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header-with-ai .section-title {
    margin-bottom: 0;
}

.section-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-add-idea {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--elevation-1);
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 44px;
}

.btn-add-idea:active {
    transform: scale(0.96);
}

/* AI Insight Button */
.ai-insight-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--elevation-1);
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 44px;
}

.ai-insight-btn:active {
    transform: scale(0.96);
    box-shadow: var(--elevation-2);
}

.ai-insight-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.ai-insight-btn-inline {
    margin-top: 16px;
}

/* AI Insight Sheet */
.ai-insight-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px 16px;
}

.ai-insight-loading .typing-dot {
    width: 10px;
    height: 10px;
    background: var(--primary);
}

.ai-insight-loading p {
    margin-left: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.ai-insight-content {
    font-size: 16px;
    line-height: 1.6;
    color: var(--on-surface);
    padding: 8px 0 24px;
    white-space: pre-wrap;
}

.ai-insight-content.hidden {
    display: none;
}

.idea-detail-content {
    padding-bottom: 16px;
}

.idea-detail-actions {
    margin-bottom: 16px;
}

.material-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.material-detail-icon {
    font-size: 48px;
    line-height: 1;
}

.material-detail-header .bottom-sheet-title {
    margin-bottom: 0;
}

.ai-insight-loading.hidden {
    display: none;
}

.section-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--on-surface);
}

/* Projects List */
.projects-list {
    padding: 0 16px 16px;
}

.project-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--elevation-1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.project-card:active {
    transform: scale(0.98);
    box-shadow: var(--elevation-2);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.project-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--on-surface);
    margin-bottom: 4px;
}

.project-date {
    font-size: 13px;
    color: var(--text-secondary);
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(255, 87, 51, 0.1);
    color: var(--primary);
}

.status-badge.completed {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.project-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.project-footer {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

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

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

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

.empty-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 280px;
}

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

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

.search-bar input {
    width: 100%;
    height: 48px;
    padding: 0 48px;
    border: none;
    border-radius: 24px;
    background: var(--surface);
    font-size: 16px;
    box-shadow: var(--elevation-1);
    transition: box-shadow 0.2s;
}

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

.clear-search {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Filter Chips */
.filter-chips {
    display: flex;
    gap: 8px;
    padding: 0 16px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.chip {
    padding: 8px 16px;
    border: 1px solid var(--divider);
    border-radius: 16px;
    background: var(--surface);
    color: var(--on-surface);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.chip.active {
    background: var(--primary);
    color: var(--on-primary);
    border-color: var(--primary);
}

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

/* Inspiration Grid */
.inspiration-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
}

.inspiration-card {
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--elevation-1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.inspiration-card:active {
    transform: scale(0.98);
    box-shadow: var(--elevation-2);
}

.inspiration-image {
    width: 100%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inspiration-image .card-icon {
    font-size: 64px;
    opacity: 0.95;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.2));
}

.inspiration-content {
    padding: 16px;
}

.inspiration-content h3 {
    font-size: 16px;
    font-weight: 500;
    color: var(--on-surface);
    margin-bottom: 4px;
}

.inspiration-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Materials Screen */
.materials-list {
    padding: 0 16px 16px;
}

.material-category {
    background: var(--surface);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: var(--elevation-1);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--on-primary);
}

.category-icon {
    font-size: 28px;
}

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

.material-items {
    padding: 8px 0;
}

.material-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--divider);
    cursor: pointer;
    transition: background 0.2s;
}

.material-item:active {
    background: rgba(0, 0, 0, 0.04);
}

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

.material-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.material-name {
    font-size: 15px;
    color: var(--on-surface);
}

.material-detail {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    height: 64px;
    background: var(--surface);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 12px;
    transition: color 0.2s;
    min-height: 44px;
}

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

.nav-icon {
    width: 24px;
    height: 24px;
}

.nav-label {
    font-size: 12px;
    font-weight: 500;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 80px;
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--on-primary);
    border: none;
    box-shadow: var(--elevation-3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 90;
}

.fab:active {
    transform: scale(0.9);
    box-shadow: var(--elevation-2);
}

.fab.hidden {
    display: none;
}

/* Bottom Sheet */
.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 200;
}

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

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    background: var(--surface);
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 201;
    max-height: 90vh;
    overflow-y: auto;
}

.bottom-sheet.active {
    transform: translateY(0);
}

.bottom-sheet-handle {
    width: 32px;
    height: 4px;
    background: var(--divider);
    border-radius: 2px;
    margin: 12px auto;
}

.bottom-sheet-content {
    padding: 0 24px 24px;
}

.bottom-sheet-title {
    font-size: 24px;
    font-weight: 500;
    color: var(--on-surface);
    margin-bottom: 24px;
}

/* Detail Sheet */
.detail-sheet {
    max-height: 85vh;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.detail-title {
    font-size: 24px;
    font-weight: 500;
    color: var(--on-surface);
    flex: 1;
}

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

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.04);
    border: none;
    color: var(--on-surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.icon-btn:active {
    background: rgba(0, 0, 0, 0.12);
}

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

.detail-status .detail-label {
    display: block;
    margin-bottom: 8px;
}

.detail-status-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.detail-status-row .status-badge {
    margin-bottom: 0;
}

.status-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.status-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.status-toggle-slider {
    position: relative;
    width: 48px;
    height: 26px;
    background: var(--divider);
    border-radius: 26px;
    transition: background 0.2s;
}

.status-toggle-slider::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 2px;
    top: 2px;
    background: white;
    border-radius: 50%;
    box-shadow: var(--elevation-1);
    transition: transform 0.2s;
}

.status-toggle-input:checked + .status-toggle-slider {
    background: #4CAF50;
}

.status-toggle-input:checked + .status-toggle-slider::after {
    transform: translateX(22px);
}

.status-toggle-text {
    font-size: 14px;
    color: var(--text-secondary);
}

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

.detail-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.detail-value {
    font-size: 16px;
    color: var(--on-surface);
    line-height: 1.5;
}

/* Form Styles */
.form-group {
    position: relative;
    margin-bottom: 24px;
}

.form-input {
    width: 100%;
    padding: 16px 12px 8px;
    border: 1px solid var(--divider);
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    background: var(--surface);
    color: var(--on-surface);
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label,
.form-input:valid + .form-label {
    transform: translateY(-22px) scale(0.85);
    color: var(--primary);
}

.form-label {
    position: absolute;
    left: 12px;
    top: 16px;
    color: var(--text-secondary);
    font-size: 16px;
    pointer-events: none;
    transition: all 0.2s;
    transform-origin: left top;
    background: var(--surface);
    padding: 0 4px;
}

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

.checkbox-group {
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.form-checkbox {
    position: absolute;
    opacity: 0;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-secondary);
    border-radius: 4px;
    position: relative;
    transition: all 0.2s;
}

.form-checkbox:checked + .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.form-checkbox:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text {
    font-size: 16px;
    color: var(--on-surface);
}

.form-label-standalone {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.idea-icon-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.idea-icon-option {
    width: 44px;
    height: 44px;
    border: 2px solid var(--divider);
    border-radius: 12px;
    background: var(--surface);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s;
}

.idea-icon-option:hover,
.idea-icon-option:active {
    background: rgba(255, 87, 51, 0.08);
}

.idea-icon-option.selected {
    border-color: var(--primary);
    background: rgba(255, 87, 51, 0.12);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    flex: 1;
    background: var(--primary);
    color: var(--on-primary);
    box-shadow: var(--elevation-2);
}

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

.btn-danger {
    flex: 1;
    background: #F44336;
    color: white;
    box-shadow: var(--elevation-2);
}

.btn-full {
    width: 100%;
}

/* Dialog */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 300;
}

.dialog-overlay.active {
    opacity: 1;
    visibility: visible;
}

.dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    max-width: 320px;
    width: 90%;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 301;
}

.dialog.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

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

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

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

/* Snackbar */
.snackbar {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #323232;
    color: white;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: var(--elevation-3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 400;
    max-width: 90%;
}

.snackbar.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 200px;
    height: 200px;
}

/* Loading Skeleton */
.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 adjustments */
@media (min-width: 480px) {
    .app-container {
        box-shadow: var(--elevation-2);
    }
}

/* Hide scrollbar but keep functionality */
.content-area::-webkit-scrollbar {
    width: 0;
    display: none;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Prevent pull-to-refresh */
body {
    overscroll-behavior-y: contain;
}

/* ============================================
   AI CHAT SCREEN STYLES
   ============================================ */

.ai-chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    position: relative;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.chat-welcome h3 {
    font-size: 22px;
    font-weight: 500;
    color: var(--on-surface);
    margin-bottom: 8px;
}

.chat-welcome p {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 280px;
    line-height: 1.5;
}

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 20px;
}

.suggestion-chip {
    padding: 10px 16px;
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: 20px;
    font-size: 13px;
    color: var(--on-surface);
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-chip:active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Chat Bubbles */
.chat-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.5;
    animation: bubbleIn 0.3s ease;
}

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

.chat-bubble.user {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-bubble.ai {
    background: var(--surface);
    color: var(--on-surface);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: var(--elevation-1);
}

.chat-bubble.ai.typing {
    display: flex;
    gap: 4px;
    padding: 16px 20px;
}

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

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

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

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

.chat-bubble.error {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #FFCDD2;
}

/* Chat Input */
.chat-input-container {
    padding: 12px 16px 16px;
    background: var(--background);
    border-top: 1px solid var(--divider);
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: var(--surface);
    border-radius: 24px;
    padding: 8px 8px 8px 16px;
    box-shadow: var(--elevation-1);
}

.chat-input-wrapper textarea {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    resize: none;
    max-height: 120px;
    line-height: 1.4;
    padding: 8px 0;
    color: var(--on-surface);
}

.chat-input-wrapper textarea:focus {
    outline: none;
}

.chat-input-wrapper textarea::placeholder {
    color: var(--text-secondary);
}

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

.send-btn:disabled {
    background: var(--divider);
    cursor: not-allowed;
}

.send-btn:not(:disabled):active {
    transform: scale(0.9);
}

/* ============================================
   PROGRESS TRACKER SCREEN STYLES
   ============================================ */

.progress-overview {
    display: flex;
    justify-content: center;
    padding: 24px 16px;
}

.progress-ring-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-bg {
    stroke: var(--divider);
}

.progress-ring-fill {
    stroke: var(--primary);
    stroke-linecap: round;
    stroke-dasharray: 440;
    stroke-dashoffset: 440;
    transition: stroke-dashoffset 1s ease;
}

.progress-ring-text {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.progress-percentage {
    font-size: 36px;
    font-weight: 700;
    color: var(--on-surface);
}

.progress-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Milestones */
.milestones-list {
    padding: 0 16px 16px;
}

.milestone-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--surface);
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: var(--elevation-1);
}

.milestone-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--divider);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.milestone-item.completed .milestone-check {
    background: #4CAF50;
    border-color: #4CAF50;
}

.milestone-check svg {
    opacity: 0;
    transition: opacity 0.2s;
}

.milestone-item.completed .milestone-check svg {
    opacity: 1;
}

.milestone-info {
    flex: 1;
}

.milestone-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--on-surface);
    margin-bottom: 4px;
}

.milestone-date {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Activity Chart */
.activity-chart {
    padding: 0 16px 16px;
}

.chart-bars {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 140px;
    padding: 16px;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--elevation-1);
}

.chart-bar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    height: 100%;
}

.chart-bar {
    width: 24px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 6px 6px 0 0;
    margin-top: auto;
    min-height: 8px;
    transition: height 0.5s ease;
}

.chart-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Achievements Grid */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 16px 24px;
}

.achievement-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--elevation-1);
    opacity: 0.5;
    filter: grayscale(1);
    transition: all 0.3s;
}

.achievement-card.unlocked {
    opacity: 1;
    filter: grayscale(0);
}

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

.achievement-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--on-surface);
    text-align: center;
}

/* API Key Dialog */
.api-key-dialog {
    max-width: 340px;
}

.api-key-dialog .form-group {
    margin-bottom: 0;
}

/* Bottom nav adjustments for 6 items */
.nav-item {
    padding: 8px 4px;
}

.nav-label {
    font-size: 10px;
}

.nav-icon {
    width: 22px;
    height: 22px;
}
