/* ==========================================
   Cheslyn — SmartLife AI Diary & Assistant
   Mobile-First CSS with Dark Mode
   ========================================== */

/* CSS Variables */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-hover: #f8fafc;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --text-inverse: #ffffff;
    
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --header-height: 70px;
    --nav-height: 70px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    
    --border: #334155;
    --border-light: #1e293b;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    color: white;
}

.logo-pulse {
    font-size: 48px;
    margin-bottom: 16px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.loading-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.loading-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 24px;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto;
}

.loading-progress {
    width: 0%;
    height: 100%;
    background: white;
    border-radius: 4px;
    animation: progress 2s ease forwards;
}

@keyframes progress {
    to { width: 100%; }
}

/* App Container */
.app {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-primary);
    position: relative;
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom));
}

.app.hidden {
    display: none;
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-light);
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 80px;
}

.header-right {
    justify-content: flex-end;
}

.header-center {
    text-align: center;
    flex: 1;
}

.app-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
}

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

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    font-size: 16px;
}

.icon-btn:active {
    transform: scale(0.95);
    background: var(--bg-hover);
}

.icon-btn.has-badge .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Main Content */
.main-content {
    padding: 16px;
    min-height: calc(100vh - var(--header-height) - var(--nav-height));
}

/* Views */
.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

/* AI Summary Card */
.ai-summary-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
}

.ai-avatar {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.ai-content {
    flex: 1;
}

.ai-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.ai-content p {
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.4;
}

.voice-btn-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 8px;
}

.stat-icon.blue { background: #eff6ff; color: var(--info); }
.stat-icon.orange { background: #fff7ed; color: var(--warning); }
.stat-icon.green { background: #ecfdf5; color: var(--success); }
[data-theme="dark"] .stat-icon.blue { background: #1e3a5f; }
[data-theme="dark"] .stat-icon.orange { background: #451a03; }
[data-theme="dark"] .stat-icon.green { background: #064e3b; }

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
}

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

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    margin-top: 20px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.see-all {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

/* Timeline */
.timeline {
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-left: 44px;
    padding-bottom: 16px;
}

.timeline-dot {
    position: absolute;
    left: 12px;
    top: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 3px solid var(--primary);
    z-index: 2;
}

.timeline-dot.completed {
    border-color: var(--success);
    background: var(--success);
}

.timeline-dot.completed::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    border: 2px solid white;
}

.timeline-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.timeline-time {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 4px;
}

.timeline-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.timeline-meta {
    display: flex;
    gap: 8px;
    align-items: center;
}

.priority-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.priority-high { background: #fef2f2; color: var(--danger); }
.priority-medium { background: #fffbeb; color: var(--warning); }
.priority-low { background: #f0fdf4; color: var(--success); }
[data-theme="dark"] .priority-high { background: #450a0a; }
[data-theme="dark"] .priority-medium { background: #451a03; }
[data-theme="dark"] .priority-low { background: #064e3b; }

.category-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Task List */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-item {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all 0.2s;
}

.task-item:active {
    transform: scale(0.98);
}

.task-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.2s;
}

.task-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.task-details {
    flex: 1;
}

.task-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.task-title.completed {
    text-decoration: line-through;
    color: var(--text-tertiary);
}

.task-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.task-time {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 16px;
}

/* Insights Card */
.insights-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.insight-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.insight-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.insight-item:first-child {
    padding-top: 0;
}

.insight-item i {
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 16px;
    flex-shrink: 0;
}

.insight-text {
    flex: 1;
}

.insight-title {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.insight-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    height: calc(var(--nav-height) + var(--safe-bottom));
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: space-around;
    border-top: 1px solid var(--border-light);
    padding-bottom: var(--safe-bottom);
    z-index: 100;
}

.nav-btn {
    flex: 1;
    height: var(--nav-height);
    border: none;
    background: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: all 0.2s;
    font-size: 20px;
}

.nav-btn span {
    font-size: 11px;
    font-weight: 500;
}

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

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

/* Floating Voice Button */
.voice-assistant-btn {
    position: fixed;
    right: 20px;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    z-index: 99;
    transition: all 0.3s;
}

.voice-assistant-btn:active {
    transform: scale(0.95);
}

.voice-assistant-btn.listening {
    background: var(--danger);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.voice-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    opacity: 0;
    animation: voicePulse 2s infinite;
    display: none;
}

.voice-assistant-btn.listening .voice-pulse {
    display: block;
}

@keyframes voicePulse {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.3); opacity: 0; }
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: flex-end;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    animation: fadeIn 0.2s;
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 10;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.modal-form {
    padding: 20px;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

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

.form-group.half {
    flex: 1;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input {
    width: auto !important;
}

/* Mood Selector */
.mood-selector {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.mood-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 4px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.mood-btn i {
    font-size: 24px;
}

.mood-btn span {
    font-size: 11px;
}

.mood-btn.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-primary:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-secondary:active {
    transform: scale(0.98);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.form-actions button {
    flex: 1;
}

/* Voice Modal */
.voice-modal-content {
    text-align: center;
    padding: 40px 20px;
}

.voice-visualizer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 80px;
    margin-bottom: 24px;
}

.voice-wave {
    width: 6px;
    height: 20px;
    background: var(--primary);
    border-radius: 4px;
    animation: wave 1s ease infinite;
}

.voice-wave:nth-child(2) { animation-delay: 0.1s; }
.voice-wave:nth-child(3) { animation-delay: 0.2s; }
.voice-wave:nth-child(4) { animation-delay: 0.3s; }
.voice-wave:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
    0%, 100% { height: 20px; }
    50% { height: 60px; }
}

.voice-status {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.voice-transcript {
    font-size: 18px;
    color: var(--text-primary);
    min-height: 60px;
    margin-bottom: 32px;
    font-weight: 500;
}

.voice-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.voice-action-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.2s;
}

.voice-action-btn.mic {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    width: 72px;
    height: 72px;
    font-size: 32px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.voice-action-btn.mic.listening {
    background: var(--danger);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    animation: pulse 1s infinite;
}

.voice-action-btn.cancel {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.voice-action-btn.confirm {
    background: var(--success);
    color: white;
}

/* AI Response Modal */
.ai-response-content {
    padding: 0;
}

.ai-response-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.ai-response-header i {
    font-size: 28px;
}

.ai-response-header h3 {
    font-size: 20px;
    font-weight: 700;
}

.ai-response-body {
    padding: 20px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    max-height: 50vh;
    overflow-y: auto;
}

.ai-response-actions {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
}

/* Toast */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    width: 90%;
    max-width: 400px;
    pointer-events: none;
}

.toast {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    animation: toastIn 0.3s ease;
    pointer-events: auto;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--info); }

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

/* View Headers */
.view-header {
    margin-bottom: 16px;
}

.view-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 8px;
}

.tab-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

.search-bar i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.search-bar input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
}

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

/* Date Navigation */
.date-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    background: var(--bg-card);
    padding: 10px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.date-nav button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.date-nav span {
    font-size: 14px;
    font-weight: 600;
    min-width: 80px;
    text-align: center;
}

/* Diary */
.diary-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.diary-item {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.diary-date {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.diary-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.diary-preview {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.diary-mood {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    margin-top: 10px;
}

/* Insights Dashboard */
.insights-dashboard {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chart-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.chart-container h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.chart-container canvas {
    max-height: 200px;
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

/* Selection */
::selection {
    background: var(--primary-light);
    color: white;
}

/* Responsive */
@media (min-width: 431px) {
    body {
        background: #e2e8f0;
    }
    
    .app {
        border-radius: 0;
        min-height: 100vh;
    }
}
