/* C:\apps\my_blog_v1\blog\static\blog\css\blogpost_list.css */
/* 搜索面板样式 */
.search-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-panel h3 {
    margin-bottom: 20px;
    font-weight: 300;
}

/* 修复：只应用于搜索面板内的直接表单控件，不应用于下拉菜单 */
.search-form > .form-control,
.search-form > .input-group > .form-control,
.search-form > .form-select {
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.3s ease;
}

.search-form > .form-control::placeholder,
.search-form > .input-group > .form-control::placeholder,
.search-form > .form-select::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-form > .form-control:focus,
.search-form > .input-group > .form-control:focus,
.search-form > .form-select:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
}

.search-form .input-group-text {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

/* 搜索按钮样式 */
.search-buttons .btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.search-buttons .btn-primary {
    background: #4dabf7;
    border: none;
}

.search-buttons .btn-primary:hover {
    background: #339af0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(77, 171, 247, 0.4);
}

.search-buttons .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* 高级搜索切换 */
.advanced-search-toggle {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.advanced-search-toggle:hover {
    color: white;
    text-decoration: underline;
}

/* 搜索结果统计 */
.search-results-info {
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #4dabf7;
}

.search-results-info .badge {
    font-size: 0.85em;
    padding: 0.5em 0.8em;
}

/* 文章卡片样式 */
.post-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #4dabf7;
    transition: all 0.3s ease;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border-left-color: #339af0;
}

.post-card.draft {
    border-left-color: #ffc107;
    opacity: 0.9;
}

.post-card.draft:hover {
    border-left-color: #ffb300;
}

.post-title {
    color: #343a40;
    margin-bottom: 10px;
    font-weight: 600;
}

.post-meta {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.post-excerpt {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 15px;
    max-height: 4.8em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.post-tags {
    margin-top: 15px;
}

.post-tags .badge {
    font-size: 0.8rem;
    padding: 0.4em 0.8em;
    margin-right: 5px;
    margin-bottom: 5px;
}

.post-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.empty-state-icon {
    font-size: 4rem;
    color: #6c757d;
    margin-bottom: 20px;
}

.empty-state h4 {
    color: #495057;
    margin-bottom: 10px;
}

.empty-state p {
    color: #6c757d;
    margin-bottom: 30px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* 筛选条件标签 */
.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    background: #e9ecef;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.85rem;
    color: #495057;
}

.filter-tag .remove-filter {
    background: none;
    border: none;
    color: #6c757d;
    margin-left: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.filter-tag .remove-filter:hover {
    background: #dc3545;
    color: white;
}

/* 分类树过滤提示 */
.category-tree-alert {
    background: #e7f5ff;
    border-left: 4px solid #0d6efd;
}

/* 搜索下拉菜单样式 */
.search-dropdown {
    position: relative;
    width: 100%;
}

.dropdown-header {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 10px 15px;
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    min-height: 45px;
    user-select: none;
}

.dropdown-header:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.dropdown-header .selected-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 85%;
    font-size: 14px;
    color: white;
}

.dropdown-header i {
    transition: transform 0.3s ease;
    color: white;
}

.dropdown-header.active i {
    transform: rotate(180deg);
}

.custom-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-top: 5px;
    max-height: 400px;
    flex-direction: column;
}

.custom-dropdown.show {
    display: flex;
    animation: dropdownSlideDown 0.3s ease;
}

@keyframes dropdownSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-search {
    position: relative;
    padding: 12px;
    border-bottom: 1px solid #eee;
}

/* 修复：下拉菜单内的搜索框使用正常颜色 */
.dropdown-search .form-control {
    padding-left: 35px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    border-radius: 4px;
    height: 38px;
    width: 100%;
}

.dropdown-search .form-control::placeholder {
    color: #6c757d;
}

.dropdown-search i {
    position: absolute;
    left: 25px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 1;
}

.dropdown-options {
    flex: 1;
    overflow-y: auto;
    max-height: 300px;
    padding: 8px 0;
}

.dropdown-option {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f8f9fa;
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option:hover {
    background-color: #f8f9fa;
}

.dropdown-option input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.dropdown-option label {
    flex: 1;
    cursor: pointer;
    margin: 0;
    font-size: 14px;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-option .tag-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.dropdown-option .option-count {
    background: #e9ecef;
    color: #6c757d;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.dropdown-actions {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.dropdown-actions .btn {
    font-size: 13px;
    padding: 4px 8px;
}

.dropdown-actions .btn-link {
    color: #6c757d;
    text-decoration: none;
}

.dropdown-actions .btn-link:hover {
    color: #0d6efd;
}

.dropdown-actions .apply-btn {
    padding: 4px 12px;
}

/* 多选时的显示样式 */
.dropdown-header.multiple-selected .selected-text {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.selected-item {
    background: rgba(77, 171, 247, 0.2);
    color: #4dabf7;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 2px 0;
}

.selected-item .remove-item {
    background: none;
    border: none;
    color: #4dabf7;
    padding: 0;
    width: 14px;
    height: 14px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.selected-item .remove-item:hover {
    background: #4dabf7;
    color: white;
}

/* 滚动条样式 */
.dropdown-options::-webkit-scrollbar {
    width: 6px;
}

.dropdown-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.dropdown-options::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.dropdown-options::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 空状态提示 */
.dropdown-empty {
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-size: 14px;
}

.dropdown-empty i {
    font-size: 1.5rem;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .search-panel {
        padding: 15px;
    }
    
    .post-card {
        padding: 15px;
    }
    
    .post-actions {
        flex-direction: column;
    }
    
    .post-actions .btn {
        width: 100%;
    }
    
    .custom-dropdown {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90vw;
        max-width: 400px;
        max-height: 70vh;
    }
    
    .dropdown-header {
        min-height: 40px;
        padding: 8px 12px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.post-card {
    animation: fadeIn 0.3s ease-out;
}

/* 分页样式 */
.pagination-container {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.page-item.active .page-link {
    background-color: #4dabf7;
    border-color: #4dabf7;
}

.page-link {
    color: #4dabf7;
    border-radius: 6px;
    margin: 0 3px;
}

.page-link:hover {
    color: #339af0;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

/* 专门为状态选择器设置样式 */
.status-selector {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000' viewBox='0 0 16 16'%3e%3cpath fill='white' fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 16px 12px !important;
}

.status-selector option {
    background-color: #764ba2 !important;
    color: white !important;
}

.status-selector:focus {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25) !important;
}

/* 分类下拉选项样式 */
.category-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    transition: all 0.2s ease;
    user-select: none;
}

.category-item:hover {
    background-color: #f8f9fa;
}

.category-item.selected {
    background-color: #e7f5ff;
    border-left: 3px solid #0d6efd;
}

.category-item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-item-info {
    flex: 1;
}

.category-item-name {
    font-weight: 500;
    color: #495057;
    margin-bottom: 2px;
}

.category-item-desc {
    font-size: 12px;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.category-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-item-count {
    background: #e9ecef;
    color: #6c757d;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
}

.category-item .fa-check {
    color: #28a745;
}

/* 下拉选项容器 */
#category-options {
    max-height: 300px;
    overflow-y: auto;
    padding: 5px 0;
}

/* 加载更多提示 */
.load-more-hint {
    border-top: 1px dashed #dee2e6;
    margin-top: 5px;
}

/* 分页容器 */
.dropdown-pagination {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

/* 选中的标签样式 */
.selected-item {
    background: rgba(77, 171, 247, 0.2);
    color: #4dabf7;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 2px 0;
}

.selected-item .remove-tag {
    background: none;
    border: none;
    color: #4dabf7;
    padding: 0;
    width: 14px;
    height: 14px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.selected-item .remove-tag:hover {
    background: #4dabf7;
    color: white;
}

/* 多选下拉框样式 */
.search-dropdown.multiple-selected .dropdown-header {
    background-color: #f8f9fa;
    border-color: #0d6efd;
}

.selected-item {
    display: inline-flex;
    align-items: center;
    background-color: #e7f1ff;
    color: #0d6efd;
    padding: 2px 8px;
    margin: 2px 4px 2px 0;
    border-radius: 4px;
    font-size: 14px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selected-item .remove-item {
    background: none;
    border: none;
    color: #0d6efd;
    margin-left: 4px;
    padding: 0;
    font-size: 12px;
    cursor: pointer;
    opacity: 0.7;
}

.selected-item .remove-item:hover {
    opacity: 1;
}

.selected-item + .selected-item {
    margin-left: 4px;
}

/* 多选下拉框中的项目 */
.dropdown-option {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
}

.dropdown-option:hover {
    background-color: #f8f9fa;
}

.dropdown-option input[type="checkbox"] {
    margin-right: 8px;
}

.dropdown-option label {
    flex-grow: 1;
    margin-bottom: 0;
    cursor: pointer;
}

.option-count {
    font-size: 12px;
    color: #6c757d;
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
}

/* 筛选标签样式增强 */
.filter-tag {
    display: inline-flex;
    align-items: center;
    background-color: #e7f1ff;
    color: #0d6efd;
    padding: 4px 10px;
    margin: 2px 4px 2px 0;
    border-radius: 4px;
    font-size: 14px;
    border: 1px solid #cfe2ff;
}

.filter-tag .remove-filter {
    background: none;
    border: none;
    color: #0d6efd;
    margin-left: 6px;
    padding: 0;
    font-size: 12px;
    cursor: pointer;
    opacity: 0.7;
}

.filter-tag .remove-filter:hover {
    opacity: 1;
}

/* 不同筛选类型的标签颜色 */
.filter-tag[data-filter="keyword"] {
    background-color: #e7f1ff;
    color: #0d6efd;
    border-color: #cfe2ff;
}

.filter-tag[data-filter="tag"] {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.filter-tag[data-filter="author"] {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

.filter-tag[data-filter="status"] {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

/* 下拉框滚动区域 */
.dropdown-options {
    max-height: 300px;
    overflow-y: auto;
    padding: 0;
}

/* 加载更多提示 */
.load-more-hint {
    border-top: 1px solid #dee2e6;
    padding: 8px 0;
    text-align: center;
    color: #6c757d;
}

/* 无限滚动指示器 */
.loading-indicator {
    padding: 20px;
    text-align: center;
    color: #6c757d;
}

/* 确保下拉框元素可以聚焦 */
.dropdown-header:focus,
.dropdown-header:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* 确保下拉框按钮可以聚焦 */
.custom-dropdown button:focus,
.custom-dropdown button:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* 确保搜索输入框可以聚焦 */
.search-input:focus,
.search-input:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* 确保复选框标签可以聚焦 */
.dropdown-option input[type="checkbox"]:focus + label,
.dropdown-option input[type="checkbox"]:focus-visible + label {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
    border-radius: 3px;
}

/* 标签颜色显示 */
.tag-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 8px;
}

/* 筛选标签样式 */
.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    background-color: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
    color: #495057;
}

.filter-tag .remove-filter {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    margin-left: 4px;
    padding: 2px;
    line-height: 1;
}

.filter-tag .remove-filter:hover {
    color: #dc3545;
}

/* 已选择标签的移除按钮 */
.selected-item .remove-item {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    margin-left: 4px;
    padding: 0;
    font-size: 0.75rem;
}

.selected-item .remove-item:hover {
    color: #dc3545;
}

/* 移除按钮样式 */
.selected-item .remove-item {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    padding: 0 2px;
    font-size: 0.75em;
    line-height: 1;
    margin-left: 4px;
}

.selected-item .remove-item:hover {
    opacity: 1;
    color: #dc3545;
}

/* 筛选标签中的移除按钮 */
.filter-tag .remove-filter {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    padding: 0 2px;
    font-size: 0.9em;
    line-height: 1;
    margin-left: 6px;
}

.filter-tag .remove-filter:hover {
    opacity: 1;
    color: #dc3545;
}
