/* Base layout for the notes page */
.notes-container {
    display: flex;
    max-width: 100vw;
    width: 100vw;
    margin: 0;
    padding: 0;
    gap: 0;
    position: relative;
    height: calc(100vh - 60px);
    overflow: hidden; /* Prevent page-level scrolling */
    left: 0;
    right: 0;
}

/* Notes page scrollbar rules moved to style.css */

/* Hide any potential scrollbars from notes container */
.notes-container::-webkit-scrollbar {
    display: none;
}

.notes-container.sidebar-collapsed {
    padding-left: 50px; /* Space for the toggle button */
}

/* Themed notes sidebar */
.notes-sidebar {
    flex: 0 0 300px; /* Increased width for timeline design */
    background: var(--secondary-color);
    border-right: var(--card-border);
    padding: 0;
    height: 100%;
    overflow: hidden; /* Remove overflow from sidebar container */
    position: relative;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-speed) var(--transition-curve);
    margin-left: 0;
    display: flex;
    flex-direction: column;
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
}

/* Hide ALL scrollbars from sidebar container - scrolling only happens in note list */
.notes-sidebar::-webkit-scrollbar { 
    display: none; 
}
.notes-sidebar { 
    scrollbar-width: none; 
    -ms-overflow-style: none; 
}

/* Single custom scrollbar for note list only */
.note-list::-webkit-scrollbar {
    width: 8px;
}

.note-list::-webkit-scrollbar-track {
    background: rgba(20, 20, 25, 0.3);
    border-radius: 4px;
}

.note-list::-webkit-scrollbar-thumb {
    background: rgba(113, 113, 122, 0.4);
    border-radius: 4px;
    border: 1px solid rgba(20, 20, 25, 0.2);
}

.note-list::-webkit-scrollbar-thumb:hover {
    background: rgba(161, 161, 170, 0.6);
}

/* For Firefox - merged with main note-list declaration below */

.notes-sidebar.collapsed {
    margin-left: -280px;
}
/* Sidebar Header */
.sidebar-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    margin: 0;
    background: transparent;
    width: 100%;
    margin-bottom: -1rem;
    box-sizing: border-box;
    position: relative;
    border-bottom: var(--card-border);
    min-height: 60px;
}

.notes-sidebar h2 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Light/Dark Mode Toggle */
.lightbulb-toggle {
    cursor: pointer;
    font-size: 1.3rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all var(--transition-speed) var(--transition-curve);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: rgba(113, 113, 122, 0.1);
    border: 1px solid rgba(113, 113, 122, 0.2);
    user-select: none;
}

.lightbulb-toggle:hover {
    background: rgba(161, 161, 170, 0.2);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(161, 161, 170, 0.4);
}

/* Lightbulb state control - show/hide bulb states based on dark mode */
.lightbulb-toggle .lamp-bulb-off {
    display: none;
}

.lightbulb-toggle .lamp-bulb-on {
    display: block;
}

.lightbulb-toggle.dark-mode .lamp-bulb-off {
    display: block;
}

.lightbulb-toggle.dark-mode .lamp-bulb-on {
    display: none;
}

/* Note List - Clean Design */
.note-list {
    list-style: none;
    padding: 1rem; /* Simplified padding without timeline space */
    margin: 0;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    border: none;
    outline: none;
    overflow-y: auto; /* Move scrolling to the note list itself */
    overflow-x: hidden;
    /* Firefox scrollbar styling - single consistent scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(113, 113, 122, 0.4) rgba(20, 20, 25, 0.3);
    position: relative;
}

/* Timeline vertical line - REMOVED to fix left spacing */

.note-list .loading, .note-list .error {
    padding: 1rem;
    margin: 0;
    background: transparent;
    border: none;
    list-style: none;
    text-align: center;
    color: var(--text-muted);
}

/* Note Items - Clean Style */
.note-item {
    background: var(--card-background);
    margin-bottom: 1rem; /* Standard spacing */
    margin-left: 0; /* No left margin needed */
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed) var(--transition-curve);
    border: var(--card-border);
    position: relative;
    overflow: hidden;
}

/* Timeline circle/dot - REMOVED to fix left spacing */

/* Timeline connecting line - REMOVED to fix left spacing */

/* Shimmer effect (kept from original design) */
.note-item .shimmer-effect {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 212, 216, 0.05), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
}

.note-item:hover .shimmer-effect {
    left: 100%;
}

.note-item:hover {
    background: var(--card-hover);
    border-color: var(--card-border-hover);
    transform: translateY(-2px); /* Simple lift on hover */
    box-shadow: var(--box-shadow-hover);
}

/* Timeline hover effects - REMOVED */

.note-item.active {
    background: var(--accent-secondary);
    border-color: var(--accent-hover);
    box-shadow: 0 0 20px rgba(161, 161, 170, 0.3);
    transform: scale(1.02); /* Clean active state */
}

/* Active timeline effects - REMOVED */

.note-item a {
    display: block;
    padding: 1rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
}

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

.note-title {
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: var(--primary-color);
    font-size: 0.9rem;
    letter-spacing: 0.2px;
    line-height: 1.3;
    text-transform: none;
}

.note-date {
    font-size: 0.7rem;
    opacity: 0.7;
    color: var(--text-muted);
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

.note-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1px;
    gap: 12px;
}

.word-count-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.length-bar-container {
    width: 40px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.length-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
    background: #00ff88;
}

.length-label {
    font-size: 10px;
    font-weight: 500;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 32px;
    text-align: right;
}

.length-byte .length-bar { width: 8px; max-width: 8px; border-radius: 50%; height: 6px; margin-top: -1px; }
.length-short .length-bar { width: 25%; }
.length-medium .length-bar { width: 50%; }
.length-long .length-bar { width: 75%; }
.length-extra-long .length-bar { width: 100%; }

.note-item:hover .length-bar {
    opacity: 0.8;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
}

.note-star {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-left: 4px;
    float: right;
    position: relative;
    top: -2px;
    color: var(--accent-color);
}

.note-item:hover .note-star {
    opacity: 0.8;
    color: var(--accent-hover);
}

.note-item.active .note-star {
    opacity: 1;
    color: #ffd700; /* Gold for active star */
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .notes-container {
        flex-direction: column;
        height: calc(100vh - 60px);
    }

    .notes-sidebar {
        width: 100%;
        height: 40vh; /* Fixed height instead of max-height */
        min-height: 40vh;
        flex: 0 0 40vh;
        border-right: none;
        border-bottom: var(--card-border);
    }

    .notes-content {
        flex: 1;
        height: 60vh;
        overflow-y: auto;
    }

    /* Clean mobile layout without timeline */
    .note-list {
        padding: 1rem; /* Simplified padding */
    }
    
    .note-item {
        margin-left: 0; /* No left margin needed */
    }


    .mobile-back-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .back-to-notes-btn {
        display: block;
    }

    .mobile-lightbulb-toggle {
        display: flex !important;
    }
}
