/**
 * List Component
 * Generic list and list-item patterns (truly reusable)
 * Replaces page-specific: .listener-item, .language-item, .anomaly-item, .suggestion-item, etc.
 */

/* List Container */
.list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list-compact {
    gap: 4px;
}

.list-spacious {
    gap: 16px;
}

/* Scrollable List */
.list-scrollable {
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

/* List Item */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s;
}

.list-item:hover {
    background: var(--background);
    box-shadow: var(--shadow-sm);
}

/* List Item Variants */
.list-item-compact {
    padding: 8px;
}

.list-item-spacious {
    padding: 16px;
}

.list-item-borderless {
    border: none;
    border-bottom: 1px solid var(--border-light);
    border-radius: 0;
}

.list-item-borderless:last-child {
    border-bottom: none;
}

/* List Item Content Areas */
.list-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.list-item-title {
    font-weight: 500;
    color: var(--text-primary);
}

.list-item-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.list-item-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.list-item-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* List Item States */
.list-item.active {
    background: #dbeafe;
    border-color: var(--primary-color);
}

.list-item.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.list-item.disabled:hover {
    background: var(--surface);
    box-shadow: none;
}

/* Alert/Notification List Items */
.list-item-warning {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
}

.list-item-danger {
    background: #fee2e2;
    border-left: 4px solid #dc2626;
}

.list-item-success {
    background: #d1fae5;
    border-left: 4px solid #10b981;
}

.list-item-info {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
}

/* Grid List (for cards-like items) */
.list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.list-grid-large {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Empty List State */
.list-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .list-item-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .list-grid,
    .list-grid-large {
        grid-template-columns: 1fr;
    }
}
