:root {
    /* Colors */
    --color-text-primary: #1a1a1a;
    --color-text-secondary: #6b7280;
    --color-background: #ffffff;
    --color-border: #e5e7eb;
    --color-primary: #374151;
    --color-primary-dark: #1f2937;
    --color-error: #e53e3e;
    --color-success: #38a169;
    
    /* Typography */
    --font-serif: 'Crimson Pro', Georgia, serif;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.05);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* New root variables for consistent styling */
    --primary-color: #1a8917;
    --text-color: #242424;
    --light-text: #6B6B6B;
    --border-color: #E6E6E6;
    --background-light: #FAFAFA;
}

/* Top Navigation Bar */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--color-background);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav-brand {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--color-text-primary);
    text-decoration: none;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--color-text-primary);
    background: rgba(0, 0, 0, 0.04);
}

.nav-link.active {
    color: var(--color-text-primary);
    background: rgba(0, 0, 0, 0.05);
}

.nav-link svg {
    width: 16px;
    height: 16px;
    stroke-width: 2px;
}

/* Adjust main container to account for fixed nav */
.app-container {
    padding-top: 60px;
    height: calc(100vh - 60px);
    display: flex;
}

/* Mobile styles */
@media screen and (max-width: 768px) {
    .top-nav {
        padding: 0 1rem;
    }

    .nav-brand {
        font-size: 1.25rem;
    }

    .nav-link span {
        display: none;
    }

    .nav-link {
        padding: 0.5rem;
    }

    .nav-links {
        gap: 0.25rem;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background-color: var(--color-background);
    color: var(--color-text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Top Navigation */
.top-nav, .nav-content, .nav-brand, .user-info, .user-details, .logout-btn {
    display: none;
}

/* Buttons */
.new-entry-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    background: white;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.new-entry-btn:hover {
    background: var(--color-background);
    color: var(--color-text-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Entries Sidebar */
.entries-sidebar {
    width: 320px;
    background: var(--color-background);
    border-radius: 0;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--color-border);
    border-left: none;
    border-top: none;
    border-bottom: none;
    height: 100vh;
    position: sticky;
    top: 0;
}

.sidebar-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--color-background);
    position: sticky;
    top: 0;
    z-index: 2;
}

.view-toggle {
    display: none;
    gap: var(--spacing-xs);
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    background: white;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-toggle-btn:hover {
    color: var(--color-text-primary);
    background: var(--color-background);
}

.view-toggle-btn.active {
    background: var(--color-background);
    color: var(--color-text-primary);
    border-color: var(--color-text-primary);
}

/* Search container */
.search-container {
    position: relative;
    width: 32px;
    height: 32px;
    transition: all 0.3s ease;
}

.search-container:focus-within {
    width: 160px;
}

/* Remove duplicate search styles */
.sidebar-actions {
    display: none;
}

/* Views */
.entries-view, .calendar-view {
    display: none;
    height: 100%;
}

.entries-view.active, .calendar-view.active {
    display: block;
}

/* Calendar adjustments */
.calendar-view {
    background: white;
    border-radius: 0;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    padding: var(--spacing-md);
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
    padding: 0 var(--spacing-sm);
}

.current-month {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-primary);
    letter-spacing: 0.02em;
}

.calendar-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    background: white;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
    color: var(--color-text-primary);
    background: var(--color-background);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: var(--spacing-sm);
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    border-radius: 0;
    position: relative;
    padding: 4px;
    cursor: default;
    transition: all 0.2s ease;
}

.calendar-day.day-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding-bottom: var(--spacing-xs);
    aspect-ratio: auto;
}

.calendar-day.has-entry {
    position: relative;
    background: #f0fff4;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-day.has-entry:hover {
    background: #dcfce7;
    transform: translateY(-1px);
}

.calendar-day.today {
    font-weight: 600;
    color: var(--color-text-primary);
    background: var(--color-background);
    border: 2px solid #2f855a;
}

.calendar-day.other-month {
    opacity: 0.3;
}

/* Journal container */
.journal-container {
    flex: 1;
    max-width: 44rem;
    background-color: var(--color-background);
    padding: var(--spacing-xl);
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    border: none;
    margin: 0 auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding-left: 2.5rem;
}

.date {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    font-weight: 500;
    letter-spacing: 0.01em;
    padding: 0.5rem 0.75rem;
}

.save-status {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    opacity: 0;
    transition: opacity 0.3s ease;
    font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.save-status.visible {
    opacity: 0.6;
}

/* Reflect Button */
.reflect-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 99px;
    background: none;
    color: var(--color-text-secondary);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.reflect-btn:hover {
    color: var(--color-text-primary);
    background: var(--color-background);
}

.reflect-btn .sparkle-icon {
    width: 16px;
    height: 16px;
}

.reflect-btn .reflect-icon,
.reflect-btn .sparkle-icon,
.reflect-btn span {
    color: #9fb585;
    display: block;
}

.sparkle-icon {
    opacity: 0.8;
    transition: all 0.3s ease;
    animation: sparkle 1.5s ease-in-out infinite;
    margin-left: -2px;
}

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

.reflect-btn:hover .sparkle-icon {
    animation: sparkle 0.8s ease-in-out infinite;
}

.reflect-icon {
    opacity: 1;
    transition: all 0.3s ease;
}

.reflect-btn:hover .reflect-icon {
    opacity: 1;
    transform: rotate(15deg);
}

.reflect-btn span {
    font-weight: 600;
    font-size: 0.875rem;
}

/* Writing area styles */
.writing-container {
    flex: 1;
    overflow-y: auto;
    background: white;
    padding: 2rem 0;
}

.writing-area {
    max-width: 740px;
    margin: 0 auto;
    padding: 0 2rem;
    font-family: var(--font-serif);
    font-size: 1.3rem;
    line-height: 1.8;
    color: var(--text-color);
    outline: none;
}

.writing-area[data-show-placeholder="true"]:empty:before {
    content: "Tell your story...";
    color: var(--light-text);
    font-style: italic;
}

.writing-area h1, .writing-area h2, .writing-area h3 {
    font-family: var(--font-sans);
    margin: 2rem 0 1rem;
    font-weight: 700;
    line-height: 1.3;
}

.writing-area h1 {
    font-size: 2.5rem;
}

.writing-area h2 {
    font-size: 2rem;
}

.writing-area h3 {
    font-size: 1.5rem;
}

.writing-area p {
    margin-bottom: 1.5rem;
}

.writing-area blockquote {
    border-left: 3px solid var(--text-color);
    margin: 2rem 0;
    padding-left: 2rem;
    font-style: italic;
    color: var(--light-text);
}

/* Reflection prompts */
.reflection-prompt {
    display: block;
    margin: var(--spacing-xs) 0;
    padding: var(--spacing-xs) 0;
    font-family: var(--font-sans);
    user-select: none;
    position: relative;
    pointer-events: none;
}

.reflection-prompt-question {
    color: #9fb585;
    font-weight: 500;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
    line-height: 1.6;
    pointer-events: none;
    font-family: var(--font-sans);
    font-style: normal;
}

/* Formatting toolbar */
.formatting-toolbar {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: white;
    border: 1px solid #e2e8f0;
    padding: 0.5rem 0.75rem;
    border-radius: 99px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.toolbar-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border: none;
    background: none;
    color: #4a5568;
    border-radius: 99px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
}

.toolbar-button:hover {
    background-color: #f7fafc;
    color: #9fb585;
}

.toolbar-button.active {
    background-color: #f7fafc;
    color: #9fb585;
}

.toolbar-separator {
    width: 1px;
    height: 24px;
    background-color: #e2e8f0;
    margin: 0 0.25rem;
}

.toolbar-button.journal-deeper {
    background-color: #9fb585;
    color: white;
    padding: 0.5rem 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.25rem;
    width: auto;
    height: auto;
}

.toolbar-button.journal-deeper:hover {
    background-color: #8ca374;
}

.toolbar-button.journal-deeper svg {
    width: 16px;
    height: 16px;
}

/* Mobile optimizations for toolbar */
@media screen and (max-width: 768px) {
    .formatting-toolbar {
        display: none; /* Hide toolbar on mobile */
    }

    .entries-view .formatting-toolbar {
        display: none !important; /* Ensure toolbar is hidden in entries view */
    }

    body.keyboard-open .formatting-toolbar {
        display: none; /* Keep toolbar hidden when keyboard is open */
    }
}

.hidden {
    display: none;
}

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

/* Profile Button */
.profile-button-container {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 100;
}

.profile-button {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.profile-button:hover {
    color: var(--color-text-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.profile-name {
    font-weight: 500;
    letter-spacing: 0.02em;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + var(--spacing-xs));
    right: 0;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 120px;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.2s ease;
    pointer-events: none;
    visibility: hidden;
}

.profile-dropdown.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
}

.profile-dropdown-item {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.75rem;
    font-weight: 500;
}

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

/* Authentication */
.auth-container {
    min-height: 100vh;
    display: flex;
    background: var(--color-background);
}

.auth-brand {
    flex: 1;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    color: var(--color-text-primary);
    position: relative;
}

.auth-brand::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/static/images/pattern.svg') center/cover;
    opacity: 0.1;
}

.brand-title {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    position: relative;
}

.brand-subtitle {
    font-size: 1.25rem;
    font-weight: 500;
    opacity: 0.9;
    position: relative;
}

.auth-form {
    width: 28rem;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--color-background);
}

.auth-form-content {
    max-width: 320px;
    margin: 0 auto;
    width: 100%;
}

.auth-form h1 {
    font-size: 1.5rem;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.auth-form p {
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1.5px solid var(--color-border);
    border-radius: 12px;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.1);
}

.form-control::placeholder {
    color: var(--color-text-secondary);
    opacity: 0.7;
}

.btn {
    display: inline-block;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    text-align: center;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 0.5rem;
}

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

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

.auth-links {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
}

.auth-links a {
    color: #059669;
    text-decoration: none;
    font-weight: 500;
}

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

.error {
    color: #dc2626;
    font-size: 0.75rem;
    margin-top: 0.375rem;
    font-weight: 500;
}

/* Form validation styles */
.form-control.error {
    border-color: #dc2626;
}

.form-control.error:focus {
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

/* Flash Messages */
.flash-messages {
    position: fixed;
    top: 5rem;
    right: var(--spacing-lg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-width: 320px;
}

.flash {
    background: white;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    font-size: 0.875rem;
    color: var(--color-text-primary);
    animation: slideIn 0.3s ease-out;
    border: 1px solid var(--color-border);
}

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

/* Buttons */
.delete-entry-btn {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: none;
    background: none;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
}

.delete-entry-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Remove old insights sidebar styles */
.insights-sidebar {
    display: none;
}

/* Entries List */
.entries-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
    padding-bottom: calc(var(--spacing-md) + 100px); /* Add padding for footer */
    height: calc(100vh - 60px - 100px); /* Subtract header and footer heights */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.entry-item {
    position: relative;
    padding: var(--spacing-lg);
    border-radius: 0;
    background: var(--color-background);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0;
    border-bottom: 1px solid var(--color-border);
}

.entry-item:hover {
    background: #fafafa;
    border-color: var(--color-border);
}

.entry-item.active {
    background: #f8fafc;
}

.entry-item:hover .delete-entry-btn {
    opacity: 1;
}

.entry-date {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-xs);
    letter-spacing: 0.02em;
}

.entry-updated {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    opacity: 0.8;
    margin-left: var(--spacing-xs);
    font-style: italic;
}

.entry-preview {
    font-family: var(--font-serif);
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--color-text-primary);
}

.delete-entry-btn {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
    padding: 0;
}

.delete-entry-btn:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
}

/* Update search container */
.search-container {
    position: relative;
    width: 32px;
    height: 32px;
    transition: all 0.3s ease;
}

.search-container:focus-within {
    width: 200px;
}

.search-input {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    padding: 6px 28px 6px 8px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--color-text-primary);
    background: white;
    transition: all 0.2s ease;
    opacity: 0;
    cursor: pointer;
}

.search-container:focus-within .search-input {
    opacity: 1;
    cursor: text;
}

.search-container::before {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: currentColor;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    color: var(--color-text-secondary);
    z-index: 1;
    pointer-events: none;
    transition: all 0.2s ease;
}

.search-container:focus-within::before {
    color: var(--color-text-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--color-text-secondary);
    box-shadow: var(--shadow-sm);
}

.search-input::placeholder {
    color: var(--color-text-secondary);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.search-container:focus-within .search-input::placeholder {
    opacity: 0.7;
}

.clear-search-btn {
    display: none;
}

/* Remove Context Menu Styles */
.context-menu, .context-menu-item {
    display: none;
}

.week-streak {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 1.5rem;
    border: 1px solid var(--color-border);
    color: #9fb585;
    font-weight: 500;
    position: relative;
}

.week-streak:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--color-text-primary);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
}

.week-streak:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    right: 20px;
    width: 8px;
    height: 8px;
    background: white;
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    transform: rotate(45deg);
    pointer-events: none;
    z-index: 11;
}

/* Text formatting styles */
.writing-area {
    white-space: pre-wrap;
}

.writing-area strong {
    font-weight: 600;
}

.writing-area em {
    font-style: italic;
}

.writing-area blockquote {
    border-left: 3px solid var(--color-border);
    margin: 1em 0;
    padding-left: var(--spacing-md);
    color: var(--color-text-secondary);
    font-style: italic;
}

.week-header {
    padding: 2rem 0 0.75rem;
    margin: 0.5rem 0;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-sans);
}

.week-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--color-border);
}

.week-date {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-primary);
    letter-spacing: 0.02em;
}

.week-streak-dots {
    display: flex;
    gap: 0.25rem;
    margin-left: 0.25rem;
}

.week-streak-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--color-border);
    transition: all 0.2s ease;
}

.week-streak-dot.active {
    background: #9fb585;
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
    .entries-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        z-index: 1000;
        background: var(--color-background);
        transition: transform 0.3s ease;
        display: flex;
        flex-direction: column;
    }

    .entries-list {
        height: calc(100vh - 120px - 100px); /* Account for mobile header and footer */
        padding-bottom: calc(var(--spacing-md) + 100px);
    }

    .sidebar-header {
        padding-top: calc(var(--spacing-md) + 40px); /* Account for mobile menu button */
    }

    .entries-sidebar.show {
        transform: translateX(100%);
    }

    .mobile-menu-toggle {
        position: fixed;
        top: var(--spacing-md);
        left: var(--spacing-md);
        width: 40px;
        height: 40px;
        border-radius: 10px;
        background: white;
        border: 1px solid rgba(159, 181, 133, 0.2);
        display: none;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 1001;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: var(--shadow-sm);
        color: #9fb585;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-menu-toggle:active {
        transform: scale(0.95);
    }

    .mobile-menu-toggle .menu-icon {
        display: block;
    }

    .mobile-menu-toggle .pencil-icon {
        display: none;
    }

    .mobile-menu-toggle.active .menu-icon {
        display: none;
    }

    .mobile-menu-toggle.active .pencil-icon {
        display: block;
    }

    @media screen and (max-width: 768px) {
        .mobile-menu-toggle {
            display: flex;
        }

        .app-container {
            padding-top: calc(40px + (2 * var(--spacing-md)));
        }

        .entries-sidebar {
            padding-top: calc(40px + var(--spacing-md));
        }

        .sidebar-header {
            padding-top: var(--spacing-md);
            border-bottom: 1px solid rgba(198, 214, 179, 0.3);
        }
    }

    .app-container {
        padding-top: 60px;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .auth-container {
        flex-direction: column;
        min-height: 100vh;
    }

    .auth-brand {
        padding: 3rem 1.5rem;
        min-height: 30vh;
        background: linear-gradient(135deg, 
            rgba(248, 250, 252, 0.8) 0%, 
            rgba(241, 245, 249, 0.8) 100%
        );
    }

    .brand-title {
        font-size: 2.5rem;
    }

    .brand-subtitle {
        font-size: 1rem;
    }

    .auth-form {
        width: 100%;
        padding: 2rem 1.5rem;
        flex: 1;
        background: white;
        border-radius: 24px 24px 0 0;
        margin-top: -24px;
        box-shadow: var(--shadow-lg);
    }

    .auth-form h1 {
        font-size: 1.5rem;
    }

    .auth-form p {
        font-size: 0.875rem;
        margin-bottom: 1.5rem;
    }

    .form-control {
        font-size: 1rem;
        padding: 0.875rem 1rem;
    }

    .btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        margin-top: 1rem;
    }

    .auth-links {
        margin-top: 2rem;
        font-size: 0.9375rem;
    }

    /* Flash messages mobile positioning */
    .flash-messages {
        top: auto;
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }

    .flash {
        margin: 0.5rem 0;
        text-align: center;
    }

    /* Profile button mobile styles */
    .profile-button-container {
        top: var(--spacing-md);
        right: var(--spacing-md);
    }

    .profile-button {
        width: 40px;
        height: 40px;
        padding: 0;
        justify-content: center;
    }

    .profile-button svg {
        display: none;
    }

    /* Hide entries sidebar by default on mobile */
    .entries-sidebar {
        display: none;
    }

    .entries-sidebar.show {
        display: block;
    }

    /* Adjust writing area padding */
    .writing-area {
        font-size: 1.125rem;
        line-height: 1.7;
        padding: var(--spacing-lg) 0;
        min-height: calc(100vh - 200px);
    }

    /* Adjust header spacing */
    .header {
        position: sticky;
        top: 0;
        background: var(--color-background);
        z-index: 10;
        margin-bottom: var(--spacing-md);
        padding-bottom: var(--spacing-md);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    /* Make search expand full width on mobile */
    .search-container:focus-within {
        width: calc(100% - 80px); /* Account for buttons on either side */
    }

    /* Increase reflection prompt sizes */
    .reflection-prompt {
        margin: var(--spacing-md) 0;
        padding: var(--spacing-sm);
        background: rgba(159, 181, 133, 0.05);
        border-radius: 12px;
    }

    .reflection-prompt-question {
        font-size: 1rem;
        line-height: 1.5;
    }

    /* Adjust entry preview text size */
    .entry-preview {
        font-size: 1.125rem;
        line-height: 1.6;
    }

    /* Increase date and metadata text */
    .date {
        font-size: 0.8125rem;
        padding-right: 0.5rem;
    }

    .save-status {
        font-size: 0.875rem;
    }
}

/* Tablet Responsive Styles */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .app-container {
        padding: var(--spacing-lg);
        gap: var(--spacing-lg);
    }

    .entries-sidebar {
        width: 280px;
    }

    .journal-container {
        padding: var(--spacing-lg);
    }

    .auth-container {
        min-height: 100vh;
    }

    .auth-brand {
        flex: 1.5;
    }

    .auth-form {
        flex: 2;
        padding: 2rem;
    }
}

/* Add to your existing styles */
.mobile-menu-toggle {
    display: none;
}

@media screen and (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
}

/* Sidebar Footer */
.sidebar-footer {
    padding: var(--spacing-md);
    background: var(--color-background);
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    position: sticky;
    bottom: 0;
    width: 100%;
    z-index: 10;
}

.logout-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 6px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    width: 100%;
    justify-content: center;
}

.logout-link:hover {
    background: #fafafa;
    color: var(--color-text-primary);
    border-color: var(--color-text-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Mobile styles for sidebar footer */
@media screen and (max-width: 768px) {
    .sidebar-footer {
        position: sticky;
        bottom: 0;
        background: var(--color-background);
        box-shadow: 0 -1px 0 var(--color-border);
        padding: var(--spacing-md);
    }
}

.discord-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 6px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    width: 100%;
    justify-content: center;
}

.discord-link:hover {
    background: #fafafa;
    color: var(--color-text-primary);
    border-color: var(--color-text-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.discord-link svg {
    width: 16px;
    height: 16px;
}

/* Bottom Reflect Button */
.bottom-reflect-container {
    display: none;
}

/* Analytics Page Styles */
.analytics-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-xl);
}

.analytics-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-xl);
}

.analytics-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.back-button {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 8px;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.back-button:hover {
    color: var(--color-text-primary);
    border-color: var(--color-text-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.export-button {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 8px;
    background: white;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-button:hover {
    color: var(--color-text-primary);
    border-color: var(--color-text-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: var(--spacing-lg);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(159, 181, 133, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9fb585;
}

.stat-content h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-xs);
}

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.2;
}

.stat-subtext {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-top: var(--spacing-xs);
}

.analytics-sections {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xl);
}

.section {
    background: white;
    border-radius: 12px;
    padding: var(--spacing-lg);
    border: 1px solid var(--color-border);
}

.section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-lg);
}

.themes-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.theme-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
}

.theme-name {
    font-size: 1rem;
    color: var(--color-text-primary);
    font-weight: 500;
}

.theme-count {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.theme-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: var(--spacing-sm);
}

.insights-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.insight-item {
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
}

.insight-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(159, 181, 133, 0.1);
    color: #9fb585;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 500;
    flex-shrink: 0;
}

.insight-text {
    font-size: 1rem;
    color: var(--color-text-primary);
    line-height: 1.6;
}

/* Mobile styles for analytics */
@media screen and (max-width: 768px) {
    .analytics-container {
        padding: var(--spacing-md);
    }

    .analytics-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
        margin-bottom: var(--spacing-lg);
    }

    .analytics-header h1 {
        font-size: 1.5rem;
    }

    .analytics-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .analytics-sections {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .stat-card {
        padding: var(--spacing-md);
    }

    .section {
        padding: var(--spacing-md);
    }
}

.header-right {
    display: flex;
    align-items: center;
    background-color: white;
    border: 1px solid var(--color-border);
    padding: 0.25rem;
    border-radius: 99px;
    box-shadow: var(--shadow-sm);
}

.analytics-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 99px;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
}

.analytics-link:hover {
    color: var(--color-text-primary);
    background: var(--color-background);
}

.analytics-link svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

@media screen and (max-width: 768px) {
    .header-right {
        gap: 0.25rem;
        padding: 0.25rem;
    }

    .analytics-link {
        padding: 0.5rem;
    }

    .analytics-link span {
    display: none;
}

    .analytics-link svg {
        width: 18px;
        height: 18px;
    }

    .reflection-prompt {
        margin: var(--spacing-md) 0;
        padding: var(--spacing-xs) 0;
        background: none;
        border-radius: 0;
    }

    .reflection-prompt-question {
        font-size: 1rem;
        line-height: 1.5;
    }
}

/* Keyboard Improvements */
@media screen and (max-width: 768px) {
    .writing-area {
        padding-bottom: 50vh; /* Add padding when keyboard is open */
    }
    
    body.keyboard-open .writing-area {
        padding-bottom: 60vh;
    }
}

.entry-creation-date {
    color: #666;
    font-size: 0.9rem;
    margin-right: 1rem;
    margin-left: 1rem;  /* Push it away from the pillbox */

}

@media screen and (max-width: 768px) {
    .header-right {
        gap: var(--spacing-sm);
    }
    
    .entry-creation-date {
        display: block;
        margin-right: 0.5rem;
    }
}

