/**
 * [INPUT]: 无外部依赖
 * [OUTPUT]: 看板样式，选择器/列表/详情
 * [POS]: 前端样式模块，被 index.html 引用，配合 boards.js 和 board-selector.js
 * [PROTOCOL]: 变更时更新此头部，然后检查 /CLAUDE.md
 *
 * 内容: 看板选择模态框, 看板列表, 看板项目卡片, 分享按钮
 */

/* Board Selector Modal */
.board-selector-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10001;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.board-selector-modal.active {
    display: flex;
}

.board-selector-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 360px;
    max-height: 70vh;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

.board-selector-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.board-selector-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.board-selector-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
}

.board-selector-close:hover {
    color: #333;
}

.board-selector-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.board-selector-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    max-height: 300px;
}

.board-selector-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s;
    gap: 12px;
}

.board-selector-item:hover {
    background: #f5f5f5;
}

.board-selector-item.selected {
    background: #e8f4fc;
}

.board-selector-item.default {
    border-bottom: 1px solid #e5e5e5;
    background: #fafafa;
}

.board-selector-item.default:hover {
    background: #f0f0f0;
}

.board-selector-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.board-selector-item.selected .board-selector-checkbox {
    background: #333;
    border-color: #333;
}

.board-selector-checkbox svg {
    width: 12px;
    height: 12px;
    color: white;
    display: none;
}

.board-selector-item.selected .board-selector-checkbox svg {
    display: block;
}

.board-selector-star {
    color: #f39c12;
    font-size: 16px;
}

.board-selector-name {
    flex: 1;
    font-size: 14px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-selector-count {
    font-size: 12px;
    color: #999;
}

.board-selector-create {
    padding: 12px 16px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    gap: 8px;
    background: #fafafa;
}

.board-selector-create input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.board-selector-create input:focus {
    border-color: #333;
}

.board-selector-create button {
    padding: 10px 16px;
    background: #333;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.board-selector-create button:hover {
    background: #555;
}

.board-selector-loading {
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.board-selector-loading .spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

/* Quick add toast */
.board-add-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10002;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.board-add-toast.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.board-add-toast svg {
    width: 18px;
    height: 18px;
}

.board-add-toast.success svg {
    color: #28a745;
}

.board-add-toast.error svg {
    color: #dc3545;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .board-selector-content {
        width: 95%;
        max-height: 60vh;
        position: absolute;
        bottom: 0;
        border-radius: 12px 12px 0 0;
    }

    .board-selector-list {
        max-height: 40vh;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
