/**
 * MCP Universal Category Picker Styles
 */

/* Modal Container */
.mcp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.mcp-modal.hidden {
    display: none;
}

.mcp-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.mcp-modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

/* Modal Header */
.mcp-modal-header {
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.mcp-modal-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: #222;
    flex: 1;
    min-width: 150px;
}

.mcp-cat-search {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s ease;
}

.mcp-cat-search:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.mcp-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    color: #666;
}

.mcp-modal-close:hover {
    background: #e0e0e0;
}

/* Modal Body */
.mcp-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    min-height: 200px;
    max-height: calc(85vh - 200px);
}

.mcp-category-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mcp-category-group {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 16px;
}

.mcp-category-group:last-child {
    border-bottom: none;
}

.mcp-category-group-header {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin-bottom: 12px;
    padding: 8px 0;
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 10;
}

.mcp-category-group-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mcp-category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.mcp-category-item:hover {
    background: #f5f5f5;
}

.mcp-category-item.selected {
    background: #e6f4ff;
    border: 1px solid #0073aa;
}

.mcp-category-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #0073aa;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.mcp-category-item.selected .mcp-category-checkbox {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

.mcp-category-name {
    flex: 1;
    font-size: 15px;
    color: #333;
}

.mcp-loading,
.mcp-error,
.mcp-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 15px;
}

.mcp-error {
    color: #d32f2f;
}

/* Modal Footer */
.mcp-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mcp-selected-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    min-height: 32px;
}

.mcp-pills-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
    margin-right: 8px;
}

.mcp-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #0073aa;
    color: #ffffff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.mcp-pill-remove {
    cursor: pointer;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: background 0.2s ease;
    font-size: 16px;
    line-height: 1;
}

.mcp-pill-remove:hover {
    background: rgba(255, 255, 255, 0.5);
}

.mcp-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.mcp-btn-light {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
    background: #f5f5f5;
    color: #333;
}

.mcp-btn-light:hover {
    background: #e5e5e5;
}

/* Category Picker Button */
.mcp-cat-picker-btn {
    padding: 12px 20px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
    font-weight: 500;
}

.mcp-cat-picker-btn:hover {
    background: #e5e5e5;
    border-color: #ccc;
}

.mcp-cat-label {
    margin-top: 8px;
    min-height: 24px;
}

.mcp-cat-display {
    display: inline-block;
    padding: 6px 12px;
    background: #e6f4ff;
    color: #0073aa;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

.mcp-cat-label .mcp-pill {
    margin-right: 6px;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .mcp-modal {
        padding: 0;
    }
    
    .mcp-modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .mcp-modal-header {
        padding: 16px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .mcp-modal-header h2 {
        font-size: 20px;
    }
    
    .mcp-cat-search {
        width: 100%;
    }
    
    .mcp-modal-body {
        padding: 12px 16px;
    }
    
    .mcp-modal-footer {
        padding: 16px;
    }
    
    .mcp-modal-actions {
        flex-direction: column;
    }
    
    .mcp-btn--primary,
    .mcp-btn-light {
        width: 100%;
    }
}

