/* Reflect.app Inspired Design - Updated for Stream View */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400&display=swap');

:root {
    --bg-color: #ffffff;
    --sidebar-bg: #f7f7f8;
    --text-primary: #1f2937;
    --text-secondary: #9ca3af;
    --accent: #2563eb;
    --accent-light: #eff6ff;
    --border-color: #e5e7eb;
    --bullet-color: #d1d5db;
    /* Light gray for bullets */

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
    outline: none;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    overflow: hidden;
}

/* Sidebar */
aside {
    width: 280px;
    /* Slightly wider for calendar */
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    z-index: 20;
    height: 100vh;
}

.logo {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Sidebar Calendar - Fixed Grid */
.calendar-wrapper {
    margin-bottom: 20px;
    padding-bottom: 15px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.calendar-controls {
    display: flex;
    gap: 10px;
    color: #9ca3af;
}

.calendar-nav-btn {
    cursor: pointer;
    font-size: 0.8rem;
}

.calendar-nav-btn:hover {
    color: var(--text-primary);
}

.mini-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    /* Force 7 columns */
    row-gap: 8px;
    text-align: center;
    font-size: 0.8rem;
}

.cal-day-name {
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.75rem;
}

.cal-day {
    aspect-ratio: 1 / 1;
    /* Square shape */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
    /* Rounded square like reference */
    color: #374151;
    font-weight: 500;
}

.cal-day:hover:not(.empty) {
    background-color: #f3f4f6;
}

/* Selected Date (Matches reference) */
.cal-day.active-date {
    background-color: #111827;
    /* Dark black/blue */
    color: white;
}

.cal-day.today {
    color: var(--accent);
    font-weight: 700;
}

/* If today is also active, keep white text */
.cal-day.today.active-date {
    color: white;
}

.cal-day.empty {
    cursor: default;
}

/* Navigation Items */
.nav-item {
    padding: 8px 12px;
    border-radius: 6px;
    color: #4b5563;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: #000;
}

.nav-item.active {
    background-color: #fff;
    color: var(--accent);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}


.sidebar-section {
    margin-top: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    padding-left: 12px;
    margin-bottom: 8px;
}

/* Main Content - Left Aligned */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: scroll;
    position: relative;
    padding: 0;
    scroll-behavior: smooth;
    background: #fff;
}

.stream-container {
    max-width: 900px;
    /* LEFT ALIGNMENT FIX */
    margin: 0;
    margin-left: 5%;
    /* Slight offset from sidebar */
    padding: 40px 20px 100px 0px;
    width: 100%;
}

/* Daily Note Section */
.daily-section {
    margin-bottom: 30vh;
    /* Huge spacing between dates as requested "일정 간격의 공간" */
    min-height: 200px;
}

.date-header {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-left: 0;
    line-height: 1.3;
    transition: all 0.3s ease;
}

/* Today's Special Styling */
.daily-section.today .date-header {
    border-left: 5px solid #111827;
    /* The thick bar */
    padding-left: 16px;
    margin-left: -21px;
    /* Offset to align text visually */
    color: #000;
}

/* Content Area mimicking Outliner */
.note-content {
    font-size: 1rem;
    line-height: 1.6;
    color: #374151;
}

.note-content p,
.note-content div,
.note-content li {
    margin-bottom: 0.5em;
    position: relative;
}

/* The Grey Dot (Bullet) */
.note-content ul {
    list-style: none;
    /* Custom bullets */
    padding-left: 0;
    margin: 0;
}

.note-content li {
    padding-left: 24px;
    /* Space for bullet */
    position: relative;
}

.note-content li::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 10px;
    /* Align deeply */
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--bullet-color);
    /* Grey circle */
}

/* Empty placeholder line styling */
.empty-line {
    display: flex;
    align-items: center;
    padding-left: 24px;
    position: relative;
    min-height: 1.6em;
}

.empty-line::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--bullet-color);
}

/* Typography elements */
.note-content h1,
.note-content h2,
.note-content h3 {
    margin-top: 1em;
    margin-bottom: 0.5em;
    font-weight: 600;
}

.note-content blockquote {
    border-left: 3px solid var(--accent);
    margin: 1em 0;
    padding-left: 1em;
    color: var(--text-secondary);
}

.note-content pre {
    background: #f3f4f6;
    padding: 1em;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.85em;
}

/* Status & Menu (Same as before) */
#save-status {
    position: fixed;
    bottom: 20px;
    right: 30px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

#slash-menu {
    position: absolute;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 260px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 6px;
    display: none;
}

.slash-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.slash-item:hover,
.slash-item.selected {
    background-color: var(--accent-light);
    color: var(--accent);
}

.slash-icon {
    width: 20px;
    height: 20px;
    background: #f3f4f6;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #6b7280;
}

.slash-item:hover .slash-icon,
.slash-item.selected .slash-icon {
    background: #fff;
    color: var(--accent);
}

/* Mobile */
@media (max-width: 768px) {
    aside {
        position: fixed;
        left: -260px;
        height: 100%;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    aside.open {
        left: 0;
    }

    .stream-container {
        padding: 80px 20px 100px 20px;
    }

    .daily-section {
        margin-bottom: 15vh;
    }

    .date-header {
        font-size: 1.5rem;
    }
}