/* ================================================
   NOTES VIEW - BEM STRUCTURE
   ================================================ */

/* Notes View Container - Root Block */
.tasknotes-plugin .notes-view {
    padding: var(--tn-spacing-sm);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    gap: var(--tn-spacing-sm);
    max-width: 100%;
}

/* Notes View Header */
.tasknotes-plugin .notes-view__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--tn-spacing-sm) 0;
    border-bottom: 1px solid var(--tn-border-color);
    margin-bottom: var(--tn-spacing-sm);
}

.tasknotes-plugin .notes-view__title {
    font-size: var(--tn-font-size-xl);
    font-weight: var(--tn-font-weight-semibold);
    color: var(--tn-text-normal);
    margin: 0;
    line-height: 1.3;
}

.tasknotes-plugin .notes-view__date {
    font-size: var(--tn-font-size-md);
    color: var(--tn-text-muted);
    font-weight: var(--tn-font-weight-normal);
}

.tasknotes-plugin .notes-view__actions {
    display: flex;
    align-items: center;
    gap: var(--tn-spacing-sm);
}

/* Use consistent button system */
.tasknotes-plugin .notes-view__refresh-button {
    background: transparent;
    color: var(--tn-text-normal);
    border: none;
    box-shadow: none;
    font-size: var(--tn-font-size-sm);
    font-weight: var(--tn-font-weight-medium);
}

.tasknotes-plugin .notes-view__refresh-button:hover {
    background: var(--tn-interactive-hover);
    box-shadow: none;
}

.tasknotes-plugin .notes-view__refresh-button:active {
    opacity: 0.8;
}

.tasknotes-plugin .notes-view__refresh-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tasknotes-plugin .notes-view__refresh-button.is-loading {
    opacity: 0.7;
    cursor: progress;
}

/* Notes List Container */
.tasknotes-plugin .notes-view__list {
    display: flex;
    flex-direction: column;
    gap: var(--tn-spacing-sm);
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Loading Indicator */
.tasknotes-plugin .notes-view__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--tn-spacing-sm);
    padding: var(--tn-spacing-lg);
    color: var(--tn-text-muted);
    font-size: var(--tn-font-size-md);
    font-style: italic;
    font-weight: 400;
    background: var(--tn-bg-secondary);
    border: 1px solid var(--tn-border-color);
    border-radius: var(--tn-radius-md);
    margin-bottom: var(--tn-spacing-md);
}

.tasknotes-plugin .notes-view__loading.is-hidden {
    display: none;
}

.tasknotes-plugin .notes-view__loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid color-mix(in srgb, var(--tn-text-muted) 0.3, transparent);
    border-top: 2px solid var(--tn-text-muted);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}

/* Notes Container */
.tasknotes-plugin .notes-view__container {
    display: flex;
    flex-direction: column;
    gap: var(--tn-spacing-xs);
}

/* Empty State */
.tasknotes-plugin .notes-view__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--tn-spacing-xl);
    text-align: center;
    color: var(--tn-text-muted);
    background: var(--tn-bg-secondary);
    border: 1px solid var(--tn-border-color);
    border-radius: var(--tn-radius-md);
    margin: var(--tn-spacing-lg) 0;
}

.tasknotes-plugin .notes-view__empty-icon {
    font-size: 2rem;
    margin-bottom: var(--tn-spacing-md);
    opacity: 0.6;
}

.tasknotes-plugin .notes-view__empty-title {
    font-size: var(--tn-font-size-lg);
    font-weight: var(--tn-font-weight-medium);
    margin-bottom: var(--tn-spacing-sm);
    color: var(--tn-text-normal);
}

.tasknotes-plugin .notes-view__empty-description {
    font-size: var(--tn-font-size-md);
    line-height: 1.6;
    max-width: 400px;
}

/* Note Item Container (wraps note cards) */
.tasknotes-plugin .notes-view__note-item {
    position: relative;
    background: var(--tn-bg-primary);
    border: 1px solid var(--tn-border-color);
    border-radius: var(--tn-radius-sm);
    transition: all var(--tn-transition-fast);
    overflow: hidden;
}

.tasknotes-plugin .notes-view__note-item:hover {
    background: var(--tn-interactive-hover);
    border-color: var(--tn-border-color-hover);
    transform: translateY(-1px);
    box-shadow: var(--tn-shadow-medium);
}

.tasknotes-plugin .notes-view__note-item:focus-within {
    border-color: var(--tn-interactive-accent);
    box-shadow: none;
}

/* Note Item Types */
.tasknotes-plugin .notes-view__note-item--daily-note {
    border-left: 4px solid var(--tn-color-daily-note);
    background: color-mix(in srgb, var(--tn-color-daily-note) 0.05, var(--tn-bg-primary));
}

.tasknotes-plugin .notes-view__note-item--has-tasks {
    border-left: 4px solid var(--tn-color-warning);
    background: color-mix(in srgb, var(--tn-color-warning) 0.05, var(--tn-bg-primary));
}

.tasknotes-plugin .notes-view__note-item--recently-modified {
    border-left: 4px solid var(--tn-interactive-accent);
    background: color-mix(in srgb, var(--tn-interactive-accent) 0.05, var(--tn-bg-primary));
}

/* Notes View Specific NoteCard Overrides */
.tasknotes-plugin .notes-view .note-card {
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
}

.tasknotes-plugin .notes-view .note-card:hover {
    transform: none;
    box-shadow: none;
}

/* Stats Summary */
.tasknotes-plugin .notes-view__stats {
    display: flex;
    align-items: center;
    gap: var(--tn-spacing-md);
    padding: var(--tn-spacing-sm);
    background: var(--tn-bg-secondary);
    border: 1px solid var(--tn-border-color);
    border-radius: var(--tn-radius-sm);
    margin-bottom: var(--tn-spacing-md);
    font-size: var(--tn-font-size-sm);
    color: var(--tn-text-muted);
}

.tasknotes-plugin .notes-view__stats-item {
    display: flex;
    align-items: center;
    gap: var(--tn-spacing-xs);
}

.tasknotes-plugin .notes-view__stats-count {
    font-weight: var(--tn-font-weight-semibold);
    color: var(--tn-text-normal);
}

/* Responsive Design */
@media (max-width: 768px) {
    .tasknotes-plugin .notes-view {
        padding: var(--tn-spacing-xs);
        gap: var(--tn-spacing-xs);
    }
    
    .tasknotes-plugin .notes-view__header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--tn-spacing-sm);
    }
    
    .tasknotes-plugin .notes-view__actions {
        justify-content: center;
    }
    
    .tasknotes-plugin .notes-view__refresh-button {
        width: 100%;
        max-width: 200px;
    }
    
    .tasknotes-plugin .notes-view__stats {
        flex-direction: column;
        align-items: stretch;
        gap: var(--tn-spacing-sm);
    }
}

@media (max-width: 480px) {
    .tasknotes-plugin .notes-view__title {
        font-size: var(--tn-font-size-lg);
    }
    
    .tasknotes-plugin .notes-view__date {
        font-size: var(--tn-font-size-sm);
    }
    
    .tasknotes-plugin .notes-view__empty {
        padding: var(--tn-spacing-lg);
    }
    
    .tasknotes-plugin .notes-view__empty-title {
        font-size: var(--tn-font-size-md);
    }
    
    .tasknotes-plugin .notes-view__empty-description {
        font-size: var(--tn-font-size-sm);
    }
}